Moin Raupi,
dann mache es doch einfach so ...
Spoiler anzeigen
;
#include <WindowsConstants.au3>
#include <GUIConstantsEx.au3>
#include <Constants.au3>
Global Const $STM_SETIMAGE = 0x0172
[/autoit] [autoit][/autoit] [autoit]$hInstance = GetModuleHandle ("shell32.dll")
[/autoit] [autoit][/autoit] [autoit]$hbmp = LoadImage ( _
$hInstance, _
MAKEINTRESOURCE(131), _
$IMAGE_BITMAP, _
0, _ ; Originalgröße
0, _ ; Originalgröße
$LR_CREATEDIBSECTION _
)
$hwnd = GUICreate ("Pic From Resource", 413, 72)
[/autoit] [autoit][/autoit] [autoit]$ID_PIC = GUICtrlCreatePic ("", 0, 0, 413, 72)
[/autoit] [autoit][/autoit] [autoit]GUICtrlSendMsg ($ID_PIC, $STM_SETIMAGE, $IMAGE_BITMAP, $hbmp)
[/autoit] [autoit][/autoit] [autoit]GUISetState (@SW_SHOW, $hwnd)
[/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]While (TRUE)
[/autoit] [autoit][/autoit] [autoit]Switch (GUIGetMsg (FALSE))
Case $GUI_EVENT_CLOSE
DeleteObject ($hbmp)
Exit (0)
Case Else
EndSwitch
WEnd
Func DeleteObject ($hObject)
[/autoit] [autoit][/autoit] [autoit]Local $aRes = DllCall ("gdi32.dll", 'int', 'DeleteObject', _
'ptr', $hObject) ; handle to graphic object
Return $aRes[0]
EndFunc
[/autoit] [autoit][/autoit] [autoit]Func GetModuleHandle ($sModuleName)
Local $type = 'wstr'
If (not $sModuleName or IsPtr ($sModuleName)) Then $type = 'ptr'
Local $aRes = DllCall ("kernel32.dll", "ptr", "GetModuleHandleW", _
$type, $sModuleName)
Return $aRes[0]
EndFunc
Func LoadImage ($hinst, $lpszName, $uType, $cxDesired, $cyDesired, $fuLoad)
[/autoit] [autoit][/autoit] [autoit]Local $type = 'wstr'
If (IsPtr ($lpszName)) Then $type = 'ptr'
Local $aRes = DllCall ("user32.dll", 'ptr', 'LoadImageW', _
'ptr', $hinst, _
$type, $lpszName, _
'uint', $uType, _
'int', $cxDesired, _
'int', $cyDesired, _
'uint', $fuLoad)
Return $aRes[0]
EndFunc
[/autoit] [autoit][/autoit] [autoit]Func MAKEINTRESOURCE($i)
Return Ptr ($i)
EndFunc
;
EDIT: Mal wieder das Wichtigste vergessen, Code korrigiert.
Gruß
Greenhorn