1. Dashboard
  2. Mitglieder
    1. Letzte Aktivitäten
    2. Benutzer online
    3. Team
    4. Mitgliedersuche
  3. Forenregeln
  4. Forum
    1. Unerledigte Themen
  • Anmelden
  • Registrieren
  • Suche
Alles
  • Alles
  • Artikel
  • Seiten
  • Forum
  • Erweiterte Suche
  1. AutoIt.de - Das deutschsprachige Forum.
  2. Mitglieder
  3. funkey

Beiträge von funkey

  • Suche GUI Befehl :-(

    • funkey
    • 2. Juli 2012 um 09:29

    Du suchst also nur einen Button??

    [autoit]

    GUICreate("Test")
    GUICtrlCreateLabel("Datei öffnen", 10, 10, 100, 20)
    Global $nButton = GUICtrlCreateButton("Öffnen", 110, 10, 80, 20)
    GUISetState()

    [/autoit][autoit][/autoit][autoit]

    Global $iMsg
    While 1
    $iMsg = GUIGetMsg()
    Switch $iMsg
    Case $nButton
    FileOpenDialog("Datei öffnen", @ScriptDir, "Alle Dateien (*.*)")
    Case -3
    GUIDelete()
    Exit
    EndSwitch
    WEnd

    [/autoit]
  • TrayIcon Postition bestimmen

    • funkey
    • 28. Juni 2012 um 21:06

    Es wird ein Array zurückgegeben.
    Außerdem würde ich @AutoItExe oder @AutoItPID verwenden.

  • Sonderzeichen in Inputboxen nicht erlauben

    • funkey
    • 28. Juni 2012 um 17:59

    Bau dir einfach die GUI mit Input-Controls so wie du sie brauchst und verwende das: RestrictControlRegExp-UDF - Fehleingaben direkt verhindern, Eingabentypen festlegen

  • TrayIcon Postition bestimmen

    • funkey
    • 28. Juni 2012 um 17:29

    Damit sollte das super funktionieren:
    http://www.autoitscript.com/forum/topic/10…df/#entry735369

  • 10 Hz UDP mit nur 5 Hz empfangen

    • funkey
    • 27. Juni 2012 um 15:47

    So wie ich das verstanden habe, erhältst du alle 100ms einen neuen Wert. Du willst aber nur alle 200ms mit einem Wert rechnen. Dann lese doch alle 100ms die Werte ein, aber verwirf einfach jeden zweiten Wert bzw. rechne nur mit jedem zweiten Wert (z.B. eine Toggle-Variable verwenden).

  • sqlite3.dll verschwunden

    • funkey
    • 5. Juni 2012 um 13:04

    Die DLL wird doch von AutoIt bis Version 3.3.6.1 automatisch mit _SQLite_Startup() erzeugt und wenn die Rechte vorhanden waren direkt im Systemverzeichnis abgelegt.

  • Label über Progressbar

    • funkey
    • 30. Mai 2012 um 16:38

    Danke Oscar!

  • Label über Progressbar

    • funkey
    • 29. Mai 2012 um 10:02

    Ohne GDI+ könnte man da so machen:

    Spoiler anzeigen
    [autoit]

    GUICreate("Progress", 520, 60)

    [/autoit] [autoit][/autoit] [autoit]

    $gui_progress1 = GUICtrlCreateProgress(10, 10, 500, 45)
    $gui_progress1_status = GUICtrlCreateLabel("", 150, 25, 200, 15, 0x201, 0x28)

    [/autoit] [autoit][/autoit] [autoit]

    GUISetState()
    AdlibRegister("_Update", 200)

    [/autoit] [autoit][/autoit] [autoit]

    Do
    Until GUIGetMsg() = -3

    [/autoit] [autoit][/autoit] [autoit]

    Func _Update()
    Local Static $i = 0
    Local Static $Up = 1
    If $Up Then
    $i += 5
    Else
    $i -= 5
    EndIf

    [/autoit] [autoit][/autoit] [autoit]

    GUICtrlSetData($gui_progress1, $i)
    GUICtrlSetData($gui_progress1_status, "Dateien werden vorbereitet: " & $i & "%")

    [/autoit] [autoit][/autoit] [autoit]

    If $i = 100 Then $Up = 0
    If $i = 0 Then $Up = 1
    EndFunc

    [/autoit]
  • Überweisung nach China. Erfahrungen?

    • funkey
    • 25. Mai 2012 um 07:22

    Ich hab damals mal einen Sch... gebaut und bei Ebay etwas 'günstiges' aus China um ca. 20€ gekauft. Allerdings war die Bezahlung nur mit Paypal möglich(was ich übersehen hatte) und ich hatte noch kein Paypal. Der Verkäufer schickte mir dann die Bankdaten um das Geld direkt auf das Paypal-Konto zu überweisen. Gesagt, getan. Die Gebühren beliefen sich auf ungefähr 35€ und den Artikel habe ich nie gesehen...
    War natürlich selber daran Schuld.

  • File to Base64 String Code Generator v1.20 Build 2020-06-05

    • funkey
    • 24. Mai 2012 um 20:03

    Natürlich benutze ich dein Tool! Immer wieder gerne!

  • Wie kriege ich ein anderen Inhalt in List3

    • funkey
    • 23. Mai 2012 um 15:21

    Verstehe ich noh nicht ganz. Was soll in List3 angezeigt werden?

  • Windows-Datei-ID auslesen

    • funkey
    • 22. Mai 2012 um 22:08

    Such mal nach FileSystemMonitor im englischen Forum ;)

  • k8055 board dll für 64bit

    • funkey
    • 16. Mai 2012 um 22:26

    Du brauchst das Skript sicher nur als 32Bit-Anwendung kompilieren, dann sollte es funktionieren. Es kann auch sein, dass du #RequireAdmin benötigst.

  • CreateResourceDLL

    • funkey
    • 14. Mai 2012 um 14:28

    Danke für die netten Komentare.
    Hab mal schnell die Schriftarten-Unterstützung hinzugefügt.
    Download siehe Post #1.

  • ControlGetText problem

    • funkey
    • 13. Mai 2012 um 15:14

    Versuch mal das Control über den ClassnameNN anzusprechen.

  • CreateResourceDLL

    • funkey
    • 11. Mai 2012 um 18:56

    Danke, freut mich wenn ihr damit was anfangen könnt. 8o
    Das ganze wäre jetzt natürlich noch ausbaufähig für andere Arten von Resourcen (Sounds, Schriftarten, Mauszeiger, Texte, Videos, ...). Wer Langeweile hat, kann das gerne ergänzen! ;)

  • CreateResourceDLL

    • funkey
    • 11. Mai 2012 um 11:12

    Die Funktion kann eine Resourcen-DLL mit Icons und Bildern erzeugen. Hab nur ein paar Skripte miteinander verbunden.
    Hoffe es kann jemand brauchen!

    Spoiler anzeigen
    [autoit]

    #include <WinAPIEx.au3>
    #include <Array.au3>
    #include <APIConstants.au3>
    #include <GDIPlus.au3>
    #include <Memory.au3>
    #include <StaticConstants.au3>

    [/autoit] [autoit][/autoit] [autoit]

    Global $sDLL = @ScriptDir & "\Resourcen.dll"
    Global $sTempFile, $aFiles[1]

    [/autoit] [autoit][/autoit] [autoit]

    Global Const $tagICONDIRENTRY = "BYTE bWidth;BYTE bHeight;BYTE bColorCount;BYTE bReserved;WORD wPlanes;WORD wBitCount;DWORD dwBytesInRes;DWORD dwImageOffset"
    Global Const $tagGRPICONDIRENTRY = "BYTE bWidth;BYTE bHeight;BYTE bColorCount;BYTE bReserved;WORD wPlanes;WORD wBitCount;DWORD dwBytesInRes;WORD nID"

    [/autoit] [autoit][/autoit] [autoit]

    Global Const $SS_REALSIZECONTROL = 0x40

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    While 1
    $sTempFile = FileOpenDialog("Select resource files", @ScriptDir, "All files (*.*)|Icons (*.ico)|Bitmaps (*.bmp)", 3)
    If @error Then ExitLoop
    If $aFiles[0] = "" Then
    $aFiles[0] = $sTempFile
    Else
    _ArrayAdd($aFiles, $sTempFile)
    EndIf
    WEnd

    [/autoit] [autoit][/autoit] [autoit]

    _CreateResourceDLL($sDLL, $aFiles)

    [/autoit] [autoit][/autoit] [autoit]

    Global $aIcon = _ArrayFindAll($aFiles, ".ico", 0, 0, 0, 1, 0)
    Global $aBitmap = _ArrayFindAll($aFiles, ".bmp", 0, 0, 0, 1, 0)
    Global $aJpg = _ArrayFindAll($aFiles, ".jpg", 0, 0, 0, 1, 0)

    [/autoit] [autoit][/autoit] [autoit]

    GUICreate("Resource DLL", 800, 800)

    [/autoit] [autoit][/autoit] [autoit]

    If IsArray($aIcon) Then
    For $i = 0 To UBound($aIcon) - 1
    GUICtrlCreateIcon($sDLL, $aFiles[$aIcon[$i]], 10, 10 + 40 * $i, 32, 32, $SS_SUNKEN)
    GUICtrlCreateLabel($aFiles[$aIcon[$i]], 50, 10 + 40 * $i, 120, 32, $SS_CENTERIMAGE)
    Next
    EndIf

    [/autoit] [autoit][/autoit] [autoit]

    If IsArray($aBitmap) Then
    For $i = 0 To UBound($aBitmap) - 1
    GUICtrlCreatePic("", 200, 30 + 120 * $i, 100, 100, BitOR($SS_REALSIZECONTROL, $SS_SUNKEN))
    _SetImagefromResource(-1, $aFiles[$aBitmap[$i]], $sDLL, $RT_BITMAP)
    GUICtrlCreatePic("", 310, 30 + 120 * $i, 100, 100, BitOR($SS_CENTERIMAGE, $SS_SUNKEN))
    _SetImagefromResource(-1, $aFiles[$aBitmap[$i]], $sDLL, $RT_BITMAP)
    GUICtrlCreateLabel($aFiles[$aBitmap[$i]], 200, 10 + 120 * $i, 120, 20, 0x200)
    Next
    EndIf

    [/autoit] [autoit][/autoit] [autoit]

    If IsArray($aJpg) Then
    For $i = 0 To UBound($aJpg) - 1
    GUICtrlCreatePic("", 440, 30 + 120 * $i, 100, 100, BitOR($SS_REALSIZECONTROL, $SS_SUNKEN))
    _SetImagefromResource(-1, $aFiles[$aJpg[$i]], $sDLL, $RT_RCDATA)
    GUICtrlCreatePic("", 550, 30 + 120 * $i, 100, 100, BitOR($SS_CENTERIMAGE, $SS_SUNKEN))
    _SetImagefromResource(-1, $aFiles[$aJpg[$i]], $sDLL, $RT_RCDATA)
    GUICtrlCreateLabel($aFiles[$aJpg[$i]], 440, 10 + 120 * $i, 120, 20, 0x200)
    Next
    EndIf

    [/autoit] [autoit][/autoit] [autoit]

    GUISetState()

    [/autoit] [autoit][/autoit] [autoit]

    Do
    Until GUIGetMsg() = -3

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    Func _CreateResourceDLL($sDLL, ByRef $aFiles)
    If Not IsArray($aFiles) Or $aFiles[0] = "" Then Return SetError(1, 0, 0)
    _CreateEmptyDLL($sDLL)

    [/autoit] [autoit][/autoit] [autoit]

    Local $hUpdate = _WinAPI_BeginUpdateResource($sDLL, 0)
    If @error Then Return SetError(2, 0, 0)

    [/autoit] [autoit][/autoit] [autoit]

    Local $hFile, $bFile, $lFile, $tFile, $pFile, $sName, $sExt, $RT_TYPE, $Resource_ID = 0
    Local $tICONDIR, $tICONDIRENTRY, $tGRPICONDIR, $pGRPICONDIR
    Local $Temp
    Local $nSize

    [/autoit] [autoit][/autoit] [autoit]

    For $i = 0 To UBound($aFiles) - 1
    If Not FileExists($aFiles[$i]) Then SetError(3, 0, 0)

    [/autoit] [autoit][/autoit] [autoit]

    $hFile = FileOpen($aFiles[$i], 0)
    $bFile = FileRead($hFile)
    FileClose($hFile)
    $lFile = FileGetSize($aFiles[$i])
    $tFile = DllStructCreate("char[" & $lFile & "]")
    DllStructSetData($tFile, 1, $bFile)
    $pFile = DllStructGetPtr($tFile)
    $sName = StringUpper(StringTrimLeft($aFiles[$i], StringInStr($aFiles[$i], "\", 0, -1)))
    $sExt = StringTrimLeft($aFiles[$i], StringInStr($aFiles[$i], ".", 0, -1))

    [/autoit] [autoit][/autoit] [autoit]

    $aFiles[$i] = $sName

    [/autoit] [autoit][/autoit] [autoit]

    Switch $sExt
    Case "bmp"
    $RT_TYPE = $RT_BITMAP
    $lFile = $lFile - 14
    $pFile = Ptr($pFile + 14)

    [/autoit] [autoit][/autoit] [autoit]

    Case "ico"
    $RT_TYPE = $RT_ICON

    [/autoit] [autoit][/autoit] [autoit]

    Local $tB_Input_Header = DllStructCreate("short res;short type;short ImageCount;char rest[" & $lFile - 5 & "]", $pFile)
    Local $pB_Input_Header = DllStructGetPtr($tB_Input_Header)

    [/autoit] [autoit][/autoit] [autoit]

    Local $IconType = DllStructGetData($tB_Input_Header, "Type")
    Local $IconCount = DllStructGetData($tB_Input_Header, "ImageCount")

    [/autoit] [autoit][/autoit] [autoit]

    Local $tB_IconGroupHeader = DllStructCreate("short Res;short Type;short ImageCount;char Rest[" & $IconCount * 14 & "]")
    Local $pB_IconGroupHeader = DllStructGetPtr($tB_IconGroupHeader)

    [/autoit] [autoit][/autoit] [autoit]

    DllStructSetData($tB_IconGroupHeader, "Res", 0)
    DllStructSetData($tB_IconGroupHeader, "Type", $IconType)
    DllStructSetData($tB_IconGroupHeader, "ImageCount", $IconCount)

    [/autoit] [autoit][/autoit] [autoit]

    For $X = 1 To $IconCount
    Local $pB_Input_IconHeader = DllStructGetPtr($tB_Input_Header, 4) + ($X - 1) * 16
    Local $tB_Input_IconHeader = DllStructCreate($tagICONDIRENTRY, $pB_Input_IconHeader)
    Local $IconWidth = DllStructGetData($tB_Input_IconHeader, "bWidth")
    Local $IconHeigth = DllStructGetData($tB_Input_IconHeader, "bHeight")
    Local $IconColors = DllStructGetData($tB_Input_IconHeader, "bColorCount")
    Local $IconPlanes = DllStructGetData($tB_Input_IconHeader, "wPlanes")
    Local $IconBitPerPixel = DllStructGetData($tB_Input_IconHeader, "wBitCount")
    Local $IconImageSize = DllStructGetData($tB_Input_IconHeader, "dwBytesInRes")
    Local $IconImageOffset = DllStructGetData($tB_Input_IconHeader, "dwImageOffset")

    [/autoit] [autoit][/autoit] [autoit]

    $pB_IconGroupHeader = DllStructGetPtr($tB_IconGroupHeader, 4) + ($X - 1) * 14
    Local $tB_GroupIcon = DllStructCreate($tagGRPICONDIRENTRY, $pB_IconGroupHeader)
    DllStructSetData($tB_GroupIcon, "bWidth", $IconWidth)
    DllStructSetData($tB_GroupIcon, "bHeigth", $IconHeigth)
    DllStructSetData($tB_GroupIcon, "bColorCount", $IconColors)
    DllStructSetData($tB_GroupIcon, "bReserved", 0)
    DllStructSetData($tB_GroupIcon, "wPlanes", $IconPlanes)
    DllStructSetData($tB_GroupIcon, "wBitCount", $IconBitPerPixel)
    DllStructSetData($tB_GroupIcon, "dwBytesInRes", $IconImageSize)
    $Resource_ID += 1
    DllStructSetData($tB_GroupIcon, "nID", $Resource_ID)
    Local $PB_IconData = DllStructGetPtr($tB_Input_Header) + $IconImageOffset
    _WinAPI_UpdateResource($hUpdate, $RT_TYPE, $Resource_ID, Int("0x" & @OSLang), $PB_IconData, $IconImageSize)
    Next

    [/autoit] [autoit][/autoit] [autoit]

    $pB_IconGroupHeader = DllStructGetPtr($tB_IconGroupHeader)

    [/autoit] [autoit][/autoit] [autoit]

    Case "jpg", "jpeg", "gif"
    $RT_TYPE = $RT_RCDATA

    [/autoit] [autoit][/autoit] [autoit]

    ;~ Case "cur"
    ;~ $RT_TYPE = $RT_CURSOR
    ;~ Case "txt", "au3", "ini", "c", "cpp", "h"
    ;~ $RT_TYPE = $RT_STRING

    [/autoit] [autoit][/autoit] [autoit]

    Case Else
    ContinueLoop
    EndSwitch

    [/autoit] [autoit][/autoit] [autoit]

    If $RT_TYPE = $RT_ICON Then
    _WinAPI_UpdateResource($hUpdate, $RT_GROUP_ICON, $sName, Int("0x" & @OSLang), $pB_IconGroupHeader, DllStructGetSize($tB_IconGroupHeader))
    Else
    $Resource_ID += 1
    _WinAPI_UpdateResource($hUpdate, $RT_TYPE, $sName, Int("0x" & @OSLang), $pFile, $lFile)
    EndIf
    ;~ If @error Then SetError(4, $i, 0)
    $tFile = 0
    Next

    [/autoit] [autoit][/autoit] [autoit]

    _WinAPI_EndUpdateResource($hUpdate)
    If @error Then Return SetError(5, @extended)
    Return 1
    EndFunc ;==>_CreateResourceDLL

    [/autoit] [autoit][/autoit] [autoit]

    Func _CreateEmptyDLL($sFilePath)
    Local $bEmptyDll = _Empty_DLL()
    Local $hFile = FileOpen($sFilePath, 18) ;Binary mode + Write mode (Erase old content!)
    FileWrite($hFile, $bEmptyDll)
    FileClose($hFile)
    EndFunc ;==>_CreateEmptyDLL

    [/autoit] [autoit][/autoit] [autoit]

    Func _Empty_DLL()
    Local $Empty_DLL
    $Empty_DLL &= 'TVqQAAMAAAAEAAAA//8AALgAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAAA4fug4AtAnNIbgBTM0hVGhpcyBwcm9ncmFtIGNhbm5vdCBiZSBydW4gaW4gRE9TIG1vZGUuDQ0KJAAAAAAAAABQRQAATAEFAP6WNU0AAAAAAAAAAOAADiELAQIyAAQAAAAGAAAAAAAAABAAAAAQAAAAMAAAAAAAEAAQAAAAAgAABAAAAAAAAAAEAAAAAAAAAABgAAAABAAAAAAAAAMAAAAAABAAABAAAAAAEAAAEAAAAAAAABAAAAAAAAAAAAAAAAAwAAA8AAAAAFAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAC'
    $Empty_DLL &= 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABUMAAAGAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAC5jb2RlAAAAYwAAAAAQAAAAAgAAAAQAAAAAAAAAAAAAAAAAACAAAGAudGV4dAAAABgAAAAAIAAAAAIAAAAGAAAAAAAAAAAAAAAAAAAgAABgLmRhdGEAAADMAAAAADAAAAACAAAACAAAAAAAAAAAAAAAAAAAQAAAwC5yZWxvYwAAIAAAAABAAAAAAgAAAAoAAAAAAAAAAAAAAAAAAEAAAEIucnNyYwAAABAAAAAAUAAAAAIAAAAMAAAAAAAAAAAAAAAAAABAAAB'
    $Empty_DLL &= StringRepeat("A", 598) & 'IN8JAgBdQ6LRCQEo8QwABDoIgAAAIN8JAgCdQCDfCQIAHUF6CkAAACDfCQIA3UAuAEAAADCDABoAAAAAGgAEAAAaAAAAADouw8AAKPAMAAQw+gMAAAA/zXAMAAQ6KsPAADDww'
    $Empty_DLL &= StringRepeat("A", 550) & '/yVUMAAQ/yVcMAAQ/yVgMAAQ/yVkMAAQ'
    $Empty_DLL &= StringRepeat("A", 651)
    $Empty_DLL &= '8MAAAAAAAAAAAAAB2MAAAVDAAAEQwAAAAAAAAAAAAALIwAABcMAAAAAAAAAAAAAAAAAAAAAAAAAAAAABsMAAAAAAAAIIwAACQMAAAnjAAAAAAAABsMAAAAAAAAIIwAACQMAAAnjAAAAAAAACZAm1lbXNldAAATVNWQ1JULmRsbAAApAJIZWFwQ3JlYXRlAAClAkhlYXBEZXN0cm95APoBR2V0TW9kdWxlSGFuZGxlVwAAS0VSTkVMMzIuZGxs'
    $Empty_DLL &= StringRepeat("A", 431) & 'QAAAQAAAADDBMMFgwAAAAIAAAEAAAAAIwCDAOMBQw'
    $Empty_DLL &= StringRepeat("A", 645) & 'BSXNk0DAAc'
    $Empty_DLL &= StringRepeat("A", 668) & '='
    Return Binary(_Base64Decode($Empty_DLL))
    EndFunc ;==>_Empty_DLL

    [/autoit] [autoit][/autoit] [autoit]

    Func _Base64Decode($input_string)
    Local $struct = DllStructCreate("int")
    Local $a_Call = DllCall("Crypt32.dll", "int", "CryptStringToBinary", "str", $input_string, "int", 0, "int", 1, "ptr", 0, "ptr", DllStructGetPtr($struct, 1), "ptr", 0, "ptr", 0)
    If @error Or Not $a_Call[0] Then Return SetError(1, 0, "")
    Local $a = DllStructCreate("byte[" & DllStructGetData($struct, 1) & "]")
    $a_Call = DllCall("Crypt32.dll", "int", "CryptStringToBinary", "str", $input_string, "int", 0, "int", 1, "ptr", DllStructGetPtr($a), "ptr", DllStructGetPtr($struct, 1), "ptr", 0, "ptr", 0)
    If @error Or Not $a_Call[0] Then Return SetError(2, 0, "")
    Return DllStructGetData($a, 1)
    EndFunc ;==>_Base64Decode

    [/autoit] [autoit][/autoit] [autoit]

    Func StringRepeat($sChar, $nCount)
    $tBuffer = DllStructCreate("char[" & $nCount + 1 & "]")
    DllCall("msvcrt.dll", "ptr:cdecl", "memset", "ptr", DllStructGetPtr($tBuffer), "int", Asc($sChar), "int", $nCount)
    Return DllStructGetData($tBuffer, 1)
    EndFunc ;==>StringRepeat

    [/autoit] [autoit][/autoit] [autoit]

    Func _SetImagefromResource($CtrlID, $Resname, $Resfile = -1, $ResType = 10)
    ;Raupi
    ;Diese Funktion basiert auf der UDF von [email='Zedna@Autitscript.com'][/email] und Code von [email='Progandy@AutoIt.de'][/email]
    Local Const $IMAGE_BITMAP = 0
    Local Const $STM_SETIMAGE = 0x0172
    Local $hmod, $hwnd, $InfoBlock, $ResSize, $Mem, $pMem, $dll, $dll2, $hData, $pData, $pStream, $ret, $hBitmap, $pBitmap
    If $Resfile = -1 Then
    $hmod = _WinAPI_GetModuleHandle("")
    Else
    $hmod = _WinAPI_LoadLibrary($Resfile)
    EndIf
    If $ResType = $RT_BITMAP Then
    $hBitmap = _WinAPI_LoadImage($hmod, $Resname, $IMAGE_BITMAP, 0, 0, 0)
    If @error Then Return SetError(1, 0, 0)
    $hwnd = GUICtrlGetHandle($CtrlID)
    If $hwnd = 0 Then Return SetError(2, 0, 0)
    DllCall("user32.dll", "hwnd", "SendMessage", "hwnd", $hwnd, "int", $STM_SETIMAGE, "int", $IMAGE_BITMAP, "int", $hBitmap)
    If @error Then Return SetError(3, 0, 0)
    Else
    $InfoBlock = DllCall("kernel32.dll", "int", "FindResourceA", "int", $hmod, "str", $Resname, "long", $ResType)
    If @error Then Return SetError(4, 0, 0)
    $InfoBlock = $InfoBlock[0]
    If $InfoBlock = 0 Then Return SetError(5, 0, 0)
    $ResSize = DllCall("kernel32.dll", "dword", "SizeofResource", "int", $hmod, "int", $InfoBlock)
    If @error Then Return SetError(6, 0, 0)
    $ResSize = $ResSize[0]
    If $ResSize = 0 Then Return SetError(7, 0, 0)
    $Mem = DllCall("kernel32.dll", "int", "LoadResource", "int", $hmod, "int", $InfoBlock)
    If @error Then Return SetError(8, 0, 0)
    $Mem = $Mem[0]
    If $Mem = 0 Then Return SetError(9, 0, 0)
    $pMem = DllCall("kernel32.dll", "int", "LockResource", "int", $Mem)
    If @error Then Return SetError(8, 0, 0)
    $pMem = $pMem[0]
    If $pMem = 0 Then Return SetError(10, 0, 0)
    If $Resfile <> -1 Then DllCall("Kernel32.dll", "int", "FreeLibrary", "str", $hmod)
    $hData = _MemGlobalAlloc($ResSize, 2)
    $pData = _MemGlobalLock($hData)
    _MemMoveMemory($pMem, $pData, $ResSize)
    _MemGlobalUnlock($hData)
    $ret = DllCall("ole32.dll", "int", "CreateStreamOnHGlobal", "int", $hData, "long", 1, "Int*", 0)
    $pStream = $ret[3]
    _GDIPlus_Startup()
    $pBitmap = DllCall($ghGDIPDll, "int", "GdipCreateBitmapFromStream", "ptr", $pStream, "int*", 0)
    $pBitmap = $pBitmap[2]
    $hBitmap = _GDIPlus_BitmapCreateHBITMAPFromBitmap($pBitmap)
    $hwnd = GUICtrlGetHandle($CtrlID)
    If $hwnd = 0 Then Return SetError(11, 0, 0)
    DllCall("user32.dll", "hwnd", "SendMessage", "hwnd", $hwnd, "int", $STM_SETIMAGE, "int", $IMAGE_BITMAP, "int", $hBitmap)
    If @error Then Return SetError(12, 0, 0)
    _GDIPlus_BitmapDispose($pBitmap)
    _GDIPlus_Shutdown()
    $dll = DllStructCreate("Uint", $pStream)
    $dll2 = DllStructCreate("uInt", DllStructGetData($dll, 1) + 8)
    DllCall("", "UInt", DllStructGetData($dll2, 1), "UInt", $pStream)
    _WinAPI_DeleteObject($pStream)
    $pStream = 0
    _MemGlobalFree($hData)
    If $Resfile <> -1 Then _WinAPI_FreeLibrary($hmod)
    EndIf
    EndFunc ;==>_SetImagefromResource

    [/autoit]


    Edit 1: Schriftarten in DLL hinzugefügt
    Edit 2: Schriftname direkt aus Speicher auslesen ohne temporäre Datei

    Dateien

    CreateResourceDLL_Font_new.au3 17,07 kB – 1.114 Downloads CreateResourceDLL.au3 12,55 kB – 1.199 Downloads CreateResourceDLL_Font.au3 13,68 kB – 1.108 Downloads
  • Klassichen OpenDialog ansteuern?

    • funkey
    • 7. Mai 2012 um 15:10

    So?

    Spoiler anzeigen
    [autoit]

    #include <WinAPI.au3>

    [/autoit] [autoit][/autoit] [autoit]

    If Not @Compiled Then
    MsgBox(16, "Please compile", "Script can only run when compiled.")
    Exit
    EndIf

    [/autoit] [autoit][/autoit] [autoit]

    If $CmdLine[0] = 0 Then
    Run(@AutoItExe & " '" & @ScriptName & "' param")
    Local $Path = _WinAPI_GetOpenFileName("My Open File Dialog", "All files (*.*)", ".", "", "", 2, 512, 0)
    If $Path[2] <> "" Then MsgBox(0, "Selected", FileGetLongName($Path[1] & "\" & $Path[2]))
    Exit
    EndIf

    [/autoit] [autoit][/autoit] [autoit]

    _ChoosePath("My Open File Dialog", "", @ScriptFullPath)

    [/autoit] [autoit][/autoit] [autoit]

    Func _ChoosePath($sTitle, $sText, $sPath)
    WinWait($sTitle, $sText)

    [/autoit] [autoit][/autoit] [autoit]

    Local $aDrive = StringSplit($sPath, "\")

    [/autoit] [autoit][/autoit] [autoit]

    ControlSend($sTitle, $sText, "ComboBox2", $aDrive[1])

    [/autoit] [autoit][/autoit] [autoit]

    For $i = 2 To $aDrive[0] - 1
    ControlFocus($sTitle, $sText, "ListBox2")
    ControlSend($sTitle, $sText, "ListBox2", $aDrive[$i] & "{ENTER}{LEFT}")
    Next

    [/autoit] [autoit][/autoit] [autoit]

    ControlFocus($sTitle, $sText, "ListBox2")
    ControlFocus($sTitle, $sText, "ListBox1")
    ControlSend($sTitle, $sText, "ListBox1", $aDrive[$aDrive[0]])
    Sleep(500) ;wait for listbox animation
    ControlClick($sTitle, $sText, "Button1")
    EndFunc ;==>_ChoosePath

    [/autoit]

    Edit: Wartezeit eingebaut

  • Klassichen OpenDialog ansteuern?

    • funkey
    • 7. Mai 2012 um 12:24
    [autoit]

    #include <WinAPI.au3>

    [/autoit][autoit][/autoit][autoit]

    _WinAPI_GetOpenFileName("My Open File Dialog", _
    "Text File (*.txt)|AutoIt File (*.au3)", ".", @ScriptName, _
    "", 2, $OFN_ALLOWMULTISELECT, 0)

    [/autoit]
  • Schriftfarbe in Editfeld

    • funkey
    • 4. Mai 2012 um 07:14

    Sowas?
    Bunte Labels erzeugen

    Edit: Sorry, falsch gelesen. Bei Edit-Controls benötigst du definitiv ein RichEdit!

Spenden

Jeder Euro hilft uns, Euch zu helfen.

Download

AutoIt Tutorial
AutoIt Buch
Onlinehilfe
AutoIt Entwickler
  1. Datenschutzerklärung
  2. Impressum
  3. Shoutbox-Archiv
Community-Software: WoltLab Suite™