#include <APIConstants.au3>
#include <WinAPIEx.au3>
Opt('MustDeclareVars', 1)
Global Const $STM_SETIMAGE = 0x0172
Global Const $STM_GETIMAGE = 0x0173
Global $hWnd, $hForm, $Pic, $hPic, $Size, $hObj, $hBmp, $hBitmap, $hDC, $hDestDC, $hDestSv, $hSrcDC, $hSrcSv
$hWnd = WinGetHandle('[TITLE:个人银行专业版;CLASS:TMainFrm]');获取主窗口句柄
If Not $hWnd Then
Exit
EndIf
; 创建 GUI
$Size = WinGetPos($hWnd)
$hForm = GUICreate('MyGUI', $Size[2] - 80, $Size[3] - 80)
$Pic = GUICtrlCreatePic('', 40, 40, $Size[2], $Size[3])
$hPic = GUICtrlGetHandle($Pic)
; 创建位图
$hDC = _WinAPI_GetDC($hPic)
$hDestDC = _WinAPI_CreateCompatibleDC($hDC)
$hBitmap = _WinAPI_CreateCompatibleBitmap($hDC, $Size[2], $Size[3])
$hDestSv = _WinAPI_SelectObject($hDestDC, $hBitmap)
$hSrcDC = _WinAPI_CreateCompatibleDC($hDC)
$hBmp = _WinAPI_CreateCompatibleBitmap($hDC, $Size[2], $Size[3])
$hSrcSv = _WinAPI_SelectObject($hSrcDC, $hBmp)
;_WinAPI_PrintWindow($hWnd, $hSrcDC)
_WinAPI_BitBlt($hDestDC, 0, 0, $Size[2], $Size[3], $hSrcDC, 0, 0, $MERGECOPY)
_WinAPI_RedrawWindow(_WinAPI_GetDesktopWindow(), 0, 0)
_WinAPI_RedrawWindow(_WinAPI_GetDesktopWindow(), 0, 0, $RDW_ERASE)
_WinAPI_RedrawWindow(_WinAPI_GetDesktopWindow(), 0, 0, $RDW_INVALIDATE + $RDW_ALLCHILDREN)
_WinAPI_RedrawWindow($hDC, 0, 0,$RDW_NOINTERNALPAINT)
_WinAPI_RedrawWindow($hDC, 0, 0, $RDW_ERASE)
_WinAPI_RedrawWindow($hDC, 0, 0, $RDW_INVALIDATE + $RDW_ALLCHILDREN)
_WinAPI_RedrawWindow($hDC, 0, $RDW_FRAME )
_SendMessage($hWnd, 'WM_PRINT', $hSrcDC, 'PRF_CLIENT|PRF_ERASEBKGND|PRF_NONCLIENT|PRF_CHILDREN')
_WinAPI_ReleaseDC($hPic, $hDC)
_WinAPI_SelectObject($hDestDC, $hDestSv)
_WinAPI_SelectObject($hSrcDC, $hSrcSv)
_WinAPI_DeleteDC($hDestDC)
_WinAPI_DeleteDC($hSrcDC)
_WinAPI_DeleteObject($hBmp)
_WinAPI_UpdateWindow($hSrcDC)
_WinAPI_UpdateWindow($hWnd)
; 设置位图到控件
_SendMessage($hPic, $STM_SETIMAGE, 0, $hBitmap)
$hObj = _SendMessage($hPic, $STM_GETIMAGE)
If $hObj <> $hBitmap Then
_WinAPI_DeleteObject($hBitmap)
EndIf
GUISetState()
Do
Until GUIGetMsg() = -3
找了NN多资料还是没解决 有高人帮忙下么