WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

Dialogs

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

Dialog Minimize to System Tray

 Keywords: Dialog Minimize to System Tray Systray Intcontrol 1007 

IntControl(1002,0,0,0,0) ; No icon
IntControl(1003,0,0,0,0) ; No WinBatch Processing Window
IntControl(12,5,0,0,0) ; Terminate silently
;IntControl(49,1,0,0,0) ; Using DialogProcOptions 1002 instead
Title = "Minimize to System Tray"
BoxTitle(Title)
InSystemTray = 0

MSG_INIT=0
MSG_TIMER=1
DPO_CHANGESYSMENU=1002 ; -1=Get Current 0=none 1=close 2=close/min 3=close/max 4=close/min/max
RET_DO_CANCEL=0
RET_DO_DEFAULT= -1
RET_DO_NOT_EXIT= -2

#DefineSubRoutine MyDialogCallbackProc(MyDialog_Handle,MyDialog_Message,MyDialog_ID,MyDialog_EventInfo,rsvd)
Switch MyDialog_Message
Case MSG_INIT
   DialogProcOptions(MyDialog_Handle,MSG_TIMER,100)
   Return RET_DO_DEFAULT
Case MSG_TIMER
   If WinState(Title)==1 && !InSystemTray
      InSystemTray = 1
      IntControl(1007,1,1,"Click to show dialog","")
   Else
      DialogProcOptions(MyDialog_Handle,DPO_CHANGESYSMENU,2)
      If IntControl(1007,0,0,"","")==1
         IntControl(1007,2,0,"","")
         WinShow(Title)
         InSystemTray = 0
      EndIf
   EndIf
   Break
EndSwitch
Return(RET_DO_DEFAULT)
#EndSubRoutine

MyDialogFormat=`WWWDLGED,6.1`

MyDialogCaption=Title
MyDialogX=-1
MyDialogY=-1
MyDialogWidth=180
MyDialogHeight=097
MyDialogNumControls=002
MyDialogProcedure=`MyDialogCallbackProc`
MyDialogFont=`DEFAULT`
MyDialogTextColor=`DEFAULT`
MyDialogBackground=`DEFAULT,DEFAULT`
MyDialogConfig=0

MyDialog001=`043,075,036,012,PUSHBUTTON,DEFAULT,"OK",1,1,32,DEFAULT,DEFAULT,DEFAULT`
MyDialog002=`101,075,036,012,PUSHBUTTON,DEFAULT,"Cancel",0,2,DEFAULT,DEFAULT,DEFAULT,DEFAULT`

ButtonPushed=Dialog("MyDialog")

Article ID:   W18256
Filename:   Dialog Minimize to System Tray.txt
File Created: 2009:10:29:13:15:56
Last Updated: 2009:10:29:13:15:56