EnumWindows()
-
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 aTRUE
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! * -
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 aTRUE
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! *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: TheIsWindowEnabled()
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;
-
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: TheIsWindowEnabled()
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;
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! *