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 As Dword
Function PBMain() As Long
Dialog New Pixels, 0, "Dialog/Screen Capture",300,300,240,100, %WS_OverlappedWindow To hDlg
Control Add Button, hDlg, 100,"Capture Dialog", 30,10,120,20
Control Add Button, hDlg, 200,"Capture Screen", 30,40,120,20
Control Add Button, hDlg, 300,"Save Clipboard to File", 30,70,120,20
Dialog Show Modal hDlg Call DlgProc
End Function
CallBack Function DlgProc() As Long
Local w,h As Long, hBMP As Dword
Select Case Cb.Msg
Case %WM_Command
Select Case Cb.Ctl
Case 100 : keybd_event(%VK_SnapShot, 1, 0, 0) 'place active dialog on clipboard
Case 200 : keybd_event(%VK_SnapShot, 0, 0, 0) 'place screen shot on clipboard
Case 300
Clipboard Get Bitmap To hBMP
Graphic Attach hBMP,0
Graphic Save "clipboard.bmp"
End Select
End Select
End Function
'gbs_00503
'Date: 03-10-2012
http://www.garybeene.com/sw/gbsnippets.htm