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

Beiträge von eukalyptus

  • Kann das ein Virus sein?

    • eukalyptus
    • 11. November 2011 um 10:15

    Einer der beiden Ram Module ist fehlerhaft! Das erklärt mal die Bluescreens und evtl. das fehlerhafte starten von Comodo Firewall.

    Dass Antivir jedoch "deaktiviert" startete und sich auch nicht aktivieren ließ, und bei einem Update meldete, dass ein CRC-Check eines Modules nicht passt und es möglicherweise von einem Virus verändert wurde, könnte tatsächlich von einem Virus verursacht worden sein - welcher auch nach dem ersten ReImage weg war.

    Waren halt dummerweise 2 Sachen gleichzeitig, also Ramspeicher defekt und ein "normaler" Virus... - hoffentlich ;)

  • Win7 Spezielle Konfiguration - Hilfe

    • eukalyptus
    • 11. November 2011 um 10:06

    Bei Windows 7 Home gibts das leider nicht, man muss alles manuell einstellen.
    Oder gibt es vielleicht ein Freeware-Tool, bei dem man das auch einstellen kann?

  • Kann das ein Virus sein?

    • eukalyptus
    • 11. November 2011 um 09:45

    Scheiße! Grad wieder Bluescreen und MemTest findet tatsächlich Fehler im Speicher :(
    Werd mal schauen, ob ich mehrere RamRiegel hab, damit ich mal einen davon ausbauen kann...

  • Kann das ein Virus sein?

    • eukalyptus
    • 11. November 2011 um 09:19

    Hi

    Hab grad Probleme mit meinem Laptop.
    Ich beschreibe mal, was so alles passiert ist bzw. was ich gemacht hab...

    Vorgestern stoppte der Laptop beim Bootvorgang einmal im Dual-Boot-Menü (WinXP & Win7)
    und dann noch einmal während des Ladebalkens beim Starten von XP.
    Das kam mir zwar etwas seltsam vor, hab mir aber noch nichts ernstes dabei gedacht.

    Heute morgen verabschiedete sich WinXP mit einem Bluescreen.
    Ich hab dann mal das Netzwerkkabel abgezogen und neu gestartet.
    Antivir startete im "deaktivierten Modus" und Comodo Firewall meldete einen Fehler

    Ich wollte mit HiJackThis einen Scan machen -> Bluescreen!

    Glücklicherweise hab ich von den Systempartitionen von XP und Win7 Images, welche ich via Norton Ghost raufgespielt hab.
    Beim neuerlichen booten starteten AntiVir und Comodo wieder normal - allerdings hatte ich bald wieder einen Bluescreen!
    Ich dachte in diesem Moment an einen Hardwaredefekt, denn auch Win7 verabschiedete sich beim Starten...
    Nochmals XP booten - Antivir manuell updaten (Update auf einem anderen Rechner runtergeladen) - AntiVir meldet, dass irgendein Modul geändert wurde, möglicherweise ein Virus...

    Nun hab ich zuerst das Bios neu geflasht, dann die beiden Images wieder raufgezogen - jetzt scheint wieder alles gut zu laufen...
    Momentan mache ich einen kompletten Scan mit einem geupdateten Antivir

    Wenn es ein Virus war, dann konnte der doch nur im Bios sitzen!?
    Denn beim Imageraufspielen wird doch die ganze Partition überschrieben, incl. Bootsektoren, oder?
    Kann ein Virus überhaupt vom Bios aus agieren, bzw. wie geht das?

    Befindet sich der Schadcode vielleicht auf einer "freien" Stelle meiner Festplatte, welche auch von Norton Ghost nicht überschrieben wird?

    Ich hoffe, dass mein System jetzt wieder einwandfrei läuft!

    thx
    E

  • Win7 Spezielle Konfiguration - Hilfe

    • eukalyptus
    • 11. November 2011 um 08:43

    Das gefällt mir schon mal!

    Wenn der Taskmanager gesperrt ist, hat der User sonst noch irgeneine Möglichkeit etwas "falsches" zu machen?
    Gibt es vielleicht eine Tastenkombination, welche Explorer.exe startet oder sowas?

    thx
    E

  • Win7 Spezielle Konfiguration - Hilfe

    • eukalyptus
    • 10. November 2011 um 09:58

    Ich kenne mich mit Win7 noch nicht richtig aus und benötige daher eure Hilfe für die Konfiguration eines Laptops, welcher folgendermassen funktionieren soll:

    Beim Einschalten startet automatisch meine eigene Software statt der Explorershell.
    Alle Anschlüsse sind deaktiviert, also WLAN, LAN, Flashdrive, USB, Bluetooth usw... sollen nicht funktionieren.
    Jedoch darf der User am USB ein Midi-Interface anschließen und soll auch den Treiber dafür installieren dürfen (evtl. geht das auch nur über den Admin-Account)
    Taskmanager soll deaktiviert sein, aber ein Admin soll trotzdem zum Admin-Account wechseln bzw. in speziellen Fällen auch die normale Explorershell starten können.

    Mein Plan sieht bisher so aus:
    Ich erstelle einen passwortgeschützen Admin-Account und einen ungeschützten User-Account.
    Via den Registry Einträgen:

    Code
    Current_User\Software\Microsoft\CurrentVersion\WinLogon Shell = Software.exe
    Local_Machine\Software\Microsoft\CurrentVersion\WinLogon AutoAdminLogon = 1
    Local_Machine\Software\Microsoft\CurrentVersion\WinLogon DefaultUserName = User


    startet automatisch der Useraccount mit Software.exe als Shellersatz

    Wie deaktiviere ich nun den Taskmanager?
    Ich könnte in Software.exe alle Tastatureingaben mit Keyboard_ll-Hook blockieren und nur mittels spezieller Tastenfolge freigeben...
    Oder gibt es da eine elegantere Lösung?

    Wie deaktiviere ich alle Schnittstellen, mit Ausnahme des Midiinterfaces und einer Maus am USB Port?
    Geht das in Win7 (Home Premium) ganz elegant, oder soll ich das via AutoItscript und WMI machen?
    Wenn WMI, wie?

    Wie soll der User einen Treiber für ein neues Midi-Interface installieren können?
    Dazu müsste der User kurzfristig einen USB-Stick verwenden können, bzw. auch über Admin-Rechte verfügen?!
    Oder kann ein Admin über seinen Account diesen Treiber für den User-Account installieren?

    Hoffe, ihr könnt mir etwas weiterhelfen - Danke
    E

  • Pixelfläche in "Raster" unterteilen

    • eukalyptus
    • 2. November 2011 um 13:34

    Korrekt :thumbup:

  • Pixelfläche in "Raster" unterteilen

    • eukalyptus
    • 2. November 2011 um 13:12

    Na, welche Werte werden das wohl sein?... :D

  • Pixelfläche in "Raster" unterteilen

    • eukalyptus
    • 2. November 2011 um 12:25

    Hier bitte:

    Spoiler anzeigen
    [autoit]

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

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

    _Create(@ScriptDir & "\Test.emf", 200, 30)

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

    Func _Create($sFileName, $fS, $fH)
    Local Const $PI = ATan(1) * 4 ; Konstante PI = 3.14159265358979
    Local Const $Deg2Rad = $PI / 180 ; zum Umrechnen von Grad zu Bogenmaß
    Local Const $Rad2Deg = 180 / $PI

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

    Local $fTmp = Sqrt($fH ^ 2 + $fS ^ 2 / 4) ;siehe: http://www.arndt-bruenner.de/mathe/scripts/kreissehnen.htm
    Local $fBeta = 2 * ASin($fS / (2 * $fTmp))
    Local $fAlpha = 2 * ($PI - $fBeta) ; Öffnungswinkel des Kreisbogens
    Local $fR = $fS / (2 * Sin($fAlpha / 2)) ; Radius
    Local $fH2 = $fR - $fH ; Mittelpunkt zu Kreissehne

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

    _GDIPlus_Startup() ; Gdiplus DLL laden
    Local $hDC = _WinAPI_GetDC(_WinAPI_GetDesktopWindow()) ;DeviceContext des Bildschirms bekommen

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

    Local $tRectF = _GDIPlus_RectFCreate(0, 0, $fR * 2, $fR * 2) ;Rechteck erzeugen, welches den Kreis umschliesst; deshalb 0 - Radius * 2; das könnten auch A4-Masse sein...

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

    ;Metafile aus DeviceContext erzeugen, Typ = EMF+, Masse des Rechtecks = mm
    Local $aResult = DllCall($ghGDIPDll, "uint", "GdipRecordMetafileFileName", "wstr", $sFileName, "hwnd", $hDC, "int", 5, "ptr", DllStructGetPtr($tRectF), "int", 6, "wstr", "KreisSegment", "int*", 0)
    Local $hImage = $aResult[7]

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

    Local $hContext = _GDIPlus_ImageGetGraphicsContext($hImage) ;GraphicContext vom Metafile bekommen (um darauf zu zeichnen)
    DllCall($ghGDIPDll, "uint", "GdipSetPageUnit", "hwnd", $hContext, "int", 6) ; Einheit auf mm setzen

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

    ;Speicher reservieren, um Headerinformationen auszulesen; wir benötigen später die DPI-Auflösung
    Local $tHeader = DllStructCreate("int Type;" & _
    "uint Size;" & _ ; Size of the metafile (in bytes)
    "uint Version;" & _ ; EMF+, EMF, or WMF version
    "uint EmfPlusFlags;" & _
    "float DpiX;" & _
    "float DpiY;" & _
    "int X;" & _ ; Bounds in device units
    "int Y;" & _
    "int Width;" & _
    "int Height;" & _
    "uint Type;" & _ ; Record type EMR_HEADER
    "uint Size;" & _ ; Record size in bytes. This may be greater than the sizeof $tagGDIPMETAHEADER
    "int BoundLeft;" & _ ; Inclusive-inclusive bounds in device units
    "int BoundTop;" & _
    "int BoundRight;" & _
    "int BoundBottom;" & _
    "int FrameLeft;" & _ ; Inclusive-inclusive Picture Frame .01mm unit
    "int FrameTop;" & _
    "int FrameRight;" & _
    "int FrameBottom;" & _
    "uint Signature;" & _ ; Signature. Must be $GDIP_ENHMETA_SIGNATURE
    "uint Version;" & _ ; Version number
    "uint Bytes;" & _ ; Size of the metafile in bytes
    "uint Records;" & _ ; Number of records in the metafile
    "ushort Handles;" & _ ; Number of handles in the handle table. Handle index zero is reserved
    "ushort Reserved;" & _ ; Reserved. Must be zero
    "uint DescriptionChars;" & _ ; Number of chars in the unicode desc string This is 0 if there is no description string
    "uint DescriptionOffset;" & _ ; Offset to the metafile description record. This is 0 if there is no description string
    "uint PalEntries;" & _ ; Number of entries in the metafile palette
    "int cxPixels;" & _ ; Size of the reference device in pixels
    "int cyPixels;" & _
    "int cxMillimeters;" & _; Size of the reference device in millimeters
    "int cyMillimeters;" & _
    "int EmfPlusHeaderSize;" & _ ; size of the EMF+ header in file
    "int LogicalDpiX;" & _ ; Logical Dpi of reference Hdc
    "int LogicalDpiY;") ; usually valid only for EMF+

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

    DllCall($ghGDIPDll, "uint", "GdipGetMetafileHeaderFromMetafile", "hwnd", $hImage, "ptr", DllStructGetPtr($tHeader)); Headerinformationen auslesen

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

    Local $fM_DpiX = DllStructGetData($tHeader, "DpiX") ; Auflösung in DPI horizontal vom Metafile
    Local $fM_DpiY = DllStructGetData($tHeader, "DpiY") ; Auflösung in DPI vertikal vom Metafile

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

    $aResult = DllCall($ghGDIPDll, "uint", "GdipGetDpiX", "hwnd", $hContext, "float*", 0) ; Auflösung in DPI horizontal vom GraphicContext
    Local $fG_DpiX = $aResult[2]
    $aResult = DllCall($ghGDIPDll, "uint", "GdipGetDpiY", "hwnd", $hContext, "float*", 0) ; Auflösung in DPI vertikal vom GraphicContext
    Local $fG_DpiY = $aResult[2]

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

    ;GraphicContext skalieren, damit die Grafik wirklich in mm ist - das sollte eigentlich nicht notwendig sein!?
    ;Jedoch hat das fertige EMF nur so die richtige Größe in IncScape...
    DllCall($ghGDIPDll, "uint", "GdipScaleWorldTransform", "hwnd", $hContext, "float", $fM_DpiX / $fG_DpiX, "float", $fM_DpiY / $fG_DpiY, "int", 0)

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

    Local $hPen_1 = _GDIPlus_PenCreate(0xFFFF0000, 2) ; Pinsel Rot Stärke = 2
    Local $hPen_2 = _GDIPlus_PenCreate(0xFF00FF00, 2) ; Pinsel Grün Stärke = 2
    Local $hPen_3 = _GDIPlus_PenCreate(0xFF0000FF, 1) ; Pinsel Blau Stärke = 1

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

    DllCall($ghGDIPDll, "int", "GdipDrawArc", "handle", $hContext, "handle", $hPen_1, "float", 0, "float", 0, _
    "float", $fR * 2, "float", $fR * 2, "float", 270 - ($fAlpha * $Rad2Deg) / 2, "float", $fAlpha * $Rad2Deg) ;Kreisbogen des Segments in Rot zeichnen

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

    DllCall($ghGDIPDll, "int", "GdipDrawLine", "handle", $hContext, "handle", $hPen_2, "float", $fR - $fS / 2, "float", $fH, _
    "float", $fR + $fS / 2, "float", $fH) ;Kreissehne in Grün zeichnen

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

    DllCall($ghGDIPDll, "int", "GdipDrawArc", "handle", $hContext, "handle", $hPen_3, "float", 0, "float", 0, _
    "float", $fR * 2, "float", $fR * 2, "float", 270 + ($fAlpha * $Rad2Deg) / 2, "float", 360 - ($fAlpha * $Rad2Deg)) ; restlicher Kreisbogen in Blau

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

    _GDIPlus_PenDispose($hPen_1) ; Pinsel im Speicher wieder freigeben
    _GDIPlus_PenDispose($hPen_2)
    _GDIPlus_PenDispose($hPen_3)
    _GDIPlus_GraphicsDispose($hContext) ; Metafile abschliesen und speichern

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

    _GDIPlus_ImageDispose($hImage) ; Metafile aus Speicher löschen
    _WinAPI_ReleaseDC(_WinAPI_GetDesktopWindow(), $hDC) ;DeviceContext freigeben
    _GDIPlus_Shutdown() ;GdiPlus DLL schließen
    EndFunc ;==>_Create

    [/autoit]
  • Pixelfläche in "Raster" unterteilen

    • eukalyptus
    • 2. November 2011 um 10:54

    Oder erstelle mit GDI+ eine Metafile
    EMF lassen sich sicher mit AI öffnen

    Spoiler anzeigen
    [autoit]

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

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

    _Create(@ScriptDir & "\Test.emf", 200, 30)

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

    Func _Create($sFileName, $fS, $fH)
    Local Const $PI = ATan(1) * 4
    Local Const $Deg2Rad = $PI / 180
    Local Const $Rad2Deg = 180 / $PI

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

    Local $fTmp = Sqrt($fH ^ 2 + $fS ^ 2 / 4)
    Local $fBeta = 2 * ASin($fS / (2 * $fTmp))
    Local $fAlpha = 2 * ($PI - $fBeta)
    Local $fR = $fS / (2 * Sin($fAlpha / 2))
    Local $fH2 = $fR - $fH

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

    _GDIPlus_Startup()
    Local $hDC = _WinAPI_GetDC(_WinAPI_GetDesktopWindow())

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

    Local $tRectF = _GDIPlus_RectFCreate(0, 0, $fR * 2, $fR * 2)
    Local $aResult = DllCall($ghGDIPDll, "uint", "GdipRecordMetafileFileName", "wstr", $sFileName, "hwnd", $hDC, "int", 5, "ptr", DllStructGetPtr($tRectF), "int", 6, "wstr", "KreisSegment", "int*", 0)
    Local $hImage = $aResult[7]
    Local $hContext = _GDIPlus_ImageGetGraphicsContext($hImage)
    DllCall($ghGDIPDll, "uint", "GdipSetPageUnit", "hwnd", $hContext, "int", 6)

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

    Local $tHeader = DllStructCreate("int Type;" & _
    "uint Size;" & _ ; Size of the metafile (in bytes)
    "uint Version;" & _ ; EMF+, EMF, or WMF version
    "uint EmfPlusFlags;" & _
    "float DpiX;" & _
    "float DpiY;" & _
    "int X;" & _ ; Bounds in device units
    "int Y;" & _
    "int Width;" & _
    "int Height;" & _
    "uint Type;" & _ ; Record type EMR_HEADER
    "uint Size;" & _ ; Record size in bytes. This may be greater than the sizeof $tagGDIPMETAHEADER
    "int BoundLeft;" & _ ; Inclusive-inclusive bounds in device units
    "int BoundTop;" & _
    "int BoundRight;" & _
    "int BoundBottom;" & _
    "int FrameLeft;" & _ ; Inclusive-inclusive Picture Frame .01mm unit
    "int FrameTop;" & _
    "int FrameRight;" & _
    "int FrameBottom;" & _
    "uint Signature;" & _ ; Signature. Must be $GDIP_ENHMETA_SIGNATURE
    "uint Version;" & _ ; Version number
    "uint Bytes;" & _ ; Size of the metafile in bytes
    "uint Records;" & _ ; Number of records in the metafile
    "ushort Handles;" & _ ; Number of handles in the handle table. Handle index zero is reserved
    "ushort Reserved;" & _ ; Reserved. Must be zero
    "uint DescriptionChars;" & _ ; Number of chars in the unicode desc string This is 0 if there is no description string
    "uint DescriptionOffset;" & _ ; Offset to the metafile description record. This is 0 if there is no description string
    "uint PalEntries;" & _ ; Number of entries in the metafile palette
    "int cxPixels;" & _ ; Size of the reference device in pixels
    "int cyPixels;" & _
    "int cxMillimeters;" & _; Size of the reference device in millimeters
    "int cyMillimeters;" & _
    "int EmfPlusHeaderSize;" & _ ; size of the EMF+ header in file
    "int LogicalDpiX;" & _ ; Logical Dpi of reference Hdc
    "int LogicalDpiY;") ; usually valid only for EMF+

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

    DllCall($ghGDIPDll, "uint", "GdipGetMetafileHeaderFromMetafile", "hwnd", $hImage, "ptr", DllStructGetPtr($tHeader))

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

    Local $fM_DpiX = DllStructGetData($tHeader, "DpiX")
    Local $fM_DpiY = DllStructGetData($tHeader, "DpiY")

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

    $aResult = DllCall($ghGDIPDll, "uint", "GdipGetDpiX", "hwnd", $hContext, "float*", 0)
    Local $fG_DpiX = $aResult[2]
    $aResult = DllCall($ghGDIPDll, "uint", "GdipGetDpiY", "hwnd", $hContext, "float*", 0)
    Local $fG_DpiY = $aResult[2]

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

    DllCall($ghGDIPDll, "uint", "GdipScaleWorldTransform", "hwnd", $hContext, "float", $fM_DpiX / $fG_DpiX, "float", $fM_DpiY / $fG_DpiY, "int", 0)

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

    Local $hPen_1 = _GDIPlus_PenCreate(0xFFFF0000, 2)
    Local $hPen_2 = _GDIPlus_PenCreate(0xFF00FF00, 2)
    Local $hPen_3 = _GDIPlus_PenCreate(0xFF0000FF, 1)

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

    DllCall($ghGDIPDll, "int", "GdipDrawArc", "handle", $hContext, "handle", $hPen_1, "float", 0, "float", 0, _
    "float", $fR * 2, "float", $fR * 2, "float", 270 - ($fAlpha * $Rad2Deg) / 2, "float", $fAlpha * $Rad2Deg)

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

    DllCall($ghGDIPDll, "int", "GdipDrawLine", "handle", $hContext, "handle", $hPen_2, "float", $fR - $fS / 2, "float", $fH, _
    "float", $fR + $fS / 2, "float", $fH)

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

    DllCall($ghGDIPDll, "int", "GdipDrawArc", "handle", $hContext, "handle", $hPen_3, "float", 0, "float", 0, _
    "float", $fR * 2, "float", $fR * 2, "float", 270 + ($fAlpha * $Rad2Deg) / 2, "float", 360 - ($fAlpha * $Rad2Deg))

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

    _GDIPlus_PenDispose($hPen_1)
    _GDIPlus_PenDispose($hPen_2)
    _GDIPlus_PenDispose($hPen_3)
    _GDIPlus_GraphicsDispose($hContext)

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

    _GDIPlus_ImageDispose($hImage)
    _WinAPI_ReleaseDC(_WinAPI_GetDesktopWindow(), $hDC)
    _GDIPlus_Shutdown()
    EndFunc ;==>_Create

    [/autoit]
  • Dateihashen Prozessanzeige

    • eukalyptus
    • 14. Oktober 2011 um 11:43

    Welches Tool ist das?
    bzw. hat das Tool selber eine %-Anzeige, welche man auslesen könnte? zB StdOut

  • Tray Icon Menü und Normale Button zu gleich abfragen

    • eukalyptus
    • 13. Oktober 2011 um 20:50

    lösche mal die Zeilen 45 und 55 aus deinem Script...

  • Case abfrage bei unbekannten vielen controls

    • eukalyptus
    • 13. Oktober 2011 um 20:48

    OK ein sehr minimalistisches Beispiel:

    Spoiler anzeigen
    [autoit]

    #include <File.au3>
    #include <GUIConstantsEx.au3>

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

    Opt("GUIOnEventMode", 1)

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

    $hGui = GUICreate("Test")
    GUISetOnEvent($GUI_EVENT_CLOSE, "_Exit")
    GUISetState()

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

    $aFiles = _FileListToArray(@ScriptDir, "*.gif")
    $cDummy1 = GUICtrlCreateDummy()
    For $i = 1 To $aFiles[0]
    GUICtrlCreatePic($aFiles[$i], 10, ($i - 1) * 40 + 10, 30, 30)
    GUICtrlSetOnEvent(-1, "_Click")
    Next
    $cDummy2 = GUICtrlCreateDummy()

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

    While Sleep(100)
    WEnd

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

    Func _Click()
    If @GUI_CtrlId > $cDummy1 And @GUI_CtrlId < $cDummy2 Then
    MsgBox(0, "", "Bild Nr.: " & @GUI_CtrlId - $cDummy1 & " wurde geklickt")
    EndIf
    EndFunc ;==>_Click

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

    Func _Exit()
    Exit
    EndFunc ;==>_Exit

    [/autoit]

    Umsetzen musst du das nun schon selber :D

    E

  • Tray Icon Menü und Normale Button zu gleich abfragen

    • eukalyptus
    • 13. Oktober 2011 um 20:33

    Du musst die innere While-Schleife ausklammern, also Zeile 45 u 55 löschen.

    Schau dir aber mal die Beispiele zu TraySetOnEvent, TrayItemSetOnEvent, GUISetOnEvent und GUICtrlSetOnEvent an

    E

  • Case abfrage bei unbekannten vielen controls

    • eukalyptus
    • 13. Oktober 2011 um 20:23

    Hi

    Hab den Code schnell überflogen.
    Ich würde es so machen:

    1 GuiOnEventModus verwenden
    2 vor und nach der Schleife, in der die BilderControls erzeugt werden, ein Dummycontrol erstellen.
    3 in der OnEventClick-Funktion überprüfen, ob der Wert von @GUI_CtrlId größer als das erste Dummy und kleiner als das zweite Dummy ist.
    durch @GUI_CtrlId - Dummy1 kannst du ausrechnen, welches Bild geklickt wurde...

    ist das verständlich? ;)

    E

  • Mouseover und Buttonklicks in der selben Loop

    • eukalyptus
    • 13. Oktober 2011 um 20:14

    Hier ein Ansatz:

    Spoiler anzeigen
    [autoit]

    #include <GUIConstantsEx.au3>
    #include "GUICtrlOnHover.au3"

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

    Opt("GUIOnEventMode", 1)

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

    $hGui = GUICreate("Test")
    GUISetOnEvent($GUI_EVENT_CLOSE, "_Exit")

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

    Global $aButtons[1] = [0]

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

    _CreateButton("Test 1", 10, 10, 80, 20)
    _CreateButton("Test 2", 10, 40, 80, 20)

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

    GUISetState()

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

    While Sleep(100)
    WEnd

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

    Func _CreateButton($sText, $iX, $iY, $iW, $iH)
    Local $iIndex = $aButtons[0] + 1
    ReDim $aButtons[$iIndex + 1]
    $aButtons[0] = $iIndex
    $aButtons[$iIndex] = GUICtrlCreateButton($sText, $iX, $iY, $iW, $iH)
    GUICtrlSetOnEvent($aButtons[$iIndex], "_Click")
    _GUICtrl_OnHoverRegister($aButtons[$iIndex], "_MouseOver", "_MouseLeave")
    GUICtrlCreateLabel("", $iX + $iW + 10, $iY, 20, 20)
    GUICtrlSetBkColor(-1, 0xFF0000)
    EndFunc ;==>_CreateButton

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

    Func _Click()
    Switch @GUI_CtrlId
    Case $aButtons[1]
    MsgBox(0, "", "Button 1")
    Case $aButtons[2]
    MsgBox(0, "", "Button 2")
    EndSwitch
    EndFunc ;==>_Click

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

    Func _MouseOver($iCtrlID)
    GUICtrlSetBkColor($iCtrlID + 1, 0x00FF00)
    EndFunc ;==>_MouseOver

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

    Func _MouseLeave($iCtrlID)
    GUICtrlSetBkColor($iCtrlID + 1, 0xFF0000)
    EndFunc ;==>_MouseLeave

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

    Func _Exit()
    Exit
    EndFunc ;==>_Exit

    [/autoit]

    UDF steht für "User defined functions" und ist eine AutoItScript-Datei, die zusätzliche Funktionen enthält.
    Alles, was am Scriptanfang so eingebunden wird:

    [autoit]

    #include "GUICtrlOnHover.au3"

    [/autoit]

    nennt sich UDF

    E

  • Mouseover und Buttonklicks in der selben Loop

    • eukalyptus
    • 13. Oktober 2011 um 19:53

    Ich nehme an, du hast GuiCtrlSetOnEvent bei ein paar Buttons vergessen.
    Falls du den OnEvent-Modus verwenden möchtest, dann musst du auch die bisherigen GetMsg-Befehle rausnehmen.

    Wahrscheinlich hast du schon ein funktionierendes Script und willst nicht allzuviel ändern, deshalb probier doch mal diese UDF:
    http://www.autoitscript.com/forum/topic/55…post__p__417780
    Damit solltest du beim original Script mit wenigen Zeilen deine Wünsche umsetzen können

    schau dir am besten mal die Beispiele an, die im Ziparchiv dabei sind

    E

  • Mausbewegungsrichtung ändern

    • eukalyptus
    • 13. Oktober 2011 um 19:27

    Ich hab zwei Ansätze probiert.

    1: Normale Mausbewegungen blockieren und Cursor auf neue Position setzen.
    Das Problem ist, dass die Mausposition immer absolut ausgelesen wird und man dadurch an den Bildschirmrändern hängenbleibt, da esja keine negativen Koordinaten gibt.

    Spoiler anzeigen
    [autoit]

    #include <WinAPI.au3>
    #include <WindowsConstants.au3>

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

    HotKeySet("{ESC}", "_Exit")

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

    Global $hMouseProc = DllCallbackRegister("_MouseProc", "long", "int;wparam;lparam")
    Global $hMouseHook = _WinAPI_SetWindowsHookEx($WH_MOUSE_LL, DllCallbackGetPtr($hMouseProc), _WinAPI_GetModuleHandle(0))
    Global $tMousePos = DllStructCreate("int X; int Y;")
    DllCall("user32.dll", "bool", "GetCursorPos", "ptr", DllStructGetPtr($tMousePos))
    Global $iMouseX = DllStructGetData($tMousePos, "X")
    Global $iMouseY = DllStructGetData($tMousePos, "Y")
    OnAutoItExitRegister("_OnExit")

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

    While Sleep(10)
    WEnd

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

    Func _MouseProc($nCode, $wParam, $lParam)
    If $nCode < 0 Then Return _WinAPI_CallNextHookEx($hMouseHook, $nCode, $wParam, $lParam)

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

    Switch $wParam
    Case $WM_MOUSEMOVE
    Local $tStruct = DllStructCreate("int X;int Y;dword mouseData;dword flags;dword time;ulong_ptr dwExtraInfo", $lParam)
    If DllStructGetData($tStruct, "flags") = 0 Then
    $iMouseX += ($iMouseX - DllStructGetData($tStruct, 1))
    $iMouseY += ($iMouseY - DllStructGetData($tStruct, 2))
    DllCall("user32.dll", "bool", "SetCursorPos", "int", $iMouseX, "int", $iMouseY)
    Return 1
    EndIf
    EndSwitch

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

    Return _WinAPI_CallNextHookEx($hMouseHook, $nCode, $wParam, $lParam)
    EndFunc ;==>_MouseProc

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

    Func _Exit()
    Exit
    EndFunc ;==>_Exit

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

    Func _OnExit()
    _WinAPI_UnhookWindowsHookEx($hMouseHook)
    DllCallbackFree($hMouseProc)
    EndFunc ;==>_OnExit

    [/autoit]


    2: direkte Mausbewegungen werden wieder geblockt, aber generierte Mausbewegungen zugelassen
    Relative Mausbewegungen lassen sich via WM_INPUT auslesen und verändert generieren
    Das Problem hier ist, dass man z.B. keine Fenster verschieben kann!
    Man müsste in WM_INPUT alle Mausfunktionen erkennen und generieren, dann geht das evtl.
    Weiters setzt WM_INPUT ein GUI voraus...

    Spoiler anzeigen
    [autoit]

    #include <WinAPI.au3>
    #include <WindowsConstants.au3>

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

    Opt("GUIOnEventMode", 1)

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

    Global $hGui = GUICreate("Test")
    GUISetOnEvent(-3, "_Exit")
    GUIRegisterMsg(0x00FF, "WM_INPUT")
    GUISetState(@SW_SHOW, $hGui)

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

    Global $hMouseProc = DllCallbackRegister("_MouseProc", "long", "int;wparam;lparam")
    Global $hMouseHook = _WinAPI_SetWindowsHookEx($WH_MOUSE_LL, DllCallbackGetPtr($hMouseProc), _WinAPI_GetModuleHandle(0))

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

    Global $tMouse = DllStructCreate("dword dwType; dword dwSize; hwnd hDevice; uint_ptr wParam; ushort usFlags; ushort usButtonFlags; ushort usButtonData; ulong ulRawButtons; long lLastX; long lLastY; ulong ulExtraInformation;")
    Global $pMouse = DllStructGetPtr($tMouse)
    Global $iMouse = DllStructGetSize($tMouse)
    Global $tHeader = DllStructCreate("dword dwType; dword dwSize; hwnd hDevice; uint_ptr wParam;")
    Global $iHeader = DllStructGetSize($tHeader)
    _RegisterRawInput()

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

    OnAutoItExitRegister("_OnExit")

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

    While Sleep(10)
    WEnd

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

    Func _MouseProc($nCode, $wParam, $lParam)
    If $nCode < 0 Then Return _WinAPI_CallNextHookEx($hMouseHook, $nCode, $wParam, $lParam)

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

    Switch $wParam
    Case $WM_MOUSEMOVE
    Local $tStruct = DllStructCreate("int X;int Y;dword mouseData;dword flags;dword time;ulong_ptr dwExtraInfo", $lParam)
    If DllStructGetData($tStruct, "flags") = 0 Then
    Return 1
    EndIf
    EndSwitch

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

    Return _WinAPI_CallNextHookEx($hMouseHook, $nCode, $wParam, $lParam)
    EndFunc ;==>_MouseProc

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

    Func WM_INPUT($hWnd, $Msg, $wParam, $lParam)
    Local $aResult = DllCall("user32.dll", "dword", "GetRawInputData", "hwnd", $lParam, "dword", 0x10000003, "ptr", $pMouse, "dword*", $iMouse, "uint", $iHeader)
    If Not @error Then
    If DllStructGetData($tMouse, "hDevice") <> 0 Then
    DllCall("user32.dll", "none", "mouse_event", "DWORD", 0x0001, "DWORD", -DllStructGetData($tMouse, "lLastX"), "DWORD", -DllStructGetData($tMouse, "lLastY"), "DWORD", 0, "ULONG_PTR", 0)
    EndIf
    EndIf
    Return 'GUI_RUNDEFMSG'
    EndFunc ;==>WM_INPUT

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

    Func _RegisterRawInput()
    Local $tStruct = DllStructCreate("ushort usUsagePage; ushort usUsage; dword dwFlags; hwnd hwndTarget;")
    DllStructSetData($tStruct, "usUsagePage", 0x01)
    DllStructSetData($tStruct, "usUsage", 0x02)
    DllStructSetData($tStruct, "dwFlags", 0)
    DllStructSetData($tStruct, "hwndTarget", $hGui)
    Local $aResult = DllCall("user32.dll", "int", "RegisterRawInputDevices", "ptr", DllStructGetPtr($tStruct), "dword", 1, "dword", DllStructGetSize($tStruct))
    If @error Then Return SetError(1, 2, False)
    Return $aResult[0]
    EndFunc ;==>_RegisterRawInput

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

    Func _Exit()
    Exit
    EndFunc ;==>_Exit

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

    Func _OnExit()
    _WinAPI_UnhookWindowsHookEx($hMouseHook)
    DllCallbackFree($hMouseProc)
    EndFunc ;==>_OnExit

    [/autoit]


    Die zweite Variante würde ohne Probleme funktionieren, wenn Microsoft WM_INPUT vor WH_MOUSE_LL aufrufen würde!
    Das wurmt mich etwas, denn das hätte ich nämlich schon öfters benötigt!


    E

  • Mouseover und Buttonklicks in der selben Loop

    • eukalyptus
    • 13. Oktober 2011 um 18:13

    Ich empfehle den OnEvent-Modus:

    Spoiler anzeigen
    [autoit]

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

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

    $hGui = GUICreate("Test")
    GUISetOnEvent($GUI_EVENT_CLOSE, "_Exit")
    GUISetOnEvent($GUI_EVENT_MOUSEMOVE, "_MouseMove")

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

    $cButton1 = GUICtrlCreateButton("Test 1", 10, 10, 80, 20)
    GUICtrlSetOnEvent(-1, "_Click")
    $cLabel1 = GUICtrlCreateLabel("", 100, 10, 20, 20)

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

    $cButton2 = GUICtrlCreateButton("Test 2", 10, 40, 80, 20)
    GUICtrlSetOnEvent(-1, "_Click")
    $cLabel2 = GUICtrlCreateLabel("", 100, 40, 20, 20)
    GUISetState()

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

    While Sleep(100)
    WEnd

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

    Func _Click()
    Switch @GUI_CtrlId
    Case $cButton1
    MsgBox(0, "", "Button 1")
    Case $cButton2
    MsgBox(0, "", "Button 2")
    EndSwitch
    EndFunc ;==>_Click

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

    Func _MouseMove()
    Local $aInfo = GUIGetCursorInfo($hGui)

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

    GUICtrlSetBkColor($cLabel1, 0xFF0000)
    GUICtrlSetBkColor($cLabel2, 0xFF0000)

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

    Switch $aInfo[4]
    Case $cButton1
    GUICtrlSetBkColor($cLabel1, 0x00FF00)
    Case $cButton2
    GUICtrlSetBkColor($cLabel2, 0x00FF00)
    EndSwitch

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

    EndFunc ;==>_MouseMove

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

    Func _Exit()
    Exit
    EndFunc ;==>_Exit

    [/autoit]

    Um das evtl. Flackern noch abzustellen, müsste man noch etwas in die Trickkiste greifen ;)


    Alternativ dazu findest du im Forum die UDF "GuiCtrlSetOnHover" oder so ähnlich, damit sollte das auch funktionieren...

    E

  • GDI+ - Bild wird nicht angezeigt

    • eukalyptus
    • 11. Oktober 2011 um 18:49

    Du benötigst ein Fenster auf das du das Bild zeichnen kannst.
    Um das Bild "alleinstehend" zu bekommen, kannst du $WS_POPUP als Style angeben

    Spoiler anzeigen
    [autoit]

    #include <GDIPlus.au3>
    #include <GUIConstantsEx.au3>
    #include <WindowsConstants.au3>

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

    Opt("GUIOnEventMode", 1)

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

    _GDIPlus_Startup()
    $hImage = _GDIPlus_ImageLoadFromFile(@ScriptDir & '\chat_main_body.png')
    $iImgW = _GDIPlus_ImageGetWidth($hImage)
    $iImgH = _GDIPlus_ImageGetHeight($hImage)

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

    $hGui = GUICreate("", $iImgW, $iImgH, -1, -1, $WS_POPUP, $WS_EX_TOPMOST)
    GUISetOnEvent($GUI_EVENT_CLOSE, "_Exit")
    $hGraphics = _GDIPlus_GraphicsCreateFromHWND($hGui)

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

    GUIRegisterMsg($WM_PAINT, "WM_PAINT")
    GUIRegisterMsg($WM_ERASEBKGND, "WM_PAINT")
    GUISetState()

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

    While 1
    Sleep(100)
    WEnd

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

    Func WM_PAINT($hWnd, $uMsgm, $wParam, $lParam)
    _GDIPlus_GraphicsDrawImageRect($hGraphics, $hImage, 0, 0, $iImgW, $iImgH)
    Return $GUI_RUNDEFMSG
    EndFunc ;==>WM_PAINT

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

    Func _Exit()
    _GDIPlus_ImageDispose($hImage)
    _GDIPlus_GraphicsDispose($hGraphics)
    _GDIPlus_Shutdown()
    Exit
    EndFunc ;==>_Exit

    [/autoit]

    E

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™