Board index » cppbuilder » Create main window from dialog resource by using CreateWndowEx() function

Create main window from dialog resource by using CreateWndowEx() function


2003-10-31 03:08:54 PM
cppbuilder82
Hi, I want to know how to create a main window from dialog resource by
CreateWindowEx function. The CreateWindowEx() has one parameter "LPVOID
lpParam". Is this related?
 
 

Re:Create main window from dialog resource by using CreateWndowEx() function

For dialog resource I use
int DialogBox(
HINSTANCE hInstance, // handle to application instance
LPCTSTR lpTemplate, // identifies dialog box template
HWND hWndParent, // handle to owner window
DLGPROC lpDialogFunc // pointer to dialog box procedure
);
 

Re:Create main window from dialog resource by using CreateWndowEx() function

Using DialogBox() to create dialog is a child window
of the main window. The Dialog Box function to
handle message is different from Windows Procedure.
If I want a dialog resource to become a main window,
that is it can handle main window message as the
windows created by CreateWindow() function,
how to do that?
 

{smallsort}

Re:Create main window from dialog resource by using CreateWndowEx() function

"akuma" < XXXX@XXXXX.COM >wrote in message
Quote
Using DialogBox() to create dialog is a child window
of the main window. The Dialog Box function to
handle message is different from Windows Procedure.

If I want a dialog resource to become a main window,
that is it can handle main window message as the
windows created by CreateWindow() function,
how to do that?


Something like this?
/*
Entry point for this Windows program.
*/
int APIENTRY WinMain(HINSTANCE hInstance,
HINSTANCE ,
LPSTR ,
int )
{
return DialogBox(hInstance, MAKEINTRESOURCE(IDD_MAIN),
0, DialogProc);
}
Hope this helps,
Gary
home.att.net/~setterg