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. Capturing F10

Capturing F10

Scheduled Pinned Locked Moved C / C++ / MFC
questionsales
2 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.
  • C Offline
    C Offline
    Chris Mancini
    wrote on last edited by
    #1

    I am writing an application for a customer and they have selected that F10 and it's variations (Ctl, Alt, Shift) bring up different windows. Now I know that F10 is a System key used for Menu's and such, but I have tried WM_SYSCOMMAND and WM_SYSKEYDOWN to no avail. Here is my code for OnSysCommand: void CMyDialog::OnSysCommand(UINT nID, LPARAM lParam) { if (nID == SC_KEYMENU) { UINT nKey = VK_F10; OnFunctionKey(&nKey); } else { CDialog::OnSysCommand(nID, lParam); } } This works fine...but it works whether the user presses F10 or just Alt, which I don't want. So the basic question is "Has anybody used F10 for something other than a menu initializer?" Thanks Chris Mancini

    S 1 Reply Last reply
    0
    • C Chris Mancini

      I am writing an application for a customer and they have selected that F10 and it's variations (Ctl, Alt, Shift) bring up different windows. Now I know that F10 is a System key used for Menu's and such, but I have tried WM_SYSCOMMAND and WM_SYSKEYDOWN to no avail. Here is my code for OnSysCommand: void CMyDialog::OnSysCommand(UINT nID, LPARAM lParam) { if (nID == SC_KEYMENU) { UINT nKey = VK_F10; OnFunctionKey(&nKey); } else { CDialog::OnSysCommand(nID, lParam); } } This works fine...but it works whether the user presses F10 or just Alt, which I don't want. So the basic question is "Has anybody used F10 for something other than a menu initializer?" Thanks Chris Mancini

      S Offline
      S Offline
      solex
      wrote on last edited by
      #2

      Hi I did this using OnSysKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags) .. if (VK_F10 == nChar) .. and it works fine. Use ::GetKeyState to find out about Alt, Ctrl and so on

      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