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,hRgn as DWord
Function PBMain () As Long
Dim P(4) As Point
Dialog New Pixels, 0, "Un-Square Dialog",300,300,400,400, %WS_OverlappedWindow or %WS_ClipChildren To hDlg
P(0).x = 0 : P(0).y = 0
P(1).x = 175 : P(1).y = 0
P(2).x = 250 : P(2).y = 100
P(3).x = 50 : P(3).y = 300
P(4).x = 0 : P(4).y = 0
hRgn = CreatePolygonRgn(P(0),5, %Alternate)
SetWindowRgn(hDlg, hrgn, %True)
Dialog Show Modal hDlg Call DlgProc
DeleteObject hRgn
End Function
CallBack Function DlgProc() As Long
Select Case Cb.Msg
Case %WM_LButtonDown
If Cb.WParam = %MK_LBUTTON Then SendMessage hDlg, %WM_NCLButtonDown, %HTCaption, ByVal %Null ' force drag
Case %WM_ContextMenu
Dialog End Cb.Hndl
End Select
End Function
'gbs_00910
'Date: 03-10-2012
http://www.garybeene.com/sw/gbsnippets.htm