CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Jul 1999
    Location
    Bangalore,India
    Posts
    7

    how to send keyboard inputs...

    Hi,
    when a propertysheet is active, I want to call another exe , by pressing function key F2. I called propertysheet using DoModal().
    Advice please.
    Rohini.



  2. #2
    Join Date
    Oct 1999
    Posts
    7

    Re: how to send keyboard inputs...

    1. Try to map wm_char message
    afx_msg void OnChar( UINT nChar, UINT nRepCnt, UINT nFlags )
    2. During its handling check for F2 .

    3. If it is F2 then use -
    int _execl( const char *cmdname, const char *arg0, ... const char *argn, NULL );

    method to execute other process .
    4. But u have to close ur property sheet during execl because model dialog box are working with user thread and have to finish the call .. Else create ur property sheet modeless.




  3. #3
    Join Date
    Aug 1999
    Location
    Bangalore , India
    Posts
    2

    Re: how to send keyboard inputs...

    Hi,
    You can also catch the key down message by overloading the virtual function

    CWnd::PreTranslateMessage(MSG* pMsg);



    in your class.

    In that function , you can check for F2 key down
    by using the following condition

    if(pMsg->message == WM_KEYDOWN && pMsg->wParam == VK_F2)
    {
    // call your external application
    }




    Anand



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