Jump to content
  • Advertisement
Sign in to follow this  
sipickles

[win32 GDI]Remind me... Looking for ENTER

This topic is 4336 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 have gone brain dead or something. I need help! I need to know when someone has entered a new value in an Edit Box and hit return. I'm doing this in my message loop, but its wrong! I used to know this... once!
		case WM_COMMAND:
			switch(LOWORD(wParam))
			{
			case IDC_EB_numVerts: // EidtBox ID 
				if (HIWORD(wParam) == VK_RETURN )
					g_log->Log("numVerts\n");
				break;
....

Any help appreciated :)

Share this post


Link to post
Share on other sites
Advertisement
If I recall correctly when you press enter the default behavior is for the edit control to look for a button with the BS_DEFPUSHBUTTON style and simulate a click of that. You can override this by specifying ES_WANTRETURN. So, assuming your UI is simple enough you can just put the edit handler code in the button handler and skip all the complicated stuff like subclassing. I could be misrembering, it's been a long time.

And to nitpick, this topic has 100% completely nothing to do with GDI...

Share this post


Link to post
Share on other sites
How about the EN_CHANGE message, sent using the WM_COMMAND message. OK, it doesn't respond to a return but will be sent whenever the text changes.

Skizz

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

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

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!