Kbase P92671: How to hide the icon of a batch process from the Windows taskbar when using prowin32.exe?
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  8/27/2004 |
|
Status: Unverified
GOAL:
How to hide the icon of a batch process from the Windows taskbar when using prowin32.exe?
GOAL:
How to hide the default window of a batch process?
GOAL:
When using prowin32.exe -b, how to hide its icon?
FIX:
A Windows API is needed to do this.
Here is an example. The window will appear on the task bar briefly before disappearing.
DEF VAR hwnd AS INTEGER.
DEF VAR wintitle as CHARACTER.
PROCEDURE ShowWindow EXTERNAL "USER32.DLL":
DEFINE INPUT PARAMETER hWnd AS LONG.
DEFINE INPUT PARAMETER nCmdShow AS LONG.
END.
PROCEDURE FindWindowA EXTERNAL "USER32.DLL":
DEFINE INPUT PARAMETER lpClassName AS LONG.
DEFINE INPUT PARAMETER lpWindowName AS CHARACTER.
DEFINE RETURN PARAMETER hWnd AS LONG.
END.
/* Create a "unique" title for the window so we can find it, in case other batch
** processes are also running on the machine.*/
wintitle = "probatch" + STRING(ETIME).
/* Setting the TITLE attribute of a NULL window handle sets the batch window's title.
** DEFAULT-WINDOW is NULL in batch mode. No other attributes behave this way;
** it's a special case for batch mode.*/
DEFAULT-WINDOW:TITLE = wintitle.
RUN FindWindowA(0, wintitle, output hwnd).
RUN ShowWindow(hwnd, 0).
pause 5.
update a as char. /*generates an error, just to know that the process finished*/