I’m trying to hide an App Button from the taskbar when I create a systray icon for it, but it keeps reappearing. Having to roll my own code to replace the FrameExtension template/class.
Anyone know why?
SysTrayAddTrayIcon Procedure()
Code
Loc:SysTrayIcon = 'pcWTApp_ico'
Loc:TrayIcon.cbSize = Size(Loc:TrayIcon)
Loc:TrayIcon.hWnd = MF:Handle
Loc:TrayIcon.uID = 1 ! The application-defined identifier of the taskbar icon. The Shell uses either (hWnd plus uID
Loc:TrayIcon.uFlags = 0 ! Flags that either indicate which of the other members of the structure contain valid data or provide additional information to the tooltip as to how it should display
Loc:TrayIcon.uFlags += ISEQ:NOTIFYICONDATAA:NIF_Message
Loc:TrayIcon.uFlags += ISEQ:NOTIFYICONDATAA:NIF_Icon
Loc:TrayIcon.uFlags += ISEQ:NOTIFYICONDATAA:NIF_Tip
Loc:TrayIcon.uCallbackMessage = UserEvent:SysTrayEvents ! An application-defined message identifier. The system uses this identifier to send notification messages to the window identified in hWnd.
Loc:TrayIcon.hIcon = ISWA_LoadImage( System{PROP:AppInstance}, Address(Loc:SysTrayIcon),1,16,16,0)
Loc:TrayIcon.szTip = 'pcWorkTime' ! A null-terminated string that specifies the text for a standard tooltip. It can have a maximum of 64 characters,
ISWA_Shell_NotifyIconA( ISEQ:SysTray:NIM_ADD, Address(Loc:TrayIcon) ) ! Adds an icon to the SysTray
! !ISWA_ShowWindow(MF:Handle, ISEQ:Window:SW_HIDE ) ! Hide the MainFrame
! !ISWA_ShowWindow(MF:Handle, ISEQ:Window:SW_HIDE )
! AppFrame{Prop:Hide} = True
! AppFrame{PROP:Active} = False
The 4 commented out lines, hide the taskbar button, but it keeps reappearing. The MS docs state
This parameter is ignored the first time an application calls ShowWindow, if the program that launched the application provides a STARTUPINFO structure. Otherwise, the first time ShowWindow is called, the value should be the value obtained by the WinMain function in its nCmdShow parameter.
which is why ShowWindow() is listed twice.
TIA
