Advertisement

Windows Programming Question

Started by April 18, 2001 04:57 PM
7 comments, last by Bino 23 years, 9 months ago
1.) How could I make a program that begins showing a dialog box instead of a normal program window? Also, in basic C not in MFC. Update: Question #2 How do I put check boxes in the main window, not the dialog box? Thanks, Bino Edited by - Bino on April 19, 2001 12:45:20 AM
Simple... just don''t call CreateWindowEx(), or whatever you''re using to create your window. Instead use CreateDialog() and pass it the dialog resource you want to use to create your dialog. (Actually CreateDialog() uses CreateWindowEx(), but you know what I mean.) Look up CreateDialog() in MSDN.

-Ironblayde
 Aeon Software

Down with Tiberia!
"All your women are belong to me." - Nekrophidius
"Your superior intellect is no match for our puny weapons!"
Advertisement
Thanks. Now I've got another question, but not about dialog boxes. Do you know how to put check boxes in the main window? I've tried looking in MSDN and it says something about a button class, but I have no idea what they're talking about.

Thanks, Bino

Edited by - Bino on April 19, 2001 1:11:03 AM
To call CreateDialog() you need to pass it the hwnd of the parent window. So how do you do that if it''s the main window?
Use NULL instead of the hWnd.

/Henrik
/pitchblack
Can someone help me with my 2nd question please?

Thanks,
Bino
Advertisement
You use CreateWindow or CreateWindowEx for that, too. Basically, you do everything the same as you do when creating a stand-alone window, except that your window class must be "BUTTON" and you have to set all of the appropriate style flags. I don''t know what they are offhand, but you can probably figure it out from MSDN or the Platform SDK. That''s it, really.
http://www.dum.chalmers.se/~amag/wintut/wtpart1.shtml
Thanks, it worked! But, now I have one last question. How do I position the check box to a certian place in the window? By default, it''s putting the checkbox in the middle-left.

This topic is closed to new replies.

Advertisement