开发者

C++ -- Win32 API, GUI stuff

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 EDIT control which is more commonly known as a TextBox and a BUTTON class which is a command button.

To get the the input the Button will send a WM_COMMAND message to its parent window with a BN_CLICKED in the wParam high word. You can identify the particular button from the hWnd you get in that message.

After that you'll need to post a WM_GETTEXT to 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.


I'm not sure I follow 100%. Yes, you would use EDIT and BUTTON-class controls for that. Where are you getting stuck?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜