How to send a WM_CHAR Message to Firefox

This is a discussion on How to send a WM_CHAR Message to Firefox within the Windows Programming forums, part of the Platform Specific Boards category; Hello. I am trying to send a message of WM_CHAR from an out of process application directly to Firefox or ...

  1. #1
    Registered User
    Join Date
    Feb 2010
    Posts
    7

    How to send a WM_CHAR Message to Firefox

    Hello.

    I am trying to send a message of WM_CHAR from an out of process application directly to Firefox or Internet Explorer. I've got the handle to the Firefox window. The FF web page is setup to Yahoo Mail and I would like to populate the user name and password via SendMessage or PostMessage. Does FF process WM_CHAR messages and if not what would be other means of accomplishing the same. I have tried with no luck in using WM_CHAR with both SendMessage and PostMessage. It does not work. The handle is correct because I can close out Firefox b sending a WM_CLOSE message to it.

    Thanks in advance

    Victor

  2. #2
    Banned
    Join Date
    Aug 2010
    Location
    Ontario Canada
    Posts
    9,547
    Try it with PostThreadMessage() or PostMessage()... With SendMessage() if Firefox hangs it will hang your app too...

    Depending on the internal structure in FireFox you may have to send WM_KEYDOWN and WM_KEYUP pairs instead.

  3. #3
    Registered User
    Join Date
    Feb 2010
    Posts
    7
    Quote Originally Posted by CommonTater View Post
    Try it with PostThreadMessage() or PostMessage()... With SendMessage() if Firefox hangs it will hang your app too...

    Depending on the internal structure in FireFox you may have to send WM_KEYDOWN and WM_KEYUP pairs instead.
    Thanks for the reply. I did try the PostMessage though I had some difficulty with the first parameter of the PostThreadMessage(). But unfortunately it did not work. No characters on the form page for Google.com showed up. I tried both combinations in that I tried just sending a WM_CHAR message then I tried the three of them WM_KEYDOWN, WM_CHAR and WM_KEYUP. In both cases it did not work. I'll keep researching this issue and will post back if I found a solution.

    Appreciate the help

    Victor

  4. #4
    Banned
    Join Date
    Aug 2010
    Location
    Ontario Canada
    Posts
    9,547
    If you're sending WM_KEYDOWN WM_KEYUP... you don't send WM_CHAR...

    You could also try the SendInput() and kbd_event() functions...

    It is entirely possible --likely infact-- that steps have been taken to prevent this for security reasons...

  5. #5
    and the hat of Marriage Rodaxoleaux's Avatar
    Join Date
    Sep 2011
    Location
    ntdll.dll
    Posts
    178
    Quote Originally Posted by CommonTater View Post
    It is entirely possible --likely infact-- that steps have been taken to prevent this for security reasons...
    Highly likely really.

  6. #6
    Registered User
    Join Date
    Feb 2010
    Posts
    7
    Quote Originally Posted by CommonTater View Post
    If you're sending WM_KEYDOWN WM_KEYUP... you don't send WM_CHAR...

    You could also try the SendInput() and kbd_event() functions...

    It is entirely possible --likely infact-- that steps have been taken to prevent this for security reasons...
    Thanks for the reply. Sorry for the late followup. The function kbd_event did the trick. May I ask what did you mean that steps have been taken for security reasons ? Were you referring to SendInput() or SendMessage functions or all the above suggestions for sending keystrokes to a window ?

    Thanks again

    Victor

  7. #7
    Registered User
    Join Date
    Feb 2010
    Posts
    7
    Well I've got good news. I was able to successfully to use the SendMessage() function to send WM_CHAR message to any web page logins. After researching the issue on google everyone were implying that the actual window that they're trying to send messages to was in fact a child window and not a parent. So one needs to use FindWindow to get the the handle to the parent and using this parent handle use the function FindWindowEx by enumerating the windows to get the handle to the child window. You will also need to use Spy++ to find the class name of the child window to use the in the FindWindowEx. Hopefully this might help someone else.

    Bet Wishes

    Victor

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. MPI send message
    By mena samy in forum C Programming
    Replies: 5
    Last Post: 03-05-2011, 07:20 AM
  2. Send ACK message
    By daghenningsorbo in forum C Programming
    Replies: 7
    Last Post: 11-07-2009, 11:14 AM
  3. More Efficient Message Send
    By jmd15 in forum Windows Programming
    Replies: 4
    Last Post: 05-12-2006, 04:53 PM
  4. Who is using a file/How to send a message
    By leonel in forum Windows Programming
    Replies: 0
    Last Post: 01-31-2003, 12:54 PM
  5. how do i send a message from 1 ip to the other ????
    By yorge in forum C++ Programming
    Replies: 4
    Last Post: 04-18-2002, 03:01 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21