In looking for a way to bring a Window to the foreground AND
activate it, I came across the following "undocumented" API
call on codepile.com:
// void SwitchToThisWindow(
// HWND hWnd, // Handle to the window that should be activated
// BOOL bRestore // Restore the window if it is minimized
// );
Seems to work great on Win95/98/98SE. In PB/CC you use it thus:
DECLARE SUB SwitchToThisWindow LIB "USER32.DLL" _
ALIAS "SwitchToThisWindow" _
(BYVAL hWnd AS LONG, BYVAL lRestore AS LONG)
%WIN_TRUE = 1
%WIN_FALSE = 0
hWnd = FindWindow(BYVAL 0, "Window Title")
SwitchToThisWindow hWnd, %WIN_TRUE
Passing WIN_TRUE in lRestore will cause the window to be restored
if it was minimized (unminimize, if you will), and passing the
WIN_FALSE value will leave the window "as is".
------------------
activate it, I came across the following "undocumented" API
call on codepile.com:
// void SwitchToThisWindow(
// HWND hWnd, // Handle to the window that should be activated
// BOOL bRestore // Restore the window if it is minimized
// );
Seems to work great on Win95/98/98SE. In PB/CC you use it thus:
DECLARE SUB SwitchToThisWindow LIB "USER32.DLL" _
ALIAS "SwitchToThisWindow" _
(BYVAL hWnd AS LONG, BYVAL lRestore AS LONG)
%WIN_TRUE = 1
%WIN_FALSE = 0
hWnd = FindWindow(BYVAL 0, "Window Title")
SwitchToThisWindow hWnd, %WIN_TRUE
Passing WIN_TRUE in lRestore will cause the window to be restored
if it was minimized (unminimize, if you will), and passing the
WIN_FALSE value will leave the window "as is".
------------------
Comment