Date: 02-16-2022
Return to Index
created by gbSnippets
'Primary Code:
'Compilable Example: (Jose Includes)
#Compiler PBWin 9, PBWin 10
#Compile EXE
#Dim All
%Unicode=1
#Include "win32api.inc"
Global hDlg, hBMP, hBMPDC, hDeskTopDC, hDialogDC As Dword
Function PBMain() As Long
Local w,h As Long
Desktop Get Size To w,h
Dialog New Pixels, 0, "",0,0,w,h, %WS_Popup To hDlg
'copy desktop to memory bitmap
Graphic Bitmap New w,h To hBmp
Graphic Attach hBMP, 0
Graphic Get DC To hBMPDC
hDeskTopDC = GetDC(%Null)
BitBlt hBMPDC, 0,0,w,h, hDeskTopDC, 0,0, %SRCCopy 'copy desktop image to
ReleaseDC(%Null,hDeskTopDC)
Dialog Show Modal hDlg Call DlgProc
End Function
CallBack Function DlgProc() As Long
Local w,h As Long, PS As PaintStruct
Select Case Cb.Msg
Case %WM_Paint
Desktop Get Size To w,h
hDialogDC = BeginPaint(hDlg, PS)
BitBlt hDialogDC, 0,0,w,h, hBMPDC, 0,0, %SRCCopy 'copy hBMPDC to dialog
EndPaint hDlg, PS
Case %WM_ContextMenu : Dialog End hDlg 'right click to exit
End Select
End Function
'gbs_01094
'Date: 03-10-2012
http://www.garybeene.com/sw/gbsnippets.htm