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,hConsole As Dword
Function PBMain() As Long
Dialog New Pixels, 0, "Test Code",300,600,200,300, %WS_OverlappedWindow To hDlg
Dialog Show Modal hDlg Call DlgProc
End Function
CallBack Function DlgProc() As Long
Local w,h As Long, prc As Rect Ptr
Select Case Cb.Msg
Case %WM_InitDialog
Local rc As RECT
rc.nTop = 300 : rc.nBottom = rc.nTop + 200 - 1
rc.nLeft = 300 : rc.nRight = rc.nLeft + 300 - 1
PostMessage hDlg, %WM_User+1000,0,0
Case %WM_User+1000
SendMessage hDlg, %WM_Sizing, %WMSZ_Top, VarPtr(rc)
Case %WM_Size
CPrint "WM_Size"
Case %WM_Sizing
Cprint "WM_Sizing"
End Select
End Function
Sub CPrint (SOut As String)
Static cWritten, iCount As Long
If hConsole = 0 Then AllocConsole: hConsole = GetStdHandle(-11&)
WriteConsole hConsole, ByCopy sOut + $CrLf, Len(sOut) + 2, cWritten, ByVal 0&
End Sub
'gbs_00737
'Date: 03-10-2012
http://www.garybeene.com/sw/gbsnippets.htm