
------------------
Lance
PowerBASIC Support
mailto:[email protected][email protected]</A>
#Compile Exe #Register None #Dim All #Include "WIN32API.INC" Global hDlg As Long, hDlg1 As Long CallBack Function DlgProc1 If (CbMsg = %WM_COMMAND) And (CbCtl = 101) Then Dialog End hDlg End Function CallBack Function DlgProc If CbMsg = %WM_DESTROY Then MsgBox "hDlg has been destroyed" End Function Function PbMain Dialog New 0, "hDlg", 100, 100, 100, 100, %WS_CAPTION To hdlg Dialog New 0, "hDlg1", 300, 300, 100, 15, %WS_CAPTION To hdlg1 Control Add Button, hDlg1, 101, "Stop hDlg", 0, 0, 100, 15 Dialog Show Modeless hDlg1 Call DlgProc1 Dialog Show Modal hDlg Call DlgProc End Function
#Compile Exe #Register None #Dim All #Include "win32api.inc" Global hDlg2 As Long Function Thread1(ByVal hDlg&)As Long Dialog New hDlg&, "TestB", 120,100,100,100 To hDlg2 Dialog Show Modal hDlg2 MsgBox "Finished" End Function CallBack Function Btn1 PostMessage hDlg2, %WM_SYSCOMMAND, %SC_CLOSE, 0 End Function CallBack Function Btn2 SendMessage hDlg2, %WM_SYSCOMMAND, %SC_CLOSE, 0 End Function CallBack Function Btn3 Dialog End hDlg2 End Function Function PbMain Local hDlg As Long, t As Long Dialog New 0, "TestA", , , 100, 80, %WS_CAPTION Or %WS_SYSMENU To hDlg Control Add Button, hDlg,101, "PostMessage (+)", 10, 10, 80, 15 Call BTN1 Control Add Button, hDlg,102, "SendMessage (-)", 10, 30, 80, 15 Call BTN2 Control Add Button, hDlg,103, "Dialog End (-)", 10, 50, 80, 15 Call BTN3 Thread Create Thread1(0) To t Thread Close t To t Dialog Show Modal hDlg End Function
#Compile Exe #Register None #Dim All #Include "win32api.inc" Function PbMain Local hDlg As Long Dialog New 0, "TestB", , , 100, 80, %WS_CAPTION Or %WS_SYSMENU To hDlg Dialog Show Modal hDlg MsgBox "Finished" End Function
#Compile Exe #Register None #Dim All #Include "win32api.inc" CallBack Function Btn1 PostMessage FindWindow("", "TestB"), %WM_SYSCOMMAND, %SC_CLOSE, 0 End Function CallBack Function Btn2 SendMessage FindWindow("", "TestB"), %WM_SYSCOMMAND, %SC_CLOSE, 0 End Function CallBack Function Btn3 Dialog End FindWindow("", "TestB") End Function Function PbMain Local hDlg As Long, t As Long Dialog New 0, "TestA", 0, 0, 100, 80, %WS_CAPTION Or %WS_SYSMENU To hDlg Control Add Button, hDlg,101, "PostMessage (+)", 10, 10, 80, 15 Call BTN1 Control Add Button, hDlg,102, "SendMessage (-)", 10, 30, 80, 15 Call BTN2 Control Add Button, hDlg,103, "Dialog End (-)", 10, 50, 80, 15 Call BTN3 t = Shell("b.Exe") Dialog Show Modal hDlg End Function
We process personal data about users of our site, through the use of cookies and other technologies, to deliver our services, and to analyze site activity. For additional details, refer to our Privacy Policy.
By clicking "I AGREE" below, you agree to our Privacy Policy and our personal data processing and cookie practices as described therein. You also acknowledge that this forum may be hosted outside your country and you consent to the collection, storage, and processing of your data in the country where this forum is hosted.
Leave a comment: