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

Dialog Editor version 6.X
plus
plus

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

Close Dialog Box upon completion of installation

Keywords:   Close the Dialog Box upon completion of instllation 

Question:

Here is what I wanna do.
  1. Pop up a Dialog Box with Static Text (No buttons)

  2. Run an executable and wait for it to finish the installation

  3. Close the Dialog Box upon completion of instllation (Do not want to click any buttons to close Dialog Box)
Here is the code for my dialog box;
*****************************************
MyDialogFormat=`WWWDLGED,6.1`

MyDialogCaption=`TestApp v3.5`
MyDialogX=119
MyDialogY=101
MyDialogWidth=256
MyDialogHeight=067
MyDialogNumControls=002
MyDialogProcedure=`DEFAULT`
MyDialogFont=`DEFAULT`
MyDialogTextColor=`DEFAULT`
MyDialogBackground=`DEFAULT,DEFAULT`

MyDialog001=`039,013,170,012,STATICTEXT,DEFAULT,"TestApp v3.5 installation in progress",DEFAULT,1,DEFAULT,"Times New Roman|10752|70|18","0|0|0",DEFAULT`
MyDialog002=`095,039,048,012,STATICTEXT,DEFAULT,"Please wait ...",DEFAULT,2,DEFAULT,"Times New Roman|8192|70|18","0|0|0",DEFAULT`

ButtonPushed=Dialog("MyDialog")

RunWait("X:\TestApp.exe", "/q")
exit

********************************************
The problem is that "X:\TestApp.exe" never gets executed because it never gets to that point. Any suggestions.

Answer:






#DefineFunction MyProc(MyProcDlgHandle,MyProcDlgMessage,MyProcDlgControlID,param4,param5)
   MSG_INIT=0                ; The one-time initilization
   MSG_TIMER=1               ; Timer event
   DPO_DISABLESTATE=1000     ; codes -1=GetSetting 0=EnableDialog 1=DisableDialog
   Switch MyProcDlgMessage

          Case MSG_INIT  
               DialogProcOptions(MyProcDlgHandle,MSG_TIMER,500)   ; wait .5 sec
               Return (-1)

          Case MSG_TIMER
               DialogProcOptions(MyProcDlgHandle,MSG_TIMER,0)   ; turn off timer
               DialogProcOptions(MyProcDlgHandle,DPO_DISABLESTATE,1) ;disable dialog
               RunWait("notepad.exe", "")
               DialogProcOptions(MyProcDlgHandle,DPO_DISABLESTATE,0) ;enable dialog
               TimeDelay(0.5) ; wait just a little here maybe to make notepad look nicer
               Return(1)


   EndSwitch ; ConfigDlgMessage
   Return(-1) ; Do default processing
#EndFunction




MyDialogFormat=`WWWDLGED,6.1`

MyDialogCaption=`TestApp v3.5`
MyDialogX=119
MyDialogY=101
MyDialogWidth=256
MyDialogHeight=067
MyDialogNumControls=002
MyDialogProcedure=`MyProc`
MyDialogFont=`DEFAULT`
MyDialogTextColor=`DEFAULT`
MyDialogBackground=`DEFAULT,DEFAULT`

MyDialog001=`039,013,170,012,STATICTEXT,DEFAULT,"TestApp v3.5 installation in progress",DEFAULT,1,DEFAULT,"Times New Roman|10752|70|18","0|0|0",DEFAULT`
MyDialog002=`095,039,048,012,STATICTEXT,DEFAULT,"Please wait ...",DEFAULT,2,DEFAULT,"Times New Roman|8192|70|18","0|0|0",DEFAULT`

ButtonPushed=Dialog("MyDialog")

Exit

Article ID:   W15456
File Created: 2003:05:28:10:19:40
Last Updated: 2003:05:28:10:19:40