Skip to main content
gamedev.net
🔒 Locked

Easy Window Boxes/Using Resources

Started by Psychocatt 0 replies 600+ views
Original Post
Psychocatt
Psychocatt
I''m probablly going to answer my own question, but I thought I would see if anyone knows for sure. I am starting to program Windows and I have the basics down. I want to know if there is an easy way to create/load/display custom dialog boxes. For example, I have a dialog box with a directory tree in it. Would it be possible(or even easy) to display that box to have the user select which directory they want to save/open at? I have looked into resources(and am still trying to get them working) but most everything that I can find uses MFC to do a lot and I haven''t learned MFC yet(nor do I think I want to). I want just basic support for Directory Trees, List and Combo Boxes, Slider Bars and Check/Radio boxes. Am I correct in using Resources to accomplish this or is that mostly for MFC programming. If so, is it easy to learn MFC, or more accuratlly, is it easy to learn DirectX with MFC? Thanks for your time!
Ironblayde
Ironblayde
I haven''t done much with MFC, but it''s pretty easy to get custom dialog boxes working with just the Win32 API. You''re right, dialog boxes that you make should be included as resources. If you''re using Visual C++, just go under the Insert menu and find Resource. That will let you create new dialog boxes and add them to your project.

Once you have that you can create and manage your dialog boxes. Look up the DialogBoxParam() function in MSDN for creating modal dialog boxes. It should tell you a lot of what you need to know and link to other useful functions. Some of the ones you might want to look for:


  • SendDlgItemMessage() for sending messages to dialog box controls using their IDs only
  • GetDlgItemInt() and GetDlgItemText() for retrieving the values of dialog box controls
  • SetDlgItemInt() and SetDlgItemText() for initializing the values of dialog box controls
  • EndDialog() for closing a dialog box window


This should all be used within a callback function similar to the one you use for any window, but that should all be explained in the MSDN as well.

-Ironblayde
 Aeon Software

Down with Tiberia!
"All your women are belong to me." - Nekrophidius
"Your superior intellect is no match for our puny weapons!"

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.