This site is no longer active and is available for archival purposes only. Registration and login is disabled.

Detecting if Enter is pressed


Detecting if Enter is pressed

Postby ryanc » Jul 17, 2002 @ 5:34pm

I have a VisualC dialog based application that I'm having trouble with (on a Symbol PDT8100 PocketPC with WinCE3.0). This particular dialog has 3 edit boxes and 2 buttons, and I what I want to happen is that if the Enter key is pressed at any time while typing into the edit boxes, its the same as pressing one of the buttons.

I've only played with Visual C for a short period of time, but I would have expected WM_KEYDOWN or WM_CHAR to occur every time a character is typed into the edit boxes so I could just check for a VK_RETURN or something like that, but that isn't what happens. Every time any key is pressed, WM_COMMAND is sent (I can easily tell by just putting a MessageBeep inside WM_COMMAND - if I do the same for WM_KEYDOWN I hear nothing) and I don't seem to have any way to tell what key it was that was pressed, because in the case of wm_command I believe wParam refers to an identifier.

I tried, on WM_COMMAND, getting the buffer from the edit boxes and checking if the last character was a '\n', but apparently the enter key doesn't insert a newline into the buffer.

Any ideas? I'm sure its something simple I'm overlooking..
ryanc
pm Member
 
Posts: 8
Joined: Jul 17, 2002 @ 4:12pm


Postby Dan East » Jul 18, 2002 @ 3:16am

User avatar
Dan East
Site Admin
 
Posts: 5264
Joined: Jan 25, 2001 @ 5:19pm
Location: Virginia, USA


Postby britcode » Jul 18, 2002 @ 3:43am

britcode
 


Return to Windows Mobile


Sort


Forum Description

A discussion forum for mobile device developers on the Windows Mobile platform. Any platform specific topics are welcome.

Moderators:

Dan East, sponge, Digby, David Horn, Kevin Gelso, RICoder

Forum permissions

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum