Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Sending messages to another application

Sending messages to another application

Scheduled Pinned Locked Moved C / C++ / MFC
help
5 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    Richard Lewis
    wrote on last edited by
    #1

    Hi! I was implementing the On-screen keyboard application that comes with Windows. I have two queries regarding this: 1. I have made my app 'always on top', but the problem is setting focus to the application just below this one. I am aware that SetFocus is useless in this case. I want to find a way to this using GetNextWindow 2. Let's assume notepad is going to be receiving keystrokes via this on-screen keyboard app. Can anyone send me code to this. I have tried something like: DWORD dwProcessID; ::GetWindowThreadProcessId(hForeground,&dwProcessID); ::PostThreadMessage(dwProcessID, WM_KEYDOWN, 65, 1); ::PostThreadMessage(dwProcessID,WM_CHAR, 65,1); ::PostThreadMessage(dwProcessID, WM_KEYUP, 65,1); But this doesnt help. Any help will be greatly appreciated. Thanks for your time Richard

    J 2 Replies Last reply
    0
    • R Richard Lewis

      Hi! I was implementing the On-screen keyboard application that comes with Windows. I have two queries regarding this: 1. I have made my app 'always on top', but the problem is setting focus to the application just below this one. I am aware that SetFocus is useless in this case. I want to find a way to this using GetNextWindow 2. Let's assume notepad is going to be receiving keystrokes via this on-screen keyboard app. Can anyone send me code to this. I have tried something like: DWORD dwProcessID; ::GetWindowThreadProcessId(hForeground,&dwProcessID); ::PostThreadMessage(dwProcessID, WM_KEYDOWN, 65, 1); ::PostThreadMessage(dwProcessID,WM_CHAR, 65,1); ::PostThreadMessage(dwProcessID, WM_KEYUP, 65,1); But this doesnt help. Any help will be greatly appreciated. Thanks for your time Richard

      J Offline
      J Offline
      jmkhael
      wrote on last edited by
      #2

      Better to use FindWindow or FindWindowEx and SendMessage or PostMessage Papa while (TRUE) Papa.WillLove ( Bebe ) ;

      1 Reply Last reply
      0
      • R Richard Lewis

        Hi! I was implementing the On-screen keyboard application that comes with Windows. I have two queries regarding this: 1. I have made my app 'always on top', but the problem is setting focus to the application just below this one. I am aware that SetFocus is useless in this case. I want to find a way to this using GetNextWindow 2. Let's assume notepad is going to be receiving keystrokes via this on-screen keyboard app. Can anyone send me code to this. I have tried something like: DWORD dwProcessID; ::GetWindowThreadProcessId(hForeground,&dwProcessID); ::PostThreadMessage(dwProcessID, WM_KEYDOWN, 65, 1); ::PostThreadMessage(dwProcessID,WM_CHAR, 65,1); ::PostThreadMessage(dwProcessID, WM_KEYUP, 65,1); But this doesnt help. Any help will be greatly appreciated. Thanks for your time Richard

        J Offline
        J Offline
        jmkhael
        wrote on last edited by
        #3

        Good link also http://www.codeproject.com/dialog/keystroke.asp Papa while (TRUE) Papa.WillLove ( Bebe ) ;

        R 1 Reply Last reply
        0
        • J jmkhael

          Good link also http://www.codeproject.com/dialog/keystroke.asp Papa while (TRUE) Papa.WillLove ( Bebe ) ;

          R Offline
          R Offline
          Richard Lewis
          wrote on last edited by
          #4

          Thanks so much for your quick reply, Papa (is that ur name ?):-D

          J 1 Reply Last reply
          0
          • R Richard Lewis

            Thanks so much for your quick reply, Papa (is that ur name ?):-D

            J Offline
            J Offline
            jmkhael
            wrote on last edited by
            #5

            Just a nick, my name is Johnny :) Papa while (TRUE) Papa.WillLove ( Bebe ) ;

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups