Jump to content
  • Advertisement

Archived

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

Bucket_Head

Win32 API help plz

This topic is 6652 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''m not very adept at the Win32 API, and I am hoping there is someone out there who is, and who is willing to help me out. I am making a really simple (low poly) 3D modelling program, using OpenGL. I already have the format laid out and the graphics parts running. My problem is the input... I was planning to have the user input the values for the triangles and then be able to view them in 3D and rotate them around. For the input, I planned to have some sort of dialog box pop up with spots for them to input several floats. I am not quite sure how to go about this. What I need is a dialog box of some sort, or something, that the user can type numerical input into and which I can then store in variables... If you can help me out, please do! Also, if you have any other suggestions about possible better ways to do this, do let me know...Thank you very much for your time.

Share this post


Link to post
Share on other sites
Advertisement
ok well if your using MSVC, create the dialog box as a resource, theres a resource editor where you can design the dialog box, then in your program put a call to

int DialogBox(
HINSTANCE hInstance, // handle to application instance
LPCTSTR lpTemplate, // identifies dialog box template
HWND hWndParent, // handle to owner window
DLGPROC lpDialogFunc // pointer to dialog box procedure
);

to create the dialog box.

you also need to create a message processor for the dialog box

BOOL CALLBACK DialogProc(
HWND hwndDlg, // handle to dialog box
UINT uMsg, // message
WPARAM wParam, // first message parameter
LPARAM lParam // second message parameter
);

to get input from the dialog boxes use the functions

UINT GetDlgItemInt(
HWND hDlg, // handle to dialog box
int nIDDlgItem, // control identifier
BOOL *lpTranslated,
// points to variable to receive success/failure
// indicator
BOOL bSigned // specifies whether value is signed or unsigned
);

and

UINT GetDlgItemText(
HWND hDlg, // handle of dialog box
int nIDDlgItem, // identifier of control
LPTSTR lpString, // address of buffer for text
int nMaxCount // maximum size of string
);

look the functions up in MSDN for a detailed description.

Edited by - Chris F on 3/7/00 11:04:34 PM

Share this post


Link to post
Share on other sites
This is just a thought and it is completely opposite from what i''d normally recommend. If you''re making a modelling program rather than a game, I would think you would probably need a more complex (windows) ui and speed wouldn''t be as much of an issue. you might consider using mfc rather than the win32 api for such a project.

Share this post


Link to post
Share on other sites
Oh, but I hate MFC, and try to avoid using it...I hate the idea of generating code, its just more code that I didn''t write, so that I don''t know where everything is. I''d have to take time to learn how to use MFC effectively, and I''d really rather not have to do that...I was just hoping for a quick, simple function that would return some input.

For example, take the function MessageBox(). It''s a quick, easy way to create a small dialog box that tells the user something and returns a code telling which of its buttons was pressed. I was hoping there may be something along the same lines, maybe called something like InputBox() (though I checked that one out, and there''s no such function in C/C++...) ...that would have one of those fields to type text in.

I don''t like having to deal with resource files, but I suppose I will if there''s no other way... *sighs* oh well, thanks.

- Hai, watashi no chichi no kuruma ga oishii deshita!
...or, in other words, "Yes, my dad's car was deliscious!"

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!