| |
|
|
Julian Schmidt |
DEF CreateCompatibleBitmap(3) !"GDI32","CreateCompatibleBitmap"
Proc CaptureWindow
Paramètres handle&
Externe("User32","SetForegroundWindow",handle&)
Sleep 200
Externe("User32","keybd_event",$2C,0,0,0)
Cas handle&<>0 : Externe("User32","keybd_event",$2C,1,0,0)
MCLS %maxx,%maxY
Début de peinture -1
ClipLoadBmp 0,0;0
ClearClip
EndPaint
Var hpic&=Créer("hNewPic", %BmpX, %BmpY, 0)
Début de peinture hpic&
MCopyBmp 0,0-%maxx,%maxY > 0,0;0
EndPaint
Retour hpic&
ENDPROC
Proc CaptureArea
Paramètres xpos%,ypos%,maxx!,maxY!
Var hdc& = Externe("User32","GetDC",0)
Var hmdc& = Externe("GDI32","CreateCompatibleDC",hdc&)
Var hbitmap& = CreateCompatibleBitmap(hdc&,maxx!,maxY!)
Externe("GDI32","SelectObject",hmdc&, hbitmap&)
Externe("GDI32","BitBlt",hmdc&, 0, 0, maxx!, maxY!, hdc&, xpos%, ypos%, $0CC0020)
hbitmap& = Externe("GDI32","GetCurrentObject",hmdc&, 7)
Externe("GDI32","DeleteDC",hmdc&)
Externe("User32","ReleaseDC","User32","ReleaseDC")
Retour 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'la fenêtre
Waitinput
DrawSizedPic CaptureArea(0,0,width(%hwnd),height(%hwnd)), 0, 0 - width(%hwnd), height(%hwnd); 0'région
Waitinput
|
|
|
| |
|
|