jacQues Posted May 7, 2009 Posted May 7, 2009 I'm pretty sure that I am very close here, but it isn't working yet. The calls to user32.dll all seem to work (no MsgBox poping up), but when pasting nothing happens. Can anyone point me as to what I'm doing wrong please? #Include <GDIPlus.au3> _GDIPlus_Startup() $hImage = _GDIPlus_ImageLoadFromFile("C:\Documents and Settings\All Users\Application Data\Microsoft\User Account Pictures\guest.bmp") $hBitmap = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hImage) _GDIPlus_ImageDispose($hImage) $hDll = DllOpen("User32.dll") $aRet = DllCall($hDll,"int","OpenClipboard","hwnd",0); also tried GUICreate("test")) if $aRet[0]=0 then exit(msgbox(0,"error","OpenClipboard")) $aRet = DllCall($hDll,"int","EmptyClipboard") if $aRet[0]=0 then exit(msgbox(0,"error","EmptyClipboard")) $aRet = DllCall($hDll,"int","SetClipboardData","int",2,"hwnd",$hBitmap); also tried "ptr" if $aRet[0]=0 then msgbox(0,"error","SetClipboardData") $aRet = DllCall($hDll,"int","CloseClipboard") if $aRet[0]=0 then exit(msgbox(0,"error","CloseClipboard")) DllClose($hDll) _WinAPI_DeleteObject($hBitmap) _GDIPlus_ShutDown()
ProgAndy Posted May 7, 2009 Posted May 7, 2009 I have made for this here: http://www.autoitscript.com/forum/index.ph...st&p=514857 *GERMAN* [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes
jacQues Posted May 7, 2009 Author Posted May 7, 2009 I have made for this here: http://www.autoitscript.com/forum/index.ph...st&p=514857...I never knew HBITMAP != HBITMAP... lolYOU ROCK!Thank you so much!
ProgAndy Posted May 7, 2009 Posted May 7, 2009 I did not know that, too. I searched a lot and somewhere I found this solution *GERMAN* [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes
jacQues Posted May 7, 2009 Author Posted May 7, 2009 I did not know that, too. I searched a lot and somewhere I found this solution BTW, one thing I did find is this: Func _GDIPlus_ImageCreateGDICompatibleHBITMAP($hImg) Local $hBitmap2 = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hImg) Local $hBitmap = _WinAPI_CopyImage($hBitmap2,0,0,0,$LR_COPYDELETEORG+$LR_COPYRETURNORG) _WinAPI_DeleteObject($hBitmap2) <=- fails, is already deleted? Return $hBitmap EndFunc
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now