Advertisement

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

Started by October 31, 2000 10:16 PM
1 comment, last by JSCFaith 24 years, 2 months ago
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
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.
Advertisement
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.
WhoopA, the Official Kicker of Butts--- Where have I been all these years?

This topic is closed to new replies.

Advertisement