Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to get control with focus from window with focus
Message
From
22/11/2000 19:19:18
 
 
To
All
General information
Forum:
Visual Basic
Category:
Windows API functions
Title:
How to get control with focus from window with focus
Miscellaneous
Thread ID:
00444858
Message ID:
00444858
Views:
37
I am trying to brute force a Win16 terminal emulation program called wIntegrate to do my bidding, and I am one maddening step from total success. The problem is that once I run a query I run a file import routine from the application menus, SendKey all the necessary info to load a script (not elegant I know, but the company the bought the company that made this no longer supports it and can't get me any documentation or source code even when I offered them money), and run the script it hides the terminal window, opens a file transfer Window that shows a running total of bytes transferred and a status bar that stays at zero until it is all done and then leaps to 100%. While this is going on a command button with the caption "Stop" has focus. When the file transfer is complete the caption changes to "Exit" (or maybe the command button is replaced by another command button) which still has the focus. So I'm thinking if I can get a handle on that button I can just periodically read the caption, and when it changes to Exit I'll know I can move on to the next file transfer.

Okay, I know this is a really crude solution, but I don't have enough knowledge of the code to do something nice like subclassing the window and intercepting whatever messages it gets when it is either done or fails. So laugh at me if you must, but does anyone out there know how to get the handle on the active control within the active window. Is there some cool API function that will do it for me? Is there some way of getting a generic window object and then identifying all its client windows and chekcing those for focus? (If I probe it and find the answer once I can come up with code that goes straight to the control that my probing shows I want.) Any suggestions would be greatly appreciated.

Bob Duniway
Seattle University
rduniway@seattleu.edu
Reply
Map
View

Click here to load this message in the networking platform