![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Programmer
Join Date: Dec 2004
Posts: 50
Rep Power: 4
![]() |
How to use resource dialog as application window
Hello everyone
![]() I wonder how can I use a dialog box that I created as a resource, as applications main window that receives all the messages. I mean, when I create a window with CreateWindowEx it creates a blank window and I need to use subsequent CreateWindowEx calls to add controls etc and its a big headache. How to make it use a dialog resource instead? |
|
|
|
|
|
#2 |
|
Newbie
|
To make a dialog box the main window, inside of WinMain use the function :
DialogBoxParam(NULL, MAKEINTRESOURCE(IDD_DIALOG), NULL, (DLGPROC) DlgProc, 0);
__________________
On and on.... |
|
|
|
|
|
#3 |
|
Programmer
Join Date: Dec 2004
Posts: 50
Rep Power: 4
![]() |
thanks
![]() do dialog boxes receive WM_PAINT messages and whats the difference between creating the window by code +using CreateWindowEx for all controls and making a dialog box using a resource? Do their differ somehow (like receive different messages or smth because CreateWindowEx creates a "window" while CreateDialog creates a "modeless dialog") I would really appreciate it if you could answer these questions ![]() |
|
|
|
|
|
#4 |
|
Newbie
|
With a dialog box, you do not have to handle a WM_PAINT message.
And with the difference between the two, you are correct that they will receive messages differently. A message box will not receive all the messages that a "normal" WinProc would, but you may not always need to receive those messages. Dialog boxes are basically just a window that works with child controls. Basically it comes down to how much control do you want/need. Dialog boxes cannot do everything , but many times you do not need to do everything.
__________________
On and on.... |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|