Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

JSCFaith

Using GetDlgItemInt... I guess not really game related.

This topic is 6465 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I am making a game, and now I am trying to make a little setup program you can run before it, I just have one simple question. I am trying to get an int from an edit box in windows. I know that you are supposed to use the GetDlgItemInt() funtion, but I can''t understand how you would use that funtion to store a value in an "int." If anyone could help me that would be great. Thanks Later, James

Share this post


Link to post
Share on other sites
Advertisement
make the dialog box a resource, and assign tags to each window (IDOK is standard for the OK button, IDCANCEL for the cancel button). Then, in your application defined dialog box procedure, process the WM_COMMAND message.

HIWORD(wParam) is the notification code.
LOWORD(wParam) is the control ID (IDOK, IDCANCEL, etc.)
(HWND)lParam is a handle to the control.

Just read up in MSDN on anything i left out.

Share this post


Link to post
Share on other sites
Let''s say you had a field marked IDI_NUMBER that has an unsigned (always positive) value. You would call it like this:

    
BOOL CALLBACK DlgProc (HWND window, UINT msg, WPARAM wp, LPARAM lp)
{
int number;
.
.
.
number = GetDlgItemInt(window,IDI_NUMBER,NULL,FALSE);


You''d need to have everything created already. You do know how to do that, right? I have actual samples if you need help.

WhoopA, the Official Kicker of Butts

--- With all its sham, drudgery and broken dreams, it is still a beautiful world. Be careful. Strive to be happy.
Everywhere I look, I see rabbits. Maybe I should take down all my Sailor Moon stuff.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!