Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Feb 20th, 2005, 2:49 PM   #1
some1
Programmer
 
Join Date: Dec 2004
Posts: 50
Rep Power: 4 some1 is on a distinguished road
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?
some1 is offline   Reply With Quote
Old Feb 20th, 2005, 9:39 PM   #2
drewlander
Newbie
 
drewlander's Avatar
 
Join Date: Jan 2005
Location: Pittsburgh, PA
Posts: 16
Rep Power: 0 drewlander is on a distinguished road
Send a message via AIM to drewlander
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....
drewlander is offline   Reply With Quote
Old Feb 21st, 2005, 6:36 AM   #3
some1
Programmer
 
Join Date: Dec 2004
Posts: 50
Rep Power: 4 some1 is on a distinguished road
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
some1 is offline   Reply With Quote
Old Feb 21st, 2005, 7:24 AM   #4
drewlander
Newbie
 
drewlander's Avatar
 
Join Date: Jan 2005
Location: Pittsburgh, PA
Posts: 16
Rep Power: 0 drewlander is on a distinguished road
Send a message via AIM to drewlander
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....
drewlander is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 12:39 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC