I’ve been messing with Win32 API for abit, and I’ve got a question regarding the GUI functions.
How does one handle user input that is not managed through popup windows? I’ve been reading http://www.winprog.org/ but right when the interesting features comes — lesson9 — it becomes more abstract and I’m not sure how to do it.
Basically what I am after is the user to write input in two windows and then press a button to send a message that the content of the input is to be processed.
I think the input windows would be some EDIT-class windows and the input BUTTON-class but that’s about it.
Any ideas? I’m sure it’s simple, it’s just makes me want to rip my hair of in native code :p
Cheers
You’re correct, you want and
EDITcontrol which is more commonly known as aTextBoxand aBUTTONclass which is a command button.To get the the input the Button will send a
WM_COMMANDmessage to its parent window with aBN_CLICKEDin thewParamhigh word. You can identify the particular button from thehWndyou get in that message.After that you’ll need to post a
WM_GETTEXTto the edit control to retrieve the users input.This is all from memory so I highly recommend looking up the msdn pages before you code.