[Dev-C++] Enter button in EDIT control
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: Noorez K. <lor...@ho...> - 2006-01-07 06:35:09
|
case WM_COMMAND:
{
switch( LOWORD( wParam ) )
{
case HWND_BUTTON_SENDMSG:
{
if( GetWindowTextLength( GetDlgItem(hwnd, HWND_EDIT_TYPEMSG)
) > 99 )
{
MessageBox(hwnd,"Message Length Too Large","ERROR",MB_OK);
break;
}
else if( GetWindowTextLength( GetDlgItem(hwnd,
HWND_EDIT_TYPEMSG) ) == 0 )
break;
char buffer[100];
GetWindowText( GetDlgItem(hwnd, HWND_EDIT_TYPEMSG), buffer,
100 );
if( strcmp( buffer, "/cls" ) == 0 )
{
SendMessage( GetDlgItem(hwnd,HWND_EDIT_SEEMSG),
WM_SETTEXT, (WPARAM)0, (LPARAM)"" );
SendMessage( GetDlgItem(hwnd,HWND_EDIT_TYPEMSG),
WM_SETTEXT, (WPARAM)0, (LPARAM)"" );
SetFocus( GetDlgItem(hwnd,HWND_EDIT_TYPEMSG) );
break;
}
c->sendMessage( buffer );
SendMessage( GetDlgItem(hwnd,HWND_EDIT_TYPEMSG), WM_SETTEXT,
(WPARAM)0, (LPARAM)"" );
SetFocus( GetDlgItem(hwnd,HWND_EDIT_TYPEMSG) );
}
break;
case HWND_EDIT_TYPEMSG:
{
// check for enter button
}
}
}
break;
Here is my WM_COMMAND for my controls. How can i test for the enter button
in the
HWMD_EDIT_TYPEMSG control where the comment is?
_________________________________________________________________
Take advantage of powerful junk e-mail filters built on patented Microsoft®
SmartScreen Technology.
http://join.msn.com/?pgmarket=en-ca&page=byoa/prem&xAPID=1994&DI=1034&SU=http://hotmail.com/enca&HL=Market_MSNIS_Taglines
Start enjoying all the benefits of MSN® Premium right now and get the
first two months FREE*.
|