Hi,
I though I would try your solution and then got carried away:-)
I have added my original template code so you could see how it is supposed to piece together.
I am trying to get the
LibFunc>user32,EnableWindow,lfres,Dialog1.msCheckBox4.HANDLE,1
working, I have it working in simple format but not in this script yet.
I need to have some dialog options off when some options are picked
visa versa.
As you can probably see it bloats the code quite a bit by not being able to have the 'msgbox on in the VB block.
As you can see the VB Block is dummy, normally I have my Weonlydo Active X in there doing the work. I use the Weonlydo Active X dll all the time now and it's very useful.
As you can see here though I just wanted the msgbox events to come up on the screen but not with Yes/No etc options, just a 1 or 2 second show on screen.
Anyway, thank you very much for your help and support, I really do appreciate it.
I would appreciate your thoughts on my efforts and please don't hold back in pointing out my mistakes
Phil.
Code: Select all
VBSTART
Function Connect
'event
'msgbox "Send Username"
'event
'msgbox "Send Password"
'event
'msgbox "Connection OK"
End Function
Function Backup
'event
'msgbox "Saved File_1 as File_1_old"
'event
'msgbox "Saved File_2 as File_2_old"
'event
'msgbox "Saved File_3 as File_3_old"
End Function
Function Transfer
'START TRANSFERING FILES AND DISPLAY EACH TRANSFER
'event
'msgbox "Transfer_file_1 OK!"
'event
'msgbox "Transfer_file_2 OK!"
'event
'msgbox "Transfer_file_3 OK!"
'msgbox "FILES HAVE COMPLETED TRANSFER"
End Function
Function RestartServices
'Once files have completed transfer, HUP process
'event
'msgbox "Restart_Services have completed"
End Function
Function Backout
'Needed if backout is required.
'event
'msgbox "Copied File_1_old back to File_1"
'event
'msgbox "Copied File_2_old back to File_2"
'event
'msgbox "Copied File_3_old back to File_3"
End Function
Function Disconnect
'Disconnect.
'event
'msgbox "Closed session OK!."
End Function
VBend
Dialog>Dialog1
Caption=Control Events Panel
Width=391
Height=385
Top=220
Left=501
Max=1
Min=1
Close=1
Resize=1
CheckBox=msCheckBox1,Connect to remote server.,96,72,179,True
CheckBox=msCheckBox3,Transfer Files to remote server.,96,128,218,False
CheckBox=msCheckBox5,Restart Services on remote server.,96,192,191,False
CheckBox=msCheckBox6,Diconnect from remote server.,96,224,185,True
Label=Process options,64,32,true
CheckBox=msCheckBox4,Backout to original files on remote server.,97,159,192,False
Button=Go,96,256,75,25,1
Button=Cancel,208,256,75,25,2
CheckBox=msCheckBox2,Backup current files before transfer.,98,99,207,True
EndDialog>Dialog1
Dialog>Dialog2
Caption=Running...
Width=559
Height=112
Top=CENTER
Left=CENTER
Max=0
Min=0
Close=1
Resize=0
Label=Connection made to server OK!,24,48,true
ProgressBar=msProgressBar1,28,14,485,17,0
EndDialog>Dialog2
Label>MainLoop
Show>Dialog1,result
LibFunc>user32,EnableWindow,lfres,Dialog1.msCheckBox4.HANDLE,1
If>result=2,End
If>result=1,Go
Goto>MainLoop
SRT>Go
Let>t1=dialog1.msCheckBox1
Let>t2=dialog1.msCheckBox2
Let>t3=dialog1.msCheckBox3
Let>t4=dialog1.msCheckBox4
Let>t5=dialog1.msCheckBox5
Let>t6=dialog1.msCheckBox6
Let>Dialog2.msprogressbar1=0
If>t1=True
VBeval>connect,res1
Show>dialog2
SetDialogObjectVisible>Dialog1,msLabel1,1
Let>dialog2.msLabel1=Connecting to server!
Let>k=0
Repeat>k
Let>Dialog2.msprogressbar1=k
ResetDialogAction>Dialog2
Wait>0.5
Let>k=k+100
Until>k>100
Let>dialog2.msLabel1=Connected to server OK!
ResetDialogAction>Dialog2
Wait>1
CloseDialog>dialog2
Endif
If>t1=False
Let>MSG_HEIGHT=200
Let>MSG_WIDTH=600
Let>MSG_CENTERED=1
Message>You cannot perform anyother actions untill you connect! %CRLF%%CRLF% Goodbye!
wait>1
CloseDialog>Message
goto>End
Endif
//SetDialogObjectVisible>
//disable button1
LibFunc>user32,EnableWindow,lfres,Dialog1.msButton1.HANDLE,0
If>t2=True
VBeval>backup,res2
Show>dialog2
SetDialogObjectVisible>Dialog2,msLabel1,1
LibFunc>user32,EnableWindow,lfres,Dialog2,msLabel1.HANDLE,0
Let>dialog2.msLabel1=Backing up config and data to qipupdate.ford.com!
Let>k=0
Repeat>k
Let>Dialog2.msprogressbar1=k
ResetDialogAction>Dialog2
Wait>0.5
Let>k=k+20
Until>k>100
Let>dialog2.msLabel1=Backup completed successfully and files amended to new format OK!
ResetDialogAction>Dialog2
Wait>2
CloseDialog>dialog2
Wait>1
CloseDialog>dialog2
ELSE
Endif
If>t3=True
VBeval>Transfer,res3
Show>dialog2
SetDialogObjectVisible>Dialog2,msLabel1,1
Let>dialog2.msLabel1=Transfering files back to new upgraded server!
Let>k=0
Repeat>k
Let>Dialog2.msprogressbar1=k
ResetDialogAction>Dialog2
Wait>0.5
Let>k=k+20
Until>k>100
Let>dialog2.msLabel1=Files transfered back OK!
ResetDialogAction>Dialog2
Wait>2
CloseDialog>dialog2
ELSE
Endif
If>t5=True
VBeval>RestartServices,res5
Show>dialog2
SetDialogObjectVisible>Dialog2,msLabel1,1
Let>dialog2.msLabel1=Restarting services on upgraded server!
Let>k=0
Repeat>k
Let>Dialog2.msprogressbar1=k
ResetDialogAction>Dialog2
Wait>0.5
Let>k=k+15
Until>k>100
Let>dialog2.msLabel1=Services started ok and working!
ResetDialogAction>Dialog2
Wait>1
CloseDialog>dialog2
ELSE
Endif
If>t4=True
VBeval>backout,res4
Show>dialog2
Let>dialog2.msLabel1=Backing out config files to stop DNS/DHCP services!
Let>k=0
Repeat>k
Let>Dialog2.msprogressbar1=k
ResetDialogAction>Dialog2
Wait>0.5
Let>k=k+20
Until>k>100
Let>dialog2.msLabel1=Services stopped and services not active!
ResetDialogAction>Dialog2
Wait>1
CloseDialog>dialog2
ELSE
Endif
If>t6=True
VBeval>disconnect,res6
Show>dialog2
SetDialogObjectVisible>Dialog2,msLabel1,1
Let>dialog2.msLabel1=Disconnecting!
Let>k=0
Repeat>k
Let>Dialog2.msprogressbar1=k
ResetDialogAction>Dialog2
Wait>0.5
Let>k=k+100
Until>k>100
Let>dialog2.msLabel1=Disconnected and port closed !
ResetDialogAction>Dialog2
Wait>2
CloseDialog>dialog2
ELSE
Endif
END>
Label>End
Phil.......