CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Apr 2013
    Location
    Prague / Cracow
    Posts
    47

    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

  2. #2
    Join Date
    Apr 2013
    Location
    Prague / Cracow
    Posts
    47

    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!

  3. #3
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,396

    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

  4. #4
    Join Date
    Nov 2000
    Location
    Voronezh, Russia
    Posts
    6,620

    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
  •  





Click Here to Expand Forum to Full Width

Featured