jeantje Posted April 4, 2009 Posted April 4, 2009 (edited) let's say i want an image from shell32.dll but i don't want to export it so i want to directly load it from the dll and then display it in a guy any ways to do that? Edited April 4, 2009 by jeantje
TerarinK Posted April 5, 2009 Posted April 5, 2009 Look into _GUIImageList Managment under the help think that will aid you then 0x576520616C6C206469652C206C697665206C69666520617320696620796F75207765726520696E20746865206C617374207365636F6E642E
jeantje Posted April 5, 2009 Author Posted April 5, 2009 Look into _GUIImageList Managment under the help think that will aid you theneh actually i want to load a bitmap from a dll file
maqleod Posted April 5, 2009 Posted April 5, 2009 eh actually i want to load a bitmap from a dll filewell, for icons from shell32.dll, this would load it directly to a control in your gui:GUICtrlSetImage($controlid, "shell32.dll", 22)not sure how you would load it as a bitmap though. [u]You can download my projects at:[/u] Pulsar Software
Authenticity Posted April 5, 2009 Posted April 5, 2009 expandcollapse popup#include <GDIPlus.au3> #include <GuiConstantsEx.au3> #include <WinAPI.au3> #include <WindowsConstants.au3> _GDIPlus_Startup() Dim $hGUI = GUICreate('Test') Dim $hGraphics = _GDIPlus_GraphicsCreateFromHWND($hGUI) Dim $hBitmap = _WinAPI_LoadBitmap(_WinAPI_GetModuleHandle('shell32.dll'), 147) Dim $hImage = _GDIPlus_BitmapCreateFromHBITMAP($hBitmap) GUISetState() _GDIPlus_GraphicsDrawImage($hGraphics, $hImage, 0, 0) GUIRegisterMsg($WM_PAINT, 'OnPaint') While 1 Switch GUIGetMsg() Case $GUI_EVENT_RESTORE _GDIPlus_GraphicsDrawImage($hGraphics, $hImage, 0, 0) Case $GUI_EVENT_CLOSE ExitLoop EndSwitch Sleep(20) WEnd _WinAPI_DeleteObject($hImage) _WinAPI_DeleteObject($hBitmap) _GDIPlus_GraphicsDispose($hGraphics) GUIDelete() _GDIPlus_Shutdown() Func OnPaint($hwnd, $iMsg, $iwParam, $ilParam) _GDIPlus_GraphicsDrawImage($hGraphics, $hImage, 0, 0) Return $GUI_RUNDEFMSG EndFunc
trancexx Posted April 5, 2009 Posted April 5, 2009 For example above mine I would go with this: #include <Constants.au3> #include <GUIConstantsEx.au3> #include <WinAPI.au3> GUICreate("Test", 413) $hPic = GUICtrlCreatePic("", 0, 0, 413, 72) Local $hInstance = _WinAPI_GetModuleHandle("shell32.dll") Local $hBitmap= _WinAPI_LoadImage($hInstance, 147, $IMAGE_BITMAP, 0, 0, 0) Local $STM_SETIMAGE = 370 Local $iMsg = GUICtrlSendMsg($hPic, $STM_SETIMAGE, 0, $hBitmap) GUISetState() While 1 If GUIGetMsg() = $GUI_EVENT_CLOSE Then Exit WEnd ♡♡♡ . eMyvnE
jeantje Posted April 5, 2009 Author Posted April 5, 2009 and are there any ways to load a bitmap from a dll file and not shell32.dll but HSInst.dll and then bitmap 102 Download: HSInst.zip
ProgAndy Posted April 5, 2009 Posted April 5, 2009 Yes, this is possible: #include <Constants.au3> #include <GUIConstantsEx.au3> #include <WinAPI.au3> GUICreate("Test", 413) $hPic = GUICtrlCreatePic("", 0, 0, 300, 180) Local $hInstance = _WinAPI_LoadLibraryEx(@WindowsDir&"\explorer.exe",$LOAD_LIBRARY_AS_DATAFILE ) Local $hBitmap= _WinAPI_LoadImage($hInstance, 170, $IMAGE_BITMAP, 0, 0, 0) Local $STM_SETIMAGE = 370 Local $iMsg = GUICtrlSendMsg($hPic, $STM_SETIMAGE, 0, $hBitmap) If $iMsg Then _WinAPI_DeleteObject($iMsg) EndIf GUISetState() While 1 If GUIGetMsg() = $GUI_EVENT_CLOSE Then Exit WEnd *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
jeantje Posted April 5, 2009 Author Posted April 5, 2009 Yes, this is possible: #include <Constants.au3> #include <GUIConstantsEx.au3> #include <WinAPI.au3> GUICreate("Test", 413) $hPic = GUICtrlCreatePic("", 0, 0, 300, 180) Local $hInstance = _WinAPI_LoadLibraryEx(@WindowsDir&"\explorer.exe",$LOAD_LIBRARY_AS_DATAFILE ) Local $hBitmap= _WinAPI_LoadImage($hInstance, 170, $IMAGE_BITMAP, 0, 0, 0) Local $STM_SETIMAGE = 370 Local $iMsg = GUICtrlSendMsg($hPic, $STM_SETIMAGE, 0, $hBitmap) If $iMsg Then _WinAPI_DeleteObject($iMsg) EndIf GUISetState() While 1 If GUIGetMsg() = $GUI_EVENT_CLOSE Then Exit WEnd thank you very much
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