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"
%GripperSize = 10
Global hDlg As Dword
Function PBMain() As Long
Dialog New Pixels, 0, "PowerBASIC",300,300,200,200, %WS_Popup To hDlg
Dialog Show Modal hDlg Call DlgProc
End Function
CallBack Function DlgProc() As Long
Local pt As Point, rc,rcWin As Rect
Select Case Cb.Msg
Case %WM_ContextMenu
Dialog End hDlg
Case %WM_LButtonDown
If Cb.WParam = %MK_LBUTTON Then SendMessage hDlg, %WM_NCLButtonDown, %HTCaption, ByVal %Null ' force drag
Case %WM_NCHitTest
pt.x = Lo(Integer, Cb.LParam)
pt.y = Hi(Integer, Cb.LParam)
GetWindowRect hDlg, rcWin
' Lower right corner
rc.nLeft = rcWin.nRight - %GripperSize
rc.nRight = rcWin.nRight
rc.nTop = rcWin.nBottom - %GripperSize
rc.nBottom = rcWin.nBottom
If PtInRect(rc, ByVal pt) Then Function = %HTBOTTOMRIGHT
End Select
End Function
'gbs_01381
'Date: 10-17-2014
http://www.garybeene.com/sw/gbsnippets.htm