Kbase 17596: How to Call WIN32 API Function: GetForegroundWindow
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  5/10/1998 |
|
How to Call WIN32 API Function: GetForegroundWindow
DISCLAIMER:
===========
The code example is this knowledgebase is for informational purposes
only. If you have specific questions about which API calls would be
best suited to your design goals, please consult your Microsoft
documentation.
INTRODUCTION:
=============
The following sample code shows how to call the Win32 API function
called GetForegroundWindow. This function returns the handle of the
window the user is currently working with. This is called the
foreground window, and the system assigns a slightly higher priority
to the thread that the foreground window is in.
This code has been tested on Windows NT 4.0 Workstation only.
DEFINE VARIABLE intHandle AS INTEGER NO-UNDO.
PROCEDURE GetForegroundWindow EXTERNAL "USER32.DLL":
DEFINE RETURN PARAMETER intHandle AS LONG.
END PROCEDURE.
RUN GetForegroundWindow(OUTPUT intHandle).
MESSAGE "Foreground Window Handle is " intHandle VIEW-AS ALERT-BOX.
Progress Software Technical Support Note # 17596