BG Development


  Reply to this topicStart new topicStart Poll

>  WM_KEYDOWN, win API
iceless
   : 25-04-2013, 19:36
Quote Post



:
:
:

: 25
: 20.01.13



.
WIN API, ( ). WM_KEYDOWN. , +, -, *, / = . , , , . VM_HOME Home Editbox- Success!. , . :

CODE

// ......

BOOL CALLBACK InitProc( HWND hDlgWnd,
UINT Message,
WPARAM wParam,
LPARAM lParam )
{
HWND hEdit = GetDlgItem (hDlgWnd, IDC_EDIT);
switch(Message)
{
// .........

case WM_KEYDOWN:
switch (wParam)
{
case VK_HOME:
SetDlgItemText(hDlgWnd, IDC_EDIT, "Success!");
break;
default:
break;
}
/*val = (int) wParam;

if( val & VK_HOME )
{
SetDlgItemText(hDlgWnd, IDC_EDIT, "Success!");
}*/

/*if (wParam == VK_HOME)
{
SendMessage(hEdit, WM_KILLFOCUS, NULL, NULL);
 SetDlgItemText(hDlgWnd, IDC_EDIT, "Success!");
}*/
break;

// .......



iceless 25-04-2013, 19:38
PMEmail Poster
Top
dvader
: 25-04-2013, 20:47
Quote Post


Group Icon
:
: VIP
:

: 4572
: 12.07.05



, "" - , .

, . TranslateAccelerator()


--------------------
I find your lack of faith disturbing
PM
Top
iceless
: 28-04-2013, 14:10
Quote Post



:
:
:

: 25
: 20.01.13



. , . icon_smile.gif
PMEmail Poster
Top
iceless
: 02-05-2013, 21:49
Quote Post



:
:
:

: 25
: 20.01.13



..

+- (negate) .

:

CODE

case IDC_BTN_NEGATE:
SendMessage(hEdit, EM_SETSEL, 0, 1); //
tNumber = SendMessage(hEdit, EM_GETSEL, NULL, NULL); // string tNumber
if (tNumber == "-")
{
SendMessage(hEdit, EM_REPLACESEL, (WPARAM)true, (LPARAM)(LPCTSTR) "");// -
}
else if (tNumber != "-")
{
SendMessage(hEdit, EM_SETSEL, 0, 0);
SendMessage(hEdit, EM_REPLACESEL, (WPARAM)true, (LPARAM)(LPCTSTR) "-"); // -
}
break;


EM_GETSEL. . tNumber string.



iceless 02-05-2013, 21:50
PMEmail Poster
Top
dvader
: 09-05-2013, 10:05
Quote Post


Group Icon
:
: VIP
:

: 4572
: 12.07.05



** SendMessage(),


--------------------
I find your lack of faith disturbing
PM
Top
1 (1 , 0 )
, :

Topic Options Reply to this topicStart new topicStart Poll

 


Copyright © 2003-2019 | BG Development | All Rights Reserved
RSS 2.0