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,hBMP As Dword
Function PBMain() As Long
Dialog New Pixels, 0, "Dialog Capture",300,300,200,200, %WS_OverlappedWindow To hDlg
Control Add Button, hDlg, 100,"Push", 50,10,100,20
Dialog Show Modal hDlg Call DlgProc
End Function
CallBack Function DlgProc() As Long
Local w,h As Long
If Cb.Msg = %WM_Command And Cb.Ctl = 100 And Cb.CtlMsg = %BN_Clicked Then
keybd_event(%VK_SnapShot, 1, 0, 0) 'place active dialog on clipboard
Clipboard Get Bitmap To hBMP 'copy clipboard to hBMP
XPrint Attach Choose 'select printer
XPrint Copy hBMP,0
XPrint Close
End If
End Function
'gbs_01049
'Date: 03-10-2012
http://www.garybeene.com/sw/gbsnippets.htm