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. EnumWindows()

EnumWindows()

Scheduled Pinned Locked Moved C / C++ / MFC
questionphpdockerhelplounge
3 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.
  • N Offline
    N Offline
    Nirav Doshi
    wrote on last edited by
    #1

    Hello, After enumerating windows, I need to know that a given window CAN accept keyboard input, how can I check that? (By keyboard input, I mean the alphanumeric keys + punctuation keys only, no control keys or extended keys!). No help with IsWindowEnabled(), because it returns a TRUE for windows like the "Microsoft Outlook" main window. Now that is not what I want, because the MS-Outlook main window DOES not accept any alphanumeric keys or punctuation keys. It accepts control keys like ALT+F, UP, DOWN, TAB, SHIFT-TAB, CTRL-O, etc. But it is the MS-Outlook e-mail composer window (which opens when you want to compose a new e-mail), which can accept alphanumeric keys or punctuation keys. I want the composer window to be listed and the MS-Outlook main window, not to be listed. :sigh: Something like the MSN Messenger, ICQ and Yahoo! Messenger main windows. They don't accept alphanumeric + punctuation keys, but only control keys. But the chat window, accepts alphanumeric + punctuation keys. :doh: Is there any way that you have tried something similar, or are you aware about how can I get this going? :confused: Thanks, Rgds, Nirav * Don't wish it was easier, wish you were better! *

    G 1 Reply Last reply
    0
    • N Nirav Doshi

      Hello, After enumerating windows, I need to know that a given window CAN accept keyboard input, how can I check that? (By keyboard input, I mean the alphanumeric keys + punctuation keys only, no control keys or extended keys!). No help with IsWindowEnabled(), because it returns a TRUE for windows like the "Microsoft Outlook" main window. Now that is not what I want, because the MS-Outlook main window DOES not accept any alphanumeric keys or punctuation keys. It accepts control keys like ALT+F, UP, DOWN, TAB, SHIFT-TAB, CTRL-O, etc. But it is the MS-Outlook e-mail composer window (which opens when you want to compose a new e-mail), which can accept alphanumeric keys or punctuation keys. I want the composer window to be listed and the MS-Outlook main window, not to be listed. :sigh: Something like the MSN Messenger, ICQ and Yahoo! Messenger main windows. They don't accept alphanumeric + punctuation keys, but only control keys. But the chat window, accepts alphanumeric + punctuation keys. :doh: Is there any way that you have tried something similar, or are you aware about how can I get this going? :confused: Thanks, Rgds, Nirav * Don't wish it was easier, wish you were better! *

      G Offline
      G Offline
      Gary R Wheeler
      wrote on last edited by
      #2

      As far as I know, there is no general purpose way to detect if an arbitrary window accepts keyboard input. There are a couple of things you can try. One, retrieve the class name of the window. The builtin Windows controls (edit, etc.) have well-known class names. Once you know the class name, you can use messages specific to the class to discover how the control is set up, and find out what keys it accepts. Two, the WM_GETDLGCODE message will get a little of the information you are looking for. It is used by the Windows dialog manager to find out what keys a control in a dialog wants. BTW: The IsWindowEnabled() function only tells you if the window is enabled, i.e. that it accepts user input. User input means keypresses and mouse activity. Unfortunately, as you've discovered, this has nothing to do with the type of user input the window accepts.


      Software Zen: delete this;

      N 1 Reply Last reply
      0
      • G Gary R Wheeler

        As far as I know, there is no general purpose way to detect if an arbitrary window accepts keyboard input. There are a couple of things you can try. One, retrieve the class name of the window. The builtin Windows controls (edit, etc.) have well-known class names. Once you know the class name, you can use messages specific to the class to discover how the control is set up, and find out what keys it accepts. Two, the WM_GETDLGCODE message will get a little of the information you are looking for. It is used by the Windows dialog manager to find out what keys a control in a dialog wants. BTW: The IsWindowEnabled() function only tells you if the window is enabled, i.e. that it accepts user input. User input means keypresses and mouse activity. Unfortunately, as you've discovered, this has nothing to do with the type of user input the window accepts.


        Software Zen: delete this;

        N Offline
        N Offline
        Nirav Doshi
        wrote on last edited by
        #3

        Thanks Gary! I will start looking at the options you've explained! Thanks again, - Nirav * Don't wish it was easier, wish you were better! *

        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