Click here to Skip to main content
15,918,742 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: CString to DWORD ? INT ? Pin
Ravi Bhavnani6-Apr-04 11:31
professionalRavi Bhavnani6-Apr-04 11:31 
AnswerRe: CString to DWORD ? INT ? Pin
avenger_sb256-Apr-04 11:49
avenger_sb256-Apr-04 11:49 
GeneralRe: CString to DWORD ? INT ? Pin
Prakash Nadar6-Apr-04 15:31
Prakash Nadar6-Apr-04 15:31 
GeneralCListCtrl - Highlighting all of the selected row Pin
mmica6-Apr-04 10:59
mmica6-Apr-04 10:59 
GeneralRe: CListCtrl - Highlighting all of the selected row Pin
Ravi Bhavnani6-Apr-04 11:06
professionalRavi Bhavnani6-Apr-04 11:06 
Generalclipped controls Pin
pgiustinoni6-Apr-04 6:37
pgiustinoni6-Apr-04 6:37 
GeneralRe: clipped controls Pin
avenger_sb256-Apr-04 7:27
avenger_sb256-Apr-04 7:27 
GeneralShowWindow problem Pin
reznod6-Apr-04 6:09
reznod6-Apr-04 6:09 
For some reason every time I call ShowWindow it just hangs and I never get control of my application back. This didn't happen just earlier today, I may have changed something, but I have it called in two places. I know that one of them (the first example) didn't get changed, so I know that it can't be what I changed.

Here is the code that (I have changed) calls ShowWindow:


bool BuildWindow()
{
 const LPCSTR pstrTitle = "Game";
 const LPCSTR pstrCaption = "Game";

 WNDCLASS pwdcWndSpec = 
 { 
  CS_HREDRAW | CS_VREDRAW, //Style
  WindowProc, //lpfnWndProc
  0, //cbClsExtra
  0, //cbWndExtra
  GetModuleHandle(NULL), //hInstance
  NULL, //hIcon
  NULL, //hCursor
  NULL, //hbrBackground
  NULL, //lpszMenuName
  pstrTitle //lpszClassName
 };

 if ( !RegisterClass( &pwdcWndSpec ) )
 {
  Console::WriteLine("Error: Unable to register window.");
  return false;
 }

 mhwdWndHandle = CreateWindowEx(
  WS_EX_TOPMOST, //dwExStyle
  pstrTitle, //lpClassName
  pstrCaption, //lpWindowName
  WS_POPUP, //dwStyle
  0, //x
  0, //y
 GetSystemMetrics(SM_CXSCREEN), //nWidth
 GetSystemMetrics(SM_CYSCREEN), //nHeight
  NULL, //hWndParent
  NULL, //hMenu
  pwdcWndSpec.hInstance, //hInstance
  NULL ); //lpParam

 if ( !mhwdWndHandle )
 {
  Console::WriteLine("Error: Unable to create window.");
  return false;
 }
 mhinWndInstance = pwdcWndSpec.hInstance;

 ShowWindow( mhwdWndHandle, SW_SHOWNORMAL );
 UpdateWindow( mhwdWndHandle );
 SetFocus( mhwdWndHandle );
 return true;
}


mhwdWndHandle - Global HWND
mhinWndInstance - Global hInstance

The other place I have it called is in a class I made to give better control of the console window (I have not changed):


void AdvancedConsole::SetWndState( enuWndState venuWndState )
{
 ShowWindow( mhwdWndHandle, venuWndState );
}


mhwdWndHandle - Class level HWND
enuWndState - Enumeration:

__value enum enuWndState
{
 wsHidden = SW_HIDE,
 wsMax = SW_SHOWMAXIMIZED,
 wsMin = SW_SHOWMINIMIZED,
 wsNormal = SW_SHOWNORMAL
};


Any help would be greatly appreciated.
GeneralRe: ShowWindow problem Pin
Prakash Nadar6-Apr-04 7:02
Prakash Nadar6-Apr-04 7:02 
GeneralRe: ShowWindow problem Pin
reznod6-Apr-04 7:35
reznod6-Apr-04 7:35 
GeneralRe: ShowWindow problem Pin
reznod6-Apr-04 7:47
reznod6-Apr-04 7:47 
GeneralRe: ShowWindow problem Pin
Prakash Nadar6-Apr-04 15:28
Prakash Nadar6-Apr-04 15:28 
GeneralRe: ShowWindow problem Pin
reznod6-Apr-04 15:55
reznod6-Apr-04 15:55 
General(Another) Debug VS Release crash - help needed! Pin
JonCage6-Apr-04 5:22
JonCage6-Apr-04 5:22 
GeneralRe: (Another) Debug VS Release crash - help needed! Pin
antlers6-Apr-04 5:59
antlers6-Apr-04 5:59 
GeneralRe: (Another) Debug VS Release crash - help needed! Pin
Anders Molin6-Apr-04 13:30
professionalAnders Molin6-Apr-04 13:30 
GeneralRe: (Another) Debug VS Release crash - help needed! Pin
2249176-Apr-04 20:55
2249176-Apr-04 20:55 
GeneralRe: (Another) Debug VS Release crash - help needed! Pin
JonCage6-Apr-04 22:16
JonCage6-Apr-04 22:16 
GeneralRe: (Another) Debug VS Release crash - help needed! Pin
Paul Ranson7-Apr-04 4:08
Paul Ranson7-Apr-04 4:08 
Generalfire button when pressing enter in and edit box Pin
r00k136-Apr-04 5:14
r00k136-Apr-04 5:14 
GeneralRe: fire button when pressing enter in and edit box Pin
Prakash Nadar6-Apr-04 7:07
Prakash Nadar6-Apr-04 7:07 
GeneralRe: fire button when pressing enter in and edit box Pin
avenger_sb256-Apr-04 7:21
avenger_sb256-Apr-04 7:21 
GeneralRe: fire button when pressing enter in and edit box Pin
r00k136-Apr-04 18:59
r00k136-Apr-04 18:59 
GeneralRe: fire button when pressing enter in and edit box Pin
avenger_sb2511-Apr-04 18:02
avenger_sb2511-Apr-04 18:02 
GeneralFiltering of loaded files Pin
the lost zoyd6-Apr-04 4:17
the lost zoyd6-Apr-04 4:17 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.