-
May 3rd, 2013, 07:02 AM
#1
WM_NOTIFY for EDITTEXT (Edit Control)
hey ho!
Would be grateful for any hint
Is there any similar notification code to WM_NOTIFY but which will work with Edit Control?
WM_NOTIFY unfortunately is not sent for Edit control and what i want to do is to:
1. check if the notification comes from certain identifier (here: IDC_inv_comment)
2. if it was double clicked
3. if (1 && 2 == true) then call the function "writetextfromdb" passing that identifier among other parameters.
This is the code i tried to use, the same one i used for e.g. ListView but it's not working for my EditControl:
Code:
case WM_NOTIFY:
switch((( LPNMHDR ) lParam )->code )
{case NM_DBLCLK:
if(((( LPNMHDR ) lParam )->idFrom ) == IDC_inv_comment)
{writetextfromdb(hwnd, IDC_inv_comment, "t_invoices", "inv_dok_code"); }
}break; break;
WM_NOTIFY is simply not sent for EditControls.
cheers
berkov
-
May 3rd, 2013, 07:58 AM
#2
Re: WM_NOTIFY for EDITTEXT (Edit Control)
I also tried this:
Code:
case WM_COMMAND:
{
switch( LOWORD( wParam ) )
{
case IDC_inv_comment: if(HIWORD( wParam )==WM_LBUTTONDBLCLK) writetextfromdb(hwnd, IDC_inv_comment, "t_invoices", "inv_dok_code");
}
} break;
but no success!
I will only add that the window from which the notification should come from is a dialog:
Code:
hdFVT=CreateDialog( GetModuleHandle (0), MAKEINTRESOURCE( 1000 ), hwMain, WndProc_dFVT );
in resources.rc:
Code:
LANGUAGE 0, SUBLANG_NEUTRAL
IDD_FVT DIALOGEX 0, 0, 319, 220 //where IDD_FVT has value 1000.
STYLE DS_3DLOOK | DS_CENTER | DS_MODALFRAME | DS_SHELLFONT | WS_CAPTION | WS_VISIBLE | WS_POPUP | WS_SYSMENU
CAPTION "caption"
FONT 8, "Verdana"
{
EDITTEXT IDC_inv_comment, 28, 113, 266, 25, ES_AUTOHSCROLL | WS_TABSTOP
}
i even tried to add CS_DBLCLKS style in resources.rc - but once again - no success!
-
May 3rd, 2013, 01:42 PM
#3
Re: WM_NOTIFY for EDITTEXT (Edit Control)
WM_LBUTTONDBLCLK is NOT a notification code but a Windows message.
Did you try to handle WM_LBUTTONDBLCLK rather than WM_COMMAND?
Victor Nijegorodov
-
May 5th, 2013, 08:35 AM
#4
Re: WM_NOTIFY for EDITTEXT (Edit Control)
Edit Control Notifications do not include double click event. To catch one you have to subclass the control and provide your custom handler for WM_LBUTTONDBLCLK message.
Best regards,
Igor
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|