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. how to override start button?

how to override start button?

Scheduled Pinned Locked Moved C / C++ / MFC
questiontutorial
5 Posts 3 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.
  • D Offline
    D Offline
    dj4400
    wrote on last edited by
    #1

    Hi all, I am writing an application that checks the correct functionality of a keyboard. I am doing so by overriding the PreTranslateMessage(MSG *pMsg). In my PreTranslateMessage i am catching all the WM_KEYDOWN and WM_SYSKEYDOWN messages and read from the wparam which key was pressed . I have 2 problems: 1. When pressing the start button (VK_LWIN), the start button is actually pressed and the start menu is opened. The menu is being opened even if i put a break point in the beginning of my PreTranslateMessage. I just want to know when the start button was pressed and i dont want it to open the start menu. :~ 2. It seems that the print screen button doesn't generate any of the 2 messages that i process in the PreTranslateMessage. what is the window message that is generated when i press the print screen key? :confused: Thanks Simon

    P S 2 Replies Last reply
    0
    • D dj4400

      Hi all, I am writing an application that checks the correct functionality of a keyboard. I am doing so by overriding the PreTranslateMessage(MSG *pMsg). In my PreTranslateMessage i am catching all the WM_KEYDOWN and WM_SYSKEYDOWN messages and read from the wparam which key was pressed . I have 2 problems: 1. When pressing the start button (VK_LWIN), the start button is actually pressed and the start menu is opened. The menu is being opened even if i put a break point in the beginning of my PreTranslateMessage. I just want to know when the start button was pressed and i dont want it to open the start menu. :~ 2. It seems that the print screen button doesn't generate any of the 2 messages that i process in the PreTranslateMessage. what is the window message that is generated when i press the print screen key? :confused: Thanks Simon

      P Offline
      P Offline
      Perspx
      wrote on last edited by
      #2

      Have you tried using SetWindowsHookEx() with the WH_KEYBOARD or WH_KEYBOARD_LL hook procedure? Look at the docs here. Regards, --Perspx

      "The Blue Screen of Death, also known as The Blue Screen of Doom, the "Blue Screen of Fun", "Phatul Exception: The WRECKening" and "Windows Vista", is a multi award-winning game first developed in 1995 by Microsoft" - Uncyclopedia Introduction to Object-Oriented JavaScript

      1 Reply Last reply
      0
      • D dj4400

        Hi all, I am writing an application that checks the correct functionality of a keyboard. I am doing so by overriding the PreTranslateMessage(MSG *pMsg). In my PreTranslateMessage i am catching all the WM_KEYDOWN and WM_SYSKEYDOWN messages and read from the wparam which key was pressed . I have 2 problems: 1. When pressing the start button (VK_LWIN), the start button is actually pressed and the start menu is opened. The menu is being opened even if i put a break point in the beginning of my PreTranslateMessage. I just want to know when the start button was pressed and i dont want it to open the start menu. :~ 2. It seems that the print screen button doesn't generate any of the 2 messages that i process in the PreTranslateMessage. what is the window message that is generated when i press the print screen key? :confused: Thanks Simon

        S Offline
        S Offline
        sashoalm
        wrote on last edited by
        #3

        Those two buttons, and a couple of others are special. They're not forwarded to your application at all, instead Windows processes these key combinations internally. It's like Ctrl+Alt+Del

        There is sufficient light for those who desire to see, and there is sufficient darkness for those of a contrary disposition. Blaise Pascal

        D 1 Reply Last reply
        0
        • S sashoalm

          Those two buttons, and a couple of others are special. They're not forwarded to your application at all, instead Windows processes these key combinations internally. It's like Ctrl+Alt+Del

          There is sufficient light for those who desire to see, and there is sufficient darkness for those of a contrary disposition. Blaise Pascal

          D Offline
          D Offline
          dj4400
          wrote on last edited by
          #4

          Is there a way to catch those key strokes before Windows processes them?

          S 1 Reply Last reply
          0
          • D dj4400

            Is there a way to catch those key strokes before Windows processes them?

            S Offline
            S Offline
            sashoalm
            wrote on last edited by
            #5

            Yes, by using SetWindowsHookEx() withWH_KEYBOARD or WH_KEYBOARD_LL, as Perspx said.

            There is sufficient light for those who desire to see, and there is sufficient darkness for those of a contrary disposition. Blaise Pascal

            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