CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 11 of 11

Thread: Is there any experts Who can challange this question and come with answer?

  1. #1
    Join Date
    Oct 2003
    Location
    srilanka
    Posts
    88

    Is there any experts Who can challange this question and come with answer?

    I have created a wh_getmessage hook and filtered all the keyboard messages going to the system wide application.

    NOw i have the msg structure with me

    i have to change the wm_char obtained with msg structure to extended ascii character

    how to do this??????

    is any experts available to help me ???
    please

    I need the codings

  2. #2
    Join Date
    Oct 2002
    Location
    Pune, India
    Posts
    55
    can u tell how the msg structure looks like ?

    Seshagiri

  3. #3
    Join Date
    Oct 2003
    Location
    srilanka
    Posts
    88
    typedef struct tagMSG { // msg
    HWND hwnd;
    UINT message;
    WPARAM wParam;
    LPARAM lParam;
    DWORD time;
    POINT pt;
    } MSG;

    lparm contains the wm_char message

  4. #4
    Join Date
    Oct 2002
    Location
    Pune, India
    Posts
    55
    Simply type cast the wparam (not lparam) to get the key pressed.

    char a = (char)wParam_thing;

    u will need to do spl checks for spl keys and capitals etc.

  5. #5
    Join Date
    Oct 2003
    Location
    srilanka
    Posts
    88
    i have the msg structure with me I have obtained the wm_char message with that msgstructure
    Now what i need is to convert that wm_char message with extened ascii character


    how to do this??????

  6. #6
    Join Date
    Oct 2002
    Location
    Pune, India
    Posts
    55
    Is it possible to put the relevant code here ?

    I need to see ur hook implementation etc.

  7. #7
    Join Date
    Nov 2002
    Location
    Lahore, Pakistan
    Posts
    52

    Re: Is there any experts Who can challange this question and come with answer?

    Originally posted by rvvimal
    I have created a wh_getmessage hook and filtered all the keyboard messages going to the system wide application.

    NOw i have the msg structure with me

    i have to change the wm_char obtained with msg structure to extended ascii character

    how to do this??????

    is any experts available to help me ???
    please

    I need the codings

    rvvimal how r u.

    You still have problems with it...

    Send me the zip file and I will try to help you...?

  8. #8
    Join Date
    Oct 2003
    Location
    srilanka
    Posts
    88
    LRESULT CALLBACK MsgFilterFunc (int nCode, WPARAM wParam, LPARAM lParam )
    {
    MSG* Msg = (MSG*)lParam;

    switch( Msg->message )
    {
    case WM_COMMAND:
    break;
    case WM_KEYDOWN:
    break;

    case WM_CHAR
    +++++++++++++++++++++++++++++++++++++++

    Here only i need your help
    ++++++++++++++++++++++++++++++++++++++++

    }

    return( (int)CallNextHookEx(NULL, nCode, wParam, lParam ) );
    }

  9. #9
    Join Date
    Oct 2002
    Location
    Pune, India
    Posts
    55
    Within the case statement for WM_CHAR, u can use this code....

    UINT nchar = wparam;

    switch (nchar)
    {
    case VK_CONTROL :
    if ( ( nFlags & 256 ) == 256 )
    // Right Control Pressed
    else
    // Left Control Pressed;
    break ;

    case VK_LEFT :
    if ( ( nFlags & 256 ) == 256 )
    //Left Arrow Key Pressed;
    else
    //Num Pad Left Arrow key Pressed;
    break ;
    }

  10. #10
    Join Date
    Oct 2002
    Location
    Pune, India
    Posts
    55
    Within the case statement for WM_CHAR, u can use this code....

    UINT nchar = wparam;

    switch (nchar)
    {
    case VK_CONTROL :
    if ( ( Msg->message & 256 ) == 256 )
    // Right Control Pressed
    else
    // Left Control Pressed;
    break ;

    case VK_LEFT :
    if ( ( Msg->message & 256 ) == 256 )
    //Left Arrow Key Pressed;
    else
    //Num Pad Left Arrow key Pressed;
    break ;
    }

  11. #11
    Join Date
    Oct 2003
    Location
    srilanka
    Posts
    88
    Thank u Mr seshagiriRao

    But i want to change that character which i got from there to Extended ascii character

    case VK_A :
    if ( ( Msg->message & 65 ) ==+++ Extended ascii character +++ )
    //
    else
    // Left Control Pressed;
    break ;

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Windows Mobile Development Center


Click Here to Expand Forum to Full Width




On-Demand Webinars (sponsored)