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. Windows Messages

Windows Messages

Scheduled Pinned Locked Moved C / C++ / MFC
question
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.
  • _ Offline
    _ Offline
    __Cerb
    wrote on last edited by
    #1

    How would it be possible to send a "Print Screen" keydown message or whatever? Which message should I send with which params (if possible) Thanks a lot ~Michael

    D 1 Reply Last reply
    0
    • _ __Cerb

      How would it be possible to send a "Print Screen" keydown message or whatever? Which message should I send with which params (if possible) Thanks a lot ~Michael

      D Offline
      D Offline
      Diddy
      wrote on last edited by
      #2

      You could manually send a WM_KEYDOWN and a WM_KEYUP message, but it's a bit tricky setting up all the flags and what have you. A better way is to use a function for that specific purpose, keybd_event. Look it up in MSDN. Use it something like keybd_event(VK_PRINTSCREEN, ...); If you are trying to simulate a printscreen to do a screen capture and put it onto the clipbopard, a better way is to call GetDc(NULL) to get the DC for the desktop, then grab the bitmap out of the DC and slap it on the clipboard.

      _ 1 Reply Last reply
      0
      • D Diddy

        You could manually send a WM_KEYDOWN and a WM_KEYUP message, but it's a bit tricky setting up all the flags and what have you. A better way is to use a function for that specific purpose, keybd_event. Look it up in MSDN. Use it something like keybd_event(VK_PRINTSCREEN, ...); If you are trying to simulate a printscreen to do a screen capture and put it onto the clipbopard, a better way is to call GetDc(NULL) to get the DC for the desktop, then grab the bitmap out of the DC and slap it on the clipboard.

        _ Offline
        _ Offline
        __Cerb
        wrote on last edited by
        #3

        Thanks a lot, just a little more question about it. I want to simulate that printscreen key in a specific window that is minimized... I've tried adding ' :: ' in front of the keybd_event function, however it still does not take any HWND parameter....

        _ 1 Reply Last reply
        0
        • _ __Cerb

          Thanks a lot, just a little more question about it. I want to simulate that printscreen key in a specific window that is minimized... I've tried adding ' :: ' in front of the keybd_event function, however it still does not take any HWND parameter....

          _ Offline
          _ Offline
          __Cerb
          wrote on last edited by
          #4

          Found it!!! Thanks a lot man, without that keybd_event function I couldn't have guessed it. Thanks!! ~Michael

          D 1 Reply Last reply
          0
          • _ __Cerb

            Found it!!! Thanks a lot man, without that keybd_event function I couldn't have guessed it. Thanks!! ~Michael

            D Offline
            D Offline
            Diddy
            wrote on last edited by
            #5

            No Problem :)

            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