Kbase P122452: How to get the Windows TaskBar Auto-hide and Always-On-Top properties?
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  2/23/2007 |
|
Status: Unverified
GOAL:
How to get the Windows TaskBar Auto-hide and Always-On-Top properties?
GOAL:
How to access the Windows TaskBar Auto-hide property?
GOAL:
How to determine if the Windows TaskBar Always-On-Top property is set or not?
GOAL:
How to get the Windows Auto-hide the task bar property?
GOAL:
How to get the Windows keep the taskbar on top of other windows property?
GOAL:
How to call WIN32 API function: SHAppBarMessage?
GOAL:
How to send the WIN32 API ABM_GETSTATE Message?
GOAL:
How to call WIN32 API function: SHAppBarMessage?
FIX:
The following code send the the WIN32 API ABM_GETSTATE Message using the WIN32 API SHAppBarMessage function to retrieve the autohide and always-on-top states of the Windows task bar:
/*******************************************************************/
/* Procedure: HowToGetTaskBarAutoHideAndAlwaysOnTop.p */
/* */
/* Description: Get Windows Taskbar AutoHide and AlwaysOnTop */
/* properties. */
/*******************************************************************/
&GLOBAL-DEFINE ABS_AUTOHIDE 1
&GLOBAL-DEFINE ABS_ALWAYSONTOP 2
&GLOBAL-DEFINE ABM_GETSTATE 4
DEFINE VARIABLE pData AS MEMPTR NO-UNDO.
DEFINE VARIABLE iResult AS INTEGER NO-UNDO.
FUNCTION getTaskbarAutohide RETURNS LOGICAL () FORWARD.
FUNCTION getTaskbarAlwaysOnTop RETURNS LOGICAL () FORWARD.
SET-SIZE(pData) = 32.
RUN SHAppBarMessage(
INPUT {&ABM_GETSTATE},
INPUT pData,
OUTPUT iResult
).
MESSAGE
"Taskbar Autohide:~t:" getTaskbarAutohide() "~n"
"Always On Top:~t:" getTaskbarAlwaysOnTop()
VIEW-AS ALERT-BOX INFO BUTTONS OK.
PROCEDURE SHAppBarMessage EXTERNAL "shell32.dll":
DEFINE INPUT PARAMETER dwMessage AS LONG.
DEFINE INPUT PARAMETER pData AS MEMPTR.
DEFINE RETURN PARAMETER iReturn AS LONG.
END.
FUNCTION getTaskbarAutohide RETURNS LOGICAL ():
RETURN iResult MODULO 2 = {&ABS_AUTOHIDE}.
END FUNCTION.
FUNCTION getTaskbarAlwaysOnTop RETURNS LOGICAL ():
RETURN iResult GE {&ABS_ALWAYSONTOP}.
END FUNCTION.