Screenshot
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
DEF CreateCompatibleBitmap(3) !"GDI32","CreateCompatibleBitmap"
Proc CaptureWindow
Parameters handle&
External("USER32","SetForegroundWindow",handle&)
Sleep 200
External("USER32","keybd_event",$2C,0,0,0)
Case handle&<>0 : External("USER32","keybd_event",$2C,1,0,0)
MCLS %maxX,%maxY
StartPaint -1
ClipLoadBmp 0,0;0
ClearClip
EndPaint
Var hpic&=Create("hNewPic", %BmpX, %BmpY, 0)
StartPaint hpic&
MCopyBmp 0,0-%maxX,%maxY > 0,0;0
EndPaint
Return hpic&
EndProc
Proc CaptureArea
Parameters xpos%,ypos%,maxX!,maxY!
Var hdc& = External("USER32","GetDC",0)
Var hmdc& = External("GDI32","CreateCompatibleDC",hdc&)
Var hbitmap& = CreateCompatibleBitmap(hdc&,int(maxX!),int(maxY!))
External("GDI32","SelectObject",hmdc&, hbitmap&)
External("GDI32","BitBlt",hmdc&, 0, 0, int(maxX!), int(maxY!), hdc&, xpos%, ypos%, $0CC0020)
hbitmap& = External("GDI32","GetCurrentObject",hmdc&, 7)
External("GDI32","DeleteDC",hmdc&)
External("USER32","ReleaseDC",0,hdc&)
Return hbitmap&
EndProc
Cls
DrawSizedPic CaptureWindow(0), 0, 0 - width(%hwnd), height(%hwnd); 0'Ganzer Bildschirn
Waitinput
DrawSizedPic CaptureWindow(%hwnd), 0, 0 - width(%hwnd), height(%hwnd); 0'Fenster
Waitinput
DrawSizedPic CaptureArea(0,0,width(%hwnd),height(%hwnd)), 0, 0 - width(%hwnd), height(%hwnd); 0'Region
Waitinput