Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ; CompatibleDC vom Desktop-Device Context erstellen
- $hDeskDC = _WinAPI_CreateCompatibleDC(_WinAPI_GetDC(_WinAPI_GetDesktopWindow()))
- ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $hDeskDC = ' & $hDeskDC & @crlf & '>Error code: ' & @error & @crlf) ;### Debug Console
- ; Compatible Bitmap davon erstellen
- $hBitmap = _WinAPI_CreateCompatibleBitmap($hDeskDC, @DesktopWidth, @DesktopHeight)
- ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $hBitmap = ' & $hBitmap & @crlf & '>Error code: ' & @error & @crlf) ;### Debug Console
- ; Bitmap und Device Context per SelectObject verbinden.
- $hDCBlt = _WinAPI_SelectObject($hDeskDC, $hBitmap)
- ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $hDCBlt = ' & $hDCBlt & @crlf & '>Error code: ' & @error & @crlf) ;### Debug Console
- ; TEST - Skype Hwnd übergeben
- Local $oldOpt = Opt("WinTitleMatchMode", 2)
- $hWnd = WinGetHandle('Skype')
- Opt("WinTitleMatchMode", $oldOpt)
- ; gesamten Fensterinhalt der gewünschten Anwendung mit PrintWindow in das Bitmap-Objekt kopieren
- DllCall("user32.dll", "long", "PrintWindow", "hwnd", $hWnd, "long", $hDCBlt, "uint", 0)
- ; daraus mit CopyImage eine DIBSection erstellen
- Local Const $LR_COPYDELETEORG = 0x00000008, $LR_COPYRETURNORG = 0x00000004, $LR_CREATEDIBSECTION = 0x00002000
- Local $aRet = DllCall("User32.dll", "hwnd", "CopyImage", "hwnd", $hDCBlt, "uint", 0, "int", 0, "int", 0, "uint", BitOr($LR_COPYDELETEORG, $LR_COPYRETURNORG, $LR_CREATEDIBSECTION))
- Local $hDIBSection = $aRet[0]
- ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $hDIBSection = ' & $hDIBSection & @crlf & '>Error code: ' & @error & @crlf) ;### Debug Console
- ;
- Local $tagRGBQUAD = 'BYTE rgbBlue;BYTE rgbGreen;BYTE rgbRed;BYTE rgbReserved;'
- Local $arRGBQUAD = _ByteArray_Create($tagRGBQUAD, 100) ; WIEVIEL ??
- ; Aufruf noch falsch, ByteArray oder Pointer - wenn Pointer, wie krieg ich den auf ein Bytearray?
- $aRet = DllCall("Gdi32.dll", "int", "GetDIBColorTable", "hwnd", $hDIBSection, "uint", 0, "uint", 1, "ptr", DllStructGetPtr($arRGBQUAD))
- ConsoleWrite('Anzahl Table-Einträge: ' & $aRet[0] & @CRLF)
- ;===============================================================================
- ; Function Name: _ByteArrayCreate($sSTRUCT, $iELEMENTS=2)
- ; Description: Erstellt eine Bytearray-Struktur
- ; Parameter(s): $sSTRUCT String der Struktur
- ; $iELEMENTS Anzahl der Elemente des Bytearray
- ; Return Value(s): das erstellte Bytearray
- ; Author(s): BugFix (bugfix@autoit.de)
- ;===============================================================================
- Func _ByteArray_Create($sSTRUCT, $iELEMENTS=2)
- Local $SIZE = DllStructGetSize(DllStructCreate($sSTRUCT, 1))
- Local $aBYTE[$iELEMENTS +1]
- $aBYTE[0] = DllStructCreate('byte[' & $SIZE *$iELEMENTS & "]")
- Local $ptr = DllStructGetPtr($aBYTE[0])
- For $i = 0 To $iELEMENTS -1
- $aBYTE[$i+1] = DllStructCreate($sSTRUCT, $ptr + $i*$SIZE)
- Next
- Return $aBYTE
- EndFunc ;==>_ByteArray_Create
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement