Child dialogs in Win32
-
Hey! I'm trying to get a child dialog to show up in a pure Win32 app. What I want to do is use the dialog as half of the UI and use a simple ListBox (created with CreateWindowEx) as the other half. Here's what I'm trying: hCtrls = CreateDialog( hInst, (LPCTSTR)IDD_GAMEINFO, hWnd, (DLGPROC)DlgGameInfo ); The line of code works for all non-child dialogs (like my About and Options dialogs), however as soon as I specify in the resource editor that my IDD_GAMEINFO should be a child it doesn't work. Any help is appreciated! Thanks ./[tiller]
-
Hey! I'm trying to get a child dialog to show up in a pure Win32 app. What I want to do is use the dialog as half of the UI and use a simple ListBox (created with CreateWindowEx) as the other half. Here's what I'm trying: hCtrls = CreateDialog( hInst, (LPCTSTR)IDD_GAMEINFO, hWnd, (DLGPROC)DlgGameInfo ); The line of code works for all non-child dialogs (like my About and Options dialogs), however as soon as I specify in the resource editor that my IDD_GAMEINFO should be a child it doesn't work. Any help is appreciated! Thanks ./[tiller]
-
The hWnd is the HWND variable that the main window's WndProc message handler recieves. In the switch statement for the various windows messages I basically have the following to create my UI: case WM_CREATE: HWND hCtrls; // Listbox works hCtrls = CreateWindowEx( WS_EX_CLIENTEDGE, "LISTBOX", "", WS_CHILD | WS_VISIBLE | WS_VSCROLL | WS_HSCROLL, 5, 5, 200, 340, hWnd, (HMENU)IDC_GAMELISTBOX, GetModuleHandle(NULL), NULL); // Static frame works hCtrls = CreateWindowEx( WS_EX_CLIENTEDGE, "STATIC", "", WS_CHILD | ~WS_VISIBLE | SS_GRAYFRAME, 210, 5, 250, 340, hWnd, (HMENU)IDC_GAMEINFOFRAME, GetModuleHandle(NULL), NULL); // CreateDialog returns a NULL (IDD_GAMEINFO is my dialog resource) hCtrls = CreateDialog( hInst, (LPCTSTR)IDD_GAMEINFO, hWnd, (DLGPROC)DlgGameInfo ); // I also added this later to try it...but it didn't help: ShowWindow( hCtrls, SW_SHOWNORMAL ); UpdateWindow( hCtrls ); I experimented a bit...the code with no modification works if I specify in the resource editor that the dialog is a regular popup with a border, etc. But of course then it's a popup...and I want it a part of the actually window. (Like a common control would be) Thanks, ./[tiller]
-
Hey! I'm trying to get a child dialog to show up in a pure Win32 app. What I want to do is use the dialog as half of the UI and use a simple ListBox (created with CreateWindowEx) as the other half. Here's what I'm trying: hCtrls = CreateDialog( hInst, (LPCTSTR)IDD_GAMEINFO, hWnd, (DLGPROC)DlgGameInfo ); The line of code works for all non-child dialogs (like my About and Options dialogs), however as soon as I specify in the resource editor that my IDD_GAMEINFO should be a child it doesn't work. Any help is appreciated! Thanks ./[tiller]
-
Not sure that this is your case, but for child dialogs you have to ensure that the WS_VISIBLE style attribute is set in the resource. :cool:
Yeah...I have WS_VISIBLE selected. ./[tiller]