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. name22

Beiträge von name22

  • onevent mode

    • name22
    • 16. Januar 2011 um 20:01

    Du solltest dir angewöhnen, alle GUIs am Anfang des Scripts zu erstellen und später im Script einfach sichtbar/unsichtbar zu schalten.

    Spoiler anzeigen
    [autoit]

    #include <ButtonConstants.au3>
    #include <GUIConstantsEx.au3>
    #include <WindowsConstants.au3>
    Opt("GUIOnEventMode", 1)

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

    $Form1 = GUICreate("Form1", 192, 138, 192, 124)
    GUISetOnEvent($GUI_EVENT_CLOSE, "Form1Close", $Form1)
    $Button1 = GUICtrlCreateButton("öffne form2", 54, 52, 75, 25, $WS_GROUP)
    GUICtrlSetOnEvent(-1, "Form2")
    GUISetState(@SW_SHOW)

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

    $Form2 = GUICreate("Form2", 192, 138, 192, 124, BitOR($WS_SYSMENU, $WS_CAPTION, $WS_POPUP, $WS_POPUPWINDOW, $WS_BORDER, $WS_CLIPSIBLINGS), BitOR($WS_EX_TOOLWINDOW, $WS_EX_WINDOWEDGE))
    GUISetOnEvent($GUI_EVENT_CLOSE, "schliessen", $Form2)
    $Button2 = GUICtrlCreateButton("schliessen", 54, 52, 75, 25, $WS_GROUP)
    GUICtrlSetOnEvent(-1, "schliessen")

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

    While 1
    Sleep(100)
    WEnd

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

    Func Form2()
    GUISetState(@SW_SHOW, $Form2)
    EndFunc ;==>Form2

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

    Func Form1Close()
    Exit
    EndFunc

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

    func schliessen()
    GUISetState(@SW_HIDE,$Form2)
    EndFunc

    [/autoit]
  • Frage zu Inputboxen

    • name22
    • 16. Januar 2011 um 14:36

    Willst du etwas lernen oder nicht? Wenn ja, dann ließ dir das Tutorial durch wie ich es dir schon empfohlen habe. Wenn nicht, dann mach es so:

    Spoiler anzeigen
    [autoit]

    $sString = InputBox("Test", "Name:")
    MsgBox(64, "Info", $sString & " ist ein sehr schöner Name.")

    [/autoit]
  • Frage zu Inputboxen

    • name22
    • 16. Januar 2011 um 14:32

    Abgesehen davon, dass das hier bei Tutorials total fehl am Platze ist, schaust du dir am besten die Tutorials, links bei den "Wichtigen Links" an.
    Du kannst den Rückgabewert der InputBox in einer Variable speichern, und diese Variable dann mit & Operatoren mit dem String der MsgBox verbinden ;).
    Aber diese Frage hättest du auch in deinem anderen Thread stellen können... :rolleyes:

  • GDI+ bitmap stecken bzw stauchen

    • name22
    • 15. Januar 2011 um 19:57

    Die alte Bitmap in eine neue Bitmap mit den gewünschten Maßen zeichnen. Z.B. mit _GDIPlus_GraphicsDrawImageRect.

  • Mein Fehler bei _Stringbetween (mal gehts, mal nicht)

    • name22
    • 15. Januar 2011 um 17:57

    Das hier funktioniert bei mir immer:

    [autoit]

    #include <Array.au3>

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

    $sHTML = BinaryToString(InetRead("http://releases.mozilla.org/pub/mozilla.org/firefox/releases/3.6.13/update/win32/de/"), 4)
    $aResult = StringRegExp($sHTML, '<a href="(.*)">firefox', 3)

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

    _ArrayDisplay($aResult)

    [/autoit]
  • außerhalb von GUI Quadrate zeichnen

    • name22
    • 15. Januar 2011 um 16:41

    Jedesmal wenn du ein Objekt (Maus, Fenster) über einen bestimmten Bereich auf dem Bildschirm bewegst, sagt Windows allen Fenstern etc. die davon betroffen sind, dass sie sich neuzeichnen sollen um Darstellungsfehler zu verhindern. Dein Programm macht das aber nicht von selbst, und somit wird der Punkt einfach übermalt wenn etwas darüber bewegt wird. Normalerweise kann man die $WM_PAINT Nachricht per GUIRegisterMsg abfangen um z.B. GDI+ Elemente in einer GUI neu zu zeichnen, aber ich weiß nicht wie das bei deinem Script gehen könnte. Daher kannst du meins ein wenig umbauen oder warten bis jemand eine Lösung für dein Script findet. ;)

  • Petition für die Cannabisentkriminalisierung

    • name22
    • 15. Januar 2011 um 16:35

    Über das verbieten von Alkohol, Zigaretten und co. brauchen wir hier doch gar nicht reden. Ich halte ein absolutes Alkohol/Zigaretten Verbot in der nahen Zukunft für so gut wie unmöglich. Außerdem ist das hier eines der Themen über die man ewig lange weiter diskutieren kann, wie z.B. "Was ist die beste Programmiersprache?", "Was ist das beste Betriebssystem?", "Was ist der beste ActionFilm?". Es gibt einach viel zu viele Ausnahmen und Umstände zu beachten und persönliche Vorlieben machen eine neutrale Beurteilung sehr schwer...

  • Blackjack

    • name22
    • 15. Januar 2011 um 16:23

    Ich hatte keine Ahnung was ich machen sollte, also habe ich einfach willkürlich irgendwelche Buttons gedrückt. Dann hat mir Windows gemeldet, dass die game.exe nicht mehr funktioniert. :)

  • Blackjack

    • name22
    • 15. Januar 2011 um 15:45

    Mit Arrays und ein wenig übersichtlicher Programmierung wäre das ganze bestimmt um einiges kürzer ;). Aber abgesehen von gelegentlichen Abstürzen funktioniert das ja schon ganz fut :whistling: .

  • Jpg zu ico

    • name22
    • 15. Januar 2011 um 15:13

    Ich hab hier mal ein kleines Beispiel mit einer Funktion aus dem englischen Forum gebastelt.

    Spoiler anzeigen
    [autoit]

    #include <WinAPI.au3>
    #include <GDIPlus.au3>

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

    _GDIPlus_Startup()

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

    $hBitmap = _GDIPlus_BitmapCreateFromFile(FileOpenDialog("Bild auswählen", @UserProfileDir, "Bilder (*.*)"))
    $hIcon = _GDIPlus_HICONCreateFromBitmap($hBitmap)

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

    _CreateIconFileFromHICON($hIcon, StringRegExpReplace(FileSaveDialog("Speichern unter", @ScriptDir, "Icons (*.ico)"), "(?:.*)(\..*\b)", ".ico"))

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

    _WinAPI_DestroyIcon($hIcon)
    _GDIPlus_BitmapDispose($hBitmap)
    _GDIPlus_Shutdown()

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

    Func _CreateIconFileFromHICON($HICON, $sOutIcon)
    Local $aInfo, $sIco, $sBmp, $hCDC, $tBI, $tBits, $iSz, $sBD, $FO

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

    ; Start of single icon Header 3 x 2 bytes = 6 bytes: 0000 Reserved / 0100 icon / 0100 Numer of icons, total length will be 22 bytes for a single icon when finished
    $sIco = "0x000001000100"

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

    ; Start of the Bitmap data header 1 x 4bytes: length of the header will be 40 bytes when finished. Will be appended to the end of the icon header when finished
    $sBmp = "28000000"

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

    ; Get info about the HICON, this is mainly to get the pointers to the Color/Mask bitmaps data
    $aInfo = _WinAPI_GetIconInfo($HICON)

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

    ; create a memory Compatable DC
    $hCDC = _WinAPI_CreateCompatibleDC(0)

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

    ; create a BITMAPINFO Struct to store the Bitmap Info, it needs to be inilialized by setting the struct size.
    $tBI = DllStructCreate($tagBITMAPINFO)
    DllStructSetData($tBI, "Size", DllStructGetSize($tBI))

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

    ; Pass a bitmap data pointer to the BITMAPINFO struct so we can recieve the details of the color bitmap data, we use it to write the headers
    _WinAPI_GetDIBits($hCDC, $aInfo[5], 0, 0, 0, DllStructGetPtr($tBI), 0)

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

    ; Now we have some the basic info to add to the icon & Bitmap header so we'll add that to the headers.
    $sIco &= Hex(DllStructGetData($tBI, "Width"), 2) & Hex(DllStructGetData($tBI, "Height"), 2) & "00000100" & _RB(Hex(DllStructGetData($tBI, "BitCount"), 4))
    $sBmp &= _RB(Hex(DllStructGetData($tBI, "Width"))) & _RB(Hex(DllStructGetData($tBI, "Height") * 2)) & "0100" & _RB(Hex(DllStructGetData($tBI, "BitCount"), 4)) & "00000000"

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

    ; Get the size of the Bitmap data from the BITMAPINFO Struct, we'll use this in the headers further on.
    $iSz = DllStructGetData($tBI, "SizeImage")

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

    ; create a struct to store the Bitmap data Bits of the first bitmap, reset the BITMAPINFO struct
    $tBits = DllStructCreate("byte[" & DllStructGetData($tBI, "SizeImage") & "]")

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

    ; Get the color bitmap dib bits into the $tBits struct.
    DllCall('gdi32.dll', 'int', 'GetBitmapBits', 'ptr', $aInfo[5], 'int', $iSz, 'ptr', DllStructGetPtr($tBits))

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

    ; Get GetBitmapBits returns Bottom to Top dib, so I turn it to Top to Bottom dib ;)
    ; ATM I'm only assuming that GetBitmapBits returns a Bottom to Top dib, maybe the bitmap bits you use could be Top Down already?.
    For $i = DllStructGetData($tBI, "SizeImage") + 1 To 0 Step -(DllStructGetData($tBI, "SizeImage") / DllStructGetData($tBI, "Height"))
    $sBD &= StringTrimLeft(BinaryMid(DllStructGetData($tBits, 1), $i, (DllStructGetData($tBI, "SizeImage") / DllStructGetData($tBI, "Height"))), 2)
    Next

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

    ;Clear the BITMAPINFO & $tBits Struct as we'll use the same variables again for the mask bitmap data
    $tBits = 0
    $tBI = 0

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

    ; create a BITMAPINFO Struct to store the Bitmap Info again, it needs to be inilialized by setting the struct size.
    $tBI = DllStructCreate($tagBITMAPINFO)
    DllStructSetData($tBI, "Size", DllStructGetSize($tBI))

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

    ; Pass a bitmap data pointer to the BITMAPINFO struct so we can recieve the details of the bitmask bitmap data
    _WinAPI_GetDIBits($hCDC, $aInfo[4], 0, 0, 0, DllStructGetPtr($tBI), 0)

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

    ; We've finished with the Compatable DC, delete it.
    _WinAPI_DeleteDC($hCDC)

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

    ; Add the size of the of the color + bitmask bitmap data as we need this for both the icon & Bitmap header
    $iSz += DllStructGetData($tBI, "SizeImage")

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

    ; combine the bitmap data size with the bitmap header, I'm padding the rest of the 40 byte bitmap header with 0's., that's the Bitmap header done
    $sBmp &= _RB(Hex($iSz)) & "00000000000000000000000000000000"

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

    ; Now add the size of the Bitmap data + bitmap header size and combine the icon header together with the bitmap header and color bitmap data
    $sIco &= _RB(Hex($iSz + 40)) & _RB(Hex("22")) & $sBmp & $sBD

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

    ; create a struct to store the Bitmap dib Bits of the mask bitmap
    $tBits = DllStructCreate("byte[" & DllStructGetData($tBI, "SizeImage") & "]")

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

    ; Get the mask bitmap dib bits into the $tBits struct.
    DllCall('gdi32.dll', 'int', 'GetBitmapBits', 'ptr', $aInfo[4], 'int', DllStructGetData($tBI, "SizeImage"), 'ptr', DllStructGetPtr($tBits))

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

    ; Get GetBitmapBits returns Bottom to Top dib, so I turn it to a Top to Bottom dib and append the mask bitmap data to the icon
    For $i = DllStructGetData($tBI, "SizeImage") + 1 To 0 Step -(DllStructGetData($tBI, "SizeImage") / DllStructGetData($tBI, "Height"))
    $sIco &= StringTrimLeft(BinaryMid(DllStructGetData($tBits, 1), $i, (DllStructGetData($tBI, "SizeImage") / DllStructGetData($tBI, "Height"))), 2)
    Next

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

    ; Write the icon to a file.
    $FO = FileOpen($sOutIcon, 18)
    FileWrite($sOutIcon, Binary($sIco))
    FileClose($FO)

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

    ; Clear the structs
    $tBits = 0
    $tBI = 0
    EndFunc ;==>_CreateIconFileFromHICON

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

    ; Reverse Byte String
    Func _RB($sByte)
    Local $aX = StringRegExp($sByte, "(.{2})", 3), $sX = ''
    For $i = UBound($aX) - 1 To 0 Step -1
    $sX &= $aX[$i]
    Next
    Return $sX
    EndFunc ;==>_RB

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

    Func _GDIPlus_HICONCreateFromBitmap($hBitmap)
    Local $HICON

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

    $HICON = DllCall($ghGDIPDll, "int", "GdipCreateHICONFromBitmap", "hwnd", $hBitmap, "int*", 0)
    If @error Then Return SetError(@error, 0, -1)
    Return SetError($HICON[0], 0, $HICON[2])
    EndFunc ;==>_GDIPlus_BitmapCreateHICONFromBitmap

    [/autoit]


    Funktioniert bei mir problemlos. :)

  • außerhalb von GUI Quadrate zeichnen

    • name22
    • 15. Januar 2011 um 11:35
    Zitat

    Was muss ich machen, damit es dauerhaft eingeblendet wird ?


    Entweder die Methode aus meinem Beispiel verwenden, oder das Quadrat kontinuierlich neu zeichnen ;).

  • außerhalb von GUI Quadrate zeichnen

    • name22
    • 15. Januar 2011 um 00:31

    Da gibt es mehrere Möglichkeiten, die aber nicht ganz einfach zu verstehen sind. Hier mal ein Beispiel.

  • Wildcard Befehle

    • name22
    • 14. Januar 2011 um 18:53

    Du musst 2 Suchdurchgänge machen, danach kannst du dann beide Arrays zusammenfassen ;).

  • bilder mit Tranparenzem hintergrund

    • name22
    • 13. Januar 2011 um 17:36

    Das hättest du auch im ersten Beitrag sagen können... Für ein Spiel empfiehlt es sich natürlich GDI+ zu verwenden. Normale GUI Controls sind dafür einfach nicht gedacht ;).
    Ich empfehle dir das Tutorial von Ubuntu durchzulesen.

  • bilder mit Tranparenzem hintergrund

    • name22
    • 13. Januar 2011 um 16:30

    Ich habe irgendwie das Gefühl, dass ich ignoriert werde... Was gefällt dir den an meinem Post nicht? Ist es dir zu aufwendig den Link anzuklicken?

  • bilder mit Tranparenzem hintergrund

    • name22
    • 13. Januar 2011 um 15:26

    Nimm SEuBo's Funktion aus diesem Post. ;)

  • Beep

    • name22
    • 13. Januar 2011 um 15:20

    Basic Input Output System. Google oder Wikipedia benutzen ;).

  • Beep

    • name22
    • 13. Januar 2011 um 15:15

    Vielleicht hast du keinen Systemlautsprecher... Über die Forensuche habe ich zumindest das hier gefunden.

  • Client Position eines Fensters

    • name22
    • 13. Januar 2011 um 15:10

    Und ich dachte, ich hätte alle _WinAPI Funktionen gesehen :D . Vor einem Monat hätte ich diese Funktion wirklich gebrauchen können... Naja wenigstens muss man bei meiner Funktion nicht erst ein DllStruct erstellen. ;)

  • Client Position eines Fensters

    • name22
    • 13. Januar 2011 um 14:18

    Das rot umrahmte ist die Arbeitsgläche des Fensters
    Der Inhalt kann nicht angezeigt werden, da er nicht mehr verfügbar ist.

    Bilder

    • Aufzeichnen.PNG
      • 23,08 kB
      • 227 × 139

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™