Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
FindWindow Problems
Message
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
00369262
Message ID:
00369277
Views:
16
>I have found one situation that gets in the way and causes the API funtion findwindow() to always return 0 except when the app that it is being run in is the app with the window name being sought, which is useless.
>
>I use dual monitors with NT 2000 and........ MS Desktops from the NT 4.0 Resource Kit. MS Desktops is a Virtual Desktop Manager. There are a couple more Virtual Desktop Managers that ship with the Resource Kit and yes I expect there are updates. I am thinking that there is another that ships with www.stardock.com Dual Monitors with a Virtual Desktop is the best thing since sliced bread IMO and they are very common on Linux GUI's. I say linux because I suspect the idea will set in on Windows and become more popular. I have not had any other problems at all using this app other than using this API function.
>
>Does anyone know of another API Function or combination of API functions that gets to the same answer or is there another set of functions that should be accessed in this kind of enviroment. If possible I would like to harden somethings I am writing to cover the situation I am currently using.

Ron,

I don't know if this will address the problem, but FindWindow() needs an exact match of either the title bar or class name. Further, it is case sensitive. Most programs have dynamic title bars, and the class name is subject to change.

I've written a small function (Is_Run32()) to work around this problem by checking for the known portion of the title bar. It's in the UT download section (under Win32 and other APIs) and titled "Is a Windows Application Running?".
George

Ubi caritas et amor, deus ibi est
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform