Hi Miss Deane,
It seems not working on my case? How am I going to pass the dialog_handle aside from within the MyDialogCallbackProc()? Its not even passing through the inside of the procedure call MyDialogCallbackProc().PushButton_OK. I just want to get the dialog_handle, if I can achieve that in the way you suggested above it would be fine.
Heres my actual code. Please execute and test it, I just want to get the MyDialog_Handle so I can manipulate the form itself interms of display and behavior.
Please help me and give some of ur suggested work arounds (at least I can be able pass handle MyDialog_Handle from outside MyDialogCallbackProc() )
#DefineSubRoutine InitDialogConstants()
;DialogprocOptions Constants
MSG_INIT=0 ; The one-time initialization
MSG_TIMER=1 ; Timer event
MSG_BUTTONPUSHED=2 ; Pushbutton or Picturebutton
MSG_RADIOPUSHED=3 ; Radiobutton clicked
MSG_CHECKBOX=4 ; Checkbox clicked
MSG_EDITBOX=5 ; Editbox or Multilinebox
MSG_FILESELECT=6 ; Filelistbox
MSG_ITEMSELECT=7 ; Itembox
MSG_COMBOCHANGE=8 ; Combobox/Droplistbox
MSG_CALENDAR=9 ; Calendar date change
MSG_SPINNER=10 ; Spinner number change
MSG_CLOSEVIA49=11 ; Close clicked (Enabled via Intcontrol 49)
MSG_FILEBOXDOUBLECLICK=12 ; Get double-click message on a FileListBox
MSG_ITEMBOXDOUBLECLICK=13 ; Get double-click message on an ItemBox
DPO_DISABLESTATE=1000 ; codes -1=GetSetting 0=EnableDialog 1=DisableDialog
DPO_CHANGEBACKGROUND=1001 ; -1=Get Current otherise bitmap or color string
DPO_CHANGESYSMENU=1002 ; -1=Get Current 0=none 1=close 2=close/min 3=close/max 4=close/min/max
DPO_CHANGETITLE=1003 ; -1=Get Current otherise new title
;DialogControlState Constants
DCSTATE_SETFOCUS=1 ; Give Control Focus
DCSTATE_QUERYSTYLE=2 ; Query control's style
DCSTATE_ADDSTYLE=3 ; Add control style
DCSTATE_REMOVESTYLE=4 ; Remove control style
DCSTATE_GETFOCUS=5 ; Get control that has focus
DCSTYLE_INVISIBLE=1 ; Set Control Invisible
DCSTYLE_DISABLED=2 ; Set Control Disabled
DCSTYLE_NOUSERDATA=4 ; Note: Setable via DialogControlState function ONLY SPINNER control only
DCSTYLE_READONLY=8 ; Sets control to read-only (user cannot type in data) EDITBOX MULTILINEBOX SPINNER
DCSTYLE_PASSWORD=16 ; Sets 'password mode' where only *'s are displayed EDITBOX
DCSTYLE_DEFAULTBUTTON=32 ; Sets a button as the default button PUSHBUTTON PICTUREBUTTON
DCSTYLE_DIGITSONLY=64 ; Set edit box to accept digits only EDITMOX MULTILINEBOX
DCSTYLE_FLAT=128 ; Makes a 'flat' hyperlink-looking button PUSHBUTTON PICTUREBUTTON
DCSTYLE_NOADJUST=256 ; Turns off auto-height adjustment ITEMBOX FILELISTBOX
DCSTYLE_TEXTCENTER=512 ; Center text in control VARYTEXT STATICTEXT
DCSTYLE_TEXTRIGHT=1024 ; Flush-Right text in control VARYTEXT STATICTEXT
DCSTYLE_NOSELCURLEFT=2048 ; No selection, cursor left EDITBOX MULTILINEBOX
DCSTYLE_NOSELCURRIGHT=4096; No selection, cursor right EDITBOX MULTILINEBOX
;DialogControlSet / DialogControlGet Constants
DC_CHECKBOX=1 ; CHECKBOX
DC_RADIOBUTTON=2 ; RADIOBUTTON
DC_EDITBOX=3 ; EDITBOX MULTILINEBOX
DC_TITLE=4 ; PICTURE RADIOBUTTON CHECKBOX PICTUREBUTTON VARYTEXT STATICTEXT GROUPBOX PUSHBUTTON
DC_ITEMBOXCONTENTS=5 ; ITEMBOX FILELISTBOX DROPLISTBOX
DC_ITEMBOXSELECT=6 ; ITEMBOX FILELISTBOX DROPLISTBOX
DC_CALENDAR=7 ; CALENDAR
DC_SPINNER=8 ; SPINNER
DC_MULTITABSTOPS=9 ; MULTILINEBOX
DC_ITEMSCROLLPOS=10 ; ITEMBOX FILELISTBOX
DC_BACKGROUNDCOLOR=11 ; RADIOBUTTON CHECKBOX VARYTEXT STATICTEXT GROUPBOX PUSHBUTTON ITEMBOX FILELISTBOX DROPLISTBOX SPINNER EDITBOX MULTILINEBOX
DC_PICTUREBITMAP=12 ; PICTURE PICTUREBUTTON
DC_TEXTCOLOR=13 ; RADIOBUTTON CHECKBOX VARYTEXT STATICTEXT GROUPBOX PUSHBUTTON ITEMBOX FIELLISTBOX DROPLISTBOX SPINNER EDITBOX MULTILINEBOX
DC_ITEMBOXADD=14 ; ITEMBOX FILELISTBOX DROPLISTBOX
DC_ITEMBOXREMOVE=15 ; ITEMBOX FILELISTBOX DROPLISTBOX
;Return code constants
RET_DO_CANCEL=0 ; Cancels dialog
RET_DO_DEFAULT= -1 ; Continue with default processing for control
RET_DO_NOT_EXIT= -2 ; Do not exit the dialog
Return
#EndSubRoutine
#DefineFunction MyDialogCallbackProc(MyDialog_Handle, MyDialog_Message ,MyDialog_Name, MyDialog_EventInfo, rsvd)
InitDialogConstants() ; Initialize Dialog Constants
Switch MyDialog_Message ; Switch based on Dialog Message type
Case MSG_INIT
DialogProcOptions(MyDialog_Handle, MSG_TIMER, 1000)
DialogControlSet(MyDialog_Handle,"StaticText_6",DC_TITLE, "Scrapper will start in 3 second(s).")
Return RET_DO_DEFAULT
case MSG_TIMER
Clock = DialogControlGet(MyDialog_Handle,"VaryText_1",DC_TITLE)
Clock = Clock-1
If Clock == 0 Then Return(101) ; exit,
str = StrCat("Scrapper will start in ",Clock," second(s).")
DialogControlSet(MyDialog_Handle,"StaticText_6",DC_TITLE, str)
DialogControlSet(MyDialog_Handle,"VaryText_1",DC_TITLE, Clock)
Return RET_DO_DEFAULT
Case MSG_BUTTONPUSHED
If MyDialog_Name == "PushButton_OK"
Pause('ButtonPushed', "Yes! Button OK is clicked... StartProcess() is called process here.")
; StartProcess(MyDialog_Handle, userdata)
DialogControlSet(MyDialog_Handle,"StaticText_6",DC_TITLE, "")
DialogControlState(MyDialog_Handle, MyDialog_Name, DCSTATE_ADDSTYLE, DCSTYLE_DISABLED) ;disable OK button
Return(RET_DO_DEFAULT)
ElseIf MyDialog_Name == "PushButton_1"
Run('notepad.exe', StrCat(DirScript(), 'users.txt'))
Return(RET_DO_NOT_EXIT)
ElseIf MyDialog_Name == "PushButton_Cancel"
Return(RET_DO_DEFAULT)
EndIf
EndSwitch
#EndFunction
MyDialogFormat=`WWWDLGED,6.2`
MyDialogCaption=`MyTimeOutForm`
MyDialogX=164
MyDialogY=178
MyDialogWidth=274
MyDialogHeight=101
MyDialogNumControls=009
MyDialogProcedure=`MyDialogCallbackProc`
MyDialogFont=`DEFAULT`
MyDialogTextColor=`DEFAULT`
MyDialogBackground=`DEFAULT,DEFAULT`
MyDialogConfig=0
MyDialog001=`157,041,046,014,PUSHBUTTON,"PushButton_OK",DEFAULT,"OK",101,1,32,"Verdana|5632|40|34","0|0|0",DEFAULT`
MyDialog002=`207,041,046,014,PUSHBUTTON,"PushButton_Cancel",DEFAULT,"Cancel",0,2,DEFAULT,"Verdana|5632|40|34","0|0|0",DEFAULT`
MyDialog003=`057,019,098,014,EDITBOX,"EditBox_1",ebVariable1,DEFAULT,DEFAULT,1,2056,"Verdana|5632|40|34","0|0|0",DEFAULT`
MyDialog004=`009,019,044,012,STATICTEXT,"StaticText_1",DEFAULT,"Default User:",DEFAULT,50,1024,"Verdana|5632|40|34","0|0|0",DEFAULT`
MyDialog005=`003,007,256,054,GROUPBOX,"GroupBox_1",DEFAULT,"User Settings",DEFAULT,120,DEFAULT,"Verdana|5632|40|34","0|0|0",DEFAULT`
MyDialog006=`015,041,138,014,STATICTEXT,"StaticText_6",DEFAULT,DEFAULT,DEFAULT,110,512,"Verdana|5632|40|34","255|0|0",DEFAULT`
MyDialog007=`207,019,046,014,PUSHBUTTON,"PushButton_1",DEFAULT,"Update Users",2,100,0,"Verdana|5632|40|34",DEFAULT,DEFAULT`
MyDialog008=`159,021,044,012,CHECKBOX,"CheckBox_1",cbVariable1,"Fresh Start",1,90,0,"Verdana|5632|40|34","0|0|255",DEFAULT`
MyDialog009=`019,077,248,012,VARYTEXT,"VaryText_1",clock,"3",DEFAULT,80,512,DEFAULT,DEFAULT,DEFAULT`
ButtonPushed=Dialog("MyDialog")
Pause('ButtonPushed', ButtonPushed)