Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Problem with GetForegroundWindow in WIN32API
Message
From
30/11/1999 10:07:13
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00296799
Message ID:
00296832
Views:
16
>Based on a message on the thread, I did the following code (It is used when doing a Crystal report, to make sure my app is waiting for completion of Crystal):
>
>#DEFINE WS_MAXIMIZE 29949952
>Declare integer GetForegroundWindow in WIN32API
>Declare short IsWindow in WIN32API
>...blablabla I call Crystal in preview mode...
>
>lnHwndActiveX = GetForegroundWindow()
>Do while IsWindow(lnHwndActiveX) # 0
>Enddo
>
>It fail on the second line (Declare integer GetForegroundWindow...).
>DO I have to do something else in order to use Win32api ?
>

No, but it is case-sensitive - IOW GETFOREGROUNDWINDOW is not the same as GetForegroundWindow; the API call works under NT and Win98.

When you say it fails, what error does it give you - it's sort of useless to not say what the error message was.

Also, if you read the documentation, GetForegroundWindow does not always return a valid hWnd - ie it returns NULL if a window is losing its activation status.
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Previous
Reply
Map
View

Click here to load this message in the networking platform