Date: 02-16-2022
Return to Index
created by gbSnippets
'Compilable Example: (Jose Includes)
#Compiler PBWin 10
#Compile Exe
#Dim All
%Unicode = 1
#Include "Win32API.inc"
Enum Equates Singular
IDC_Button
End Enum
Global hDlg As Dword
Function PBMain() As Long
Local iResult As Long
Dialog New Pixels, 0, "PowerBASIC",300,300,200,200, %WS_OverlappedWindow To hDlg
Control Add Button, hDlg, %IDC_Button,"Push", 50,10,100,20
Dialog Show Modal hDlg Call DlgProc To iResult
? Str$(iResult)
End Function
CallBack Function DlgProc() As Long
Select Case Cb.Msg
Case %WM_Command
Select Case Cb.Ctl
Case %IDC_Button
Dialog End hDlg, 99
End Select
Case %WM_SysCommand
If (Cb.WParam And &HFFF0) = %SC_Close Then 'trap Alt-F4, X-button, WindowMenu/Close
Dialog Post hDlg, %WM_User+500, 0, 0
Function = 1
End If
Case %WM_User+500
Dialog End hDlg, 99
Case %WM_Destroy
End Select
End Function
'gbs_01201
'Date: 05-11-2013
http://www.garybeene.com/sw/gbsnippets.htm