Date: 02-16-2022
Return to Index
created by gbSnippets
'Compilable Example: (Jose Includes)
#Compiler PBWin 9, PBWin 10
#Compile EXE
#Dim All
%Unicode=1
#Include "Win32Api.inc"
Global hDlg,pid,Restart As DWord
%IDC_Button = 500
Function PBMain() As Long
Dialog New Pixels, 0, "Auto restart"+time$,500,500,200,100, %WS_OverlappedWindow To hDlg
Control Add Button, hDlg, %IDC_Button,"Restart", 50,10,100,20
Dialog Show Modal hDlg Call DlgProc
If Restart Then pid = Shell(Exe.Full$, 1) 'Rerun this app
End Function
CallBack Function DlgProc
Select Case CbMsg
Case %WM_Command
Select Case Cb.Ctl
Case %IDC_Button : Restart = 1 : Dialog End hDlg
End Select
Case %WM_Destroy
'do whatever destroy stuff I want to do
End Select
End Function
'gbs_00725
'Date: 03-10-2012
http://www.garybeene.com/sw/gbsnippets.htm