Beiträge von DeepRed92
-
-
Ok. Danke, war aber nicht ganz was ich meinte. Also das mit dem kleiner werden war nicht auf das minimieren bezogten sondern eher auf das schließen eines Fensters. Wenn immer noch unklar ist, was ich meine erstelle ich auch gerne ein Beispiel

-
Guten Abend,
wenn ich das Fenster maximiere (das man nicht maximieren kann), flackert das Bildschirm kurz und es ist immer noch so wie vorher.

-
Hallo,
jeder der Vista hat kennt das (Aero). Schließt man z.B. das "Arbeitsplatz" - Fenster sozusagen kleiner und transparenter. Erstelle ich jetzt eine GUI mit AutoIt, muss ich die GUI mit GUIDelete löschen. Nur dann ist da dieser Effekt von Vista vorhanden. Versteckte ich aber das Fenster mit GUISetState ist das Fenster ohne irgendwelchen Effekten weg.
Gibt es da eine Funktion dafür, damit man dies auch bei GUISetState(@SW_Hide) aktivieren kann?
Danke

-
Ok ich hab mir mal die Mühe gemacht und ein recht simples Beispiel erstellt. Wie bekomme ich das Beispiel in der GUIOnEventMode hin?
Spoiler anzeigen
[autoit]#cs ----------------------------------------------------------------------------
[/autoit] [autoit][/autoit] [autoit]AutoIt Version: 3.3.2.0
[/autoit] [autoit][/autoit] [autoit]
Author: myNameScript Function:
[/autoit] [autoit][/autoit] [autoit]
Template AutoIt script.#ce ----------------------------------------------------------------------------
[/autoit] [autoit][/autoit] [autoit]; Script Start - Add your code below here
[/autoit] [autoit][/autoit] [autoit]#NoTrayIcon
[/autoit] [autoit][/autoit] [autoit]
#include <ModernMenuRaw.au3>
#include <GUIConstantsEx.au3>;~ Opt("GUIOnEventMode", 1)
[/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]$Form1 = GUICreate("Form1", 363, 250, 454, 319)
[/autoit] [autoit][/autoit] [autoit]
GUISetState(@SW_SHOW);Traymenu erstellen.
[/autoit] [autoit][/autoit] [autoit]
SetStandardColors()$TrayIcon_Handle = _TrayIconCreate("", "shell32.dll", -132, "_TrayDoubleClick")
[/autoit] [autoit][/autoit] [autoit]
_TrayIconSetClick(-1, 16)_TrayCreateContextMenu()
[/autoit] [autoit][/autoit] [autoit]$Traymenu_Item_Click = _TrayCreateItem("Klick mich!!!!!")
[/autoit] [autoit][/autoit] [autoit]
_TrayItemSetIcon($Traymenu_Item_Click, @AutoItExe)_TrayIconSetState()
[/autoit] [autoit][/autoit] [autoit]While 1
[/autoit]
$GetMsg = GUIGetMsg(1)
Switch $GetMsg[1]
Case $Form1
Switch $GetMsg[0]
Case $GUI_EVENT_CLOSE
_TrayIconDelete($TrayIcon_Handle)
Exit
EndSwitch
Case Else
Switch $GetMsg[0]
Case $Traymenu_Item_Click
MsgBox(0, "", "Wie geht das in der GUIOnEventMode???")
_TrayIconDelete($TrayIcon_Handle)
Exit
EndSwitch
EndSwitch
WEndEdit: Die ModernMenu.au3 ist in der Zip-Datei
-
Hallo,
kann man die UDF: "ModernMenu" auch mit der GUIOnEvent-Modus benutzen? Damit meine ich speziell die Traymenüs.
Wenn die Frage etwas unverständlich ist, kann ich auch einen Beispiel erstellen. Aber ich versucha mal ohne Beispiel
-
Listview klappt bei mir auch. Aber ich meinte die Scrollbars, die von der UDF erstellt worden sind. Das sind alle, die nicht zur ListView gehören.
-
Danke ich habs jetzt mal selber versucht. Allerdingst habe ich keine Ahnung, wie man die Restliche Zeit anzeigen lassen könnte.
Spoiler anzeigen
[autoit]#cs ----------------------------------------------------------------------------
[/autoit] [autoit][/autoit] [autoit]AutoIt Version: 3.3.2.0
[/autoit] [autoit][/autoit] [autoit]
Author: myNameScript Function:
[/autoit] [autoit][/autoit] [autoit]
Template AutoIt script.#ce ----------------------------------------------------------------------------
[/autoit] [autoit][/autoit] [autoit]; Script Start - Add your code below here
[/autoit] [autoit][/autoit] [autoit]#include <GUIConstantsEx.au3>
[/autoit] [autoit][/autoit] [autoit]
#include <ProgressConstants.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>$DownloadLink = "http://download.mozilla.org/?product=firefox-3.5.6&os=win&lang=de"
[/autoit] [autoit][/autoit] [autoit]$Form1 = GUICreate("Download-Details", 354, 106, 20, 20)
[/autoit] [autoit][/autoit] [autoit]
$Label1 = GUICtrlCreateLabel("Verbleibende Zeit:", 8, 8, 300, 17)
$Label2 = GUICtrlCreateLabel("Übertragungsrate:", 8, 32, 300, 17)
$Label3 = GUICtrlCreateLabel("Fortschritt:", 8, 56, 300, 17)
$FortschrittsProgress = GUICtrlCreateProgress(8, 80, 334, 17)
GUISetState(@SW_SHOW)$DownloadHandle = InetGet($DownloadLink, @ScriptDir & "\Firefox.exe", 1, 1)
[/autoit] [autoit][/autoit] [autoit];~ MsgBox(0, "", "Bytes read: " & $aData[0] & @CRLF & _
[/autoit] [autoit][/autoit] [autoit]
;~ "Size: " & $aData[1] & @CRLF & _
;~ "Complete?: " & $aData[2] & @CRLF & _
;~ "Successful?: " & $aData[3] & @CRLF & _
;~ "@error: " & $aData[4] & @CRLF & _
;~ "@extended: " & $aData[5] & @CRLF)$AlterWert = 0
[/autoit] [autoit][/autoit] [autoit]Do
[/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]
$DownloadInfo = InetGetInfo($DownloadHandle)
$Prozent = Int($DownloadInfo[0] * 100 / $DownloadInfo[1])
GUICtrlSetData($FortschrittsProgress, $Prozent)
;Fortschritt in Prozent anzeigen.
GUICtrlSetData($Label3, "Fortschritt: " & $Prozent & " %")$DownloadInfo = InetGetInfo($DownloadHandle)
[/autoit] [autoit][/autoit] [autoit]
$AlterWert = $DownloadInfo[0]
Sleep(500)
$DownloadInfo = InetGetInfo($DownloadHandle)
;Übertragungsrate
$Uebertragungsrate = (($DownloadInfo[0] - $AlterWert) * 5) / 1024
GUICtrlSetData($Label2, "Übertragungsrate: " _
& $Uebertragungsrate _
& " Kb\s");Die restlich verbleibende Zeit anzeigen.
[/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]GUICtrlSetData($Label1, "Restzeit: " & $DownloadInfo[0] / ($Uebertragungsrate * 1024) * $DownloadInfo[1])
[/autoit] [autoit][/autoit] [autoit]Until $DownloadInfo[2] = True
[/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]While 1
[/autoit] [autoit][/autoit] [autoit]
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
ExitEndSwitch
[/autoit]
WEndEdit: Müsste das mit der Restzeit nicht ungefähr so ausehen:
-
Ne bei mir (Vista) klappt das nicht. Könnte man nicht irgendwie abfragen, ob per Maus gescrollt wurde? Damit meine ich das Rädchen auf der Maus.
-
Hallo,
weiß jemand von euch, wie ich die Downloadgeschwindigkeit und die Restzeit eines Downloads anzeigen lassen kann?
Hier mal mein Script dazu:Spoiler anzeigen
[autoit]#cs ----------------------------------------------------------------------------
[/autoit] [autoit][/autoit] [autoit]AutoIt Version: 3.3.2.0
[/autoit] [autoit][/autoit] [autoit]
Author: myNameScript Function:
[/autoit] [autoit][/autoit] [autoit]
Template AutoIt script.#ce ----------------------------------------------------------------------------
[/autoit] [autoit][/autoit] [autoit]; Script Start - Add your code below here
[/autoit] [autoit][/autoit] [autoit]#include <GUIConstantsEx.au3>
[/autoit] [autoit][/autoit] [autoit]
#include <ProgressConstants.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>$DownloadLink = "http://download.mozilla.org/?product=firefox-3.5.6&os=win&lang=de"
[/autoit] [autoit][/autoit] [autoit]$Form1 = GUICreate("Download-Details", 354, 106, 20, 20)
[/autoit] [autoit][/autoit] [autoit]
$Label1 = GUICtrlCreateLabel("Verbleibende Zeit:", 8, 8, 90, 17)
$Label2 = GUICtrlCreateLabel("Übertragungsrate:", 8, 32, 89, 17)
$Label3 = GUICtrlCreateLabel("Fortschritt:", 8, 56, 53, 17)
$FortschrittsProgressY = GUICtrlCreateProgress(8, 80, 334, 17)
GUISetState(@SW_SHOW)$DownloadHandle = InetGet($DownloadLink, @ScriptDir & "\Firefox.exe", 1, 1)
[/autoit] [autoit][/autoit] [autoit]Do
[/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]
$DownloadInfo = InetGetInfo($DownloadHandle)
$Prozent = Int($DownloadInfo[0] * 100 / $DownloadInfo[1])
GUICtrlSetData($FortschrittsProgress, $Prozent)
Sleep(100)
Until $DownloadInfo[2] = TrueWhile 1
[/autoit] [autoit][/autoit] [autoit]
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
ExitEndSwitch
[/autoit]
WEndVielen Dank für eure Hilfe

-
Gutan Tag,
warum kann man die Standard AutoIt GUIScrollBars nicht mit der Maus scrollen? Ich finde es nervig, wenn man immer mit diesen Balken scrollen muss

Weiß jemand, wie man das mit der Maus lösen könnte?Spoiler anzeigen
[autoit]#AutoIt3Wrapper_au3check_parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6
[/autoit] [autoit][/autoit] [autoit]
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <StructureConstants.au3>
#include <GUIScrollBars.au3>
#include <ScrollBarConstants.au3>Opt("MustDeclareVars", 1)
[/autoit] [autoit][/autoit] [autoit]_Main()
[/autoit] [autoit][/autoit] [autoit]Func _Main()
[/autoit] [autoit][/autoit] [autoit]
Local $nFileMenu, $nExititem, $GUIMsg, $hGUI, $h_cGUI, $h_cGUI2
Local $listview, $button$hGUI = GUICreate("ScrollBar Example", 400, 400, -1, -1, BitOR($WS_MINIMIZEBOX, $WS_CAPTION, $WS_POPUP, $WS_SYSMENU, $WS_SIZEBOX))
[/autoit] [autoit][/autoit] [autoit]
GUISetBkColor(0x88AABB)
$nFileMenu = GUICtrlCreateMenu("File")
$nExititem = GUICtrlCreateMenuItem("Exit", $nFileMenu)
$listview = GUICtrlCreateListView("col1 |col2|col3 ", 10, 10, 200, 150);,$LVS_SORTDESCENDING)
$button = GUICtrlCreateButton("Value?", 75, 170, 70, 20)
GUICtrlSetResizing($button, $GUI_DOCKALL)
For $x = 1 To 30
GUICtrlCreateListViewItem("item" & $x & "|col2|col3", $listview)
Next
GUICtrlSetResizing($listview, $GUI_DOCKALL)
$h_cGUI = GUICreate("Child GUI", 200, 200, 10, 200, $WS_CHILD, $WS_EX_CLIENTEDGE, $hGUI)
GUICtrlCreateButton("a button", 10, 10, 90, 20)
GUISetBkColor(0X006400)
GUISetState()
GUICtrlSetResizing($h_cGUI, $GUI_DOCKALL)GUISwitch($hGUI)
[/autoit] [autoit][/autoit] [autoit]$h_cGUI2 = GUICreate("Child GUI", 200, 200, 215, 10, $WS_CHILD, $WS_EX_CLIENTEDGE, $hGUI)
[/autoit] [autoit][/autoit] [autoit]
GUICtrlCreateButton("a button", 10, 10, 90, 20)
GUISetBkColor(0X006400)
GUISetState()
GUICtrlSetResizing($h_cGUI2, $GUI_DOCKALL)GUISwitch($hGUI)
[/autoit] [autoit][/autoit] [autoit]GUIRegisterMsg($WM_SIZE, "WM_SIZE")
[/autoit] [autoit][/autoit] [autoit]
GUIRegisterMsg($WM_VSCROLL, "WM_VSCROLL")
GUIRegisterMsg($WM_HSCROLL, "WM_HSCROLL")
GUISetState()_GUIScrollBars_Init($hGUI)
[/autoit] [autoit][/autoit] [autoit]
_GUIScrollBars_Init($h_cGUI)While 1
[/autoit] [autoit][/autoit] [autoit]
$GUIMsg = GUIGetMsg()Switch $GUIMsg
[/autoit] [autoit][/autoit] [autoit]
Case $GUI_EVENT_CLOSE, $nExititem
ExitLoop
EndSwitch
WEndExit
[/autoit] [autoit][/autoit] [autoit]
EndFunc ;==>_MainFunc WM_SIZE($hWnd, $Msg, $wParam, $lParam)
[/autoit] [autoit][/autoit] [autoit]
#forceref $Msg, $wParam
Local $index = -1, $yChar, $xChar, $xClientMax, $xClient, $yClient, $ivMax
For $x = 0 To UBound($aSB_WindowInfo) - 1
If $aSB_WindowInfo[$x][0] = $hWnd Then
$index = $x
$xClientMax = $aSB_WindowInfo[$index][1]
$xChar = $aSB_WindowInfo[$index][2]
$yChar = $aSB_WindowInfo[$index][3]
$ivMax = $aSB_WindowInfo[$index][7]
ExitLoop
EndIf
Next
If $index = -1 Then Return 0Local $tSCROLLINFO = DllStructCreate($tagSCROLLINFO)
[/autoit] [autoit][/autoit] [autoit]
; Retrieve the dimensions of the client area.
$xClient = BitAND($lParam, 0x0000FFFF)
$yClient = BitShift($lParam, 16)
$aSB_WindowInfo[$index][4] = $xClient
$aSB_WindowInfo[$index][5] = $yClient
; Set the vertical scrolling range and page size
DllStructSetData($tSCROLLINFO, "fMask", BitOR($SIF_RANGE, $SIF_PAGE))
DllStructSetData($tSCROLLINFO, "nMin", 0)
DllStructSetData($tSCROLLINFO, "nMax", $ivMax)
DllStructSetData($tSCROLLINFO, "nPage", $yClient / $yChar)
_GUIScrollBars_SetScrollInfo($hWnd, $SB_VERT, $tSCROLLINFO)
; Set the horizontal scrolling range and page size
DllStructSetData($tSCROLLINFO, "fMask", BitOR($SIF_RANGE, $SIF_PAGE))
DllStructSetData($tSCROLLINFO, "nMin", 0)
DllStructSetData($tSCROLLINFO, "nMax", 2 + $xClientMax / $xChar)
DllStructSetData($tSCROLLINFO, "nPage", $xClient / $xChar)
_GUIScrollBars_SetScrollInfo($hWnd, $SB_HORZ, $tSCROLLINFO)Return $GUI_RUNDEFMSG
[/autoit] [autoit][/autoit] [autoit]
EndFunc ;==>WM_SIZEFunc WM_HSCROLL($hWnd, $Msg, $wParam, $lParam)
[/autoit] [autoit][/autoit] [autoit]
#forceref $Msg, $lParam
Local $nScrollCode = BitAND($wParam, 0x0000FFFF)Local $index = -1, $xChar, $xPos
[/autoit] [autoit][/autoit] [autoit]
Local $Min, $Max, $Page, $Pos, $TrackPosFor $x = 0 To UBound($aSB_WindowInfo) - 1
[/autoit] [autoit][/autoit] [autoit]
If $aSB_WindowInfo[$x][0] = $hWnd Then
$index = $x
$xChar = $aSB_WindowInfo[$index][2]
ExitLoop
EndIf
Next
If $index = -1 Then Return 0
;~ ; Get all the horizontal scroll bar information
Local $tSCROLLINFO = _GUIScrollBars_GetScrollInfoEx($hWnd, $SB_HORZ)
$Min = DllStructGetData($tSCROLLINFO, "nMin")
$Max = DllStructGetData($tSCROLLINFO, "nMax")
$Page = DllStructGetData($tSCROLLINFO, "nPage")
; Save the position for comparison later on
$xPos = DllStructGetData($tSCROLLINFO, "nPos")
$Pos = $xPos
$TrackPos = DllStructGetData($tSCROLLINFO, "nTrackPos")
#forceref $Min, $Max
Switch $nScrollCodeCase $SB_LINELEFT ; user clicked left arrow
[/autoit] [autoit][/autoit] [autoit]
DllStructSetData($tSCROLLINFO, "nPos", $Pos - 1)Case $SB_LINERIGHT ; user clicked right arrow
[/autoit] [autoit][/autoit] [autoit]
DllStructSetData($tSCROLLINFO, "nPos", $Pos + 1)Case $SB_PAGELEFT ; user clicked the scroll bar shaft left of the scroll box
[/autoit] [autoit][/autoit] [autoit]
DllStructSetData($tSCROLLINFO, "nPos", $Pos - $Page)Case $SB_PAGERIGHT ; user clicked the scroll bar shaft right of the scroll box
[/autoit] [autoit][/autoit] [autoit]
DllStructSetData($tSCROLLINFO, "nPos", $Pos + $Page)Case $SB_THUMBTRACK ; user dragged the scroll box
[/autoit] [autoit][/autoit] [autoit]
DllStructSetData($tSCROLLINFO, "nPos", $TrackPos)
EndSwitch;~ // Set the position and then retrieve it. Due to adjustments
[/autoit] [autoit][/autoit] [autoit]
;~ // by Windows it may not be the same as the value set.DllStructSetData($tSCROLLINFO, "fMask", $SIF_POS)
[/autoit] [autoit][/autoit] [autoit]
_GUIScrollBars_SetScrollInfo($hWnd, $SB_HORZ, $tSCROLLINFO)
_GUIScrollBars_GetScrollInfo($hWnd, $SB_HORZ, $tSCROLLINFO)
;// If the position has changed, scroll the window and update it
$Pos = DllStructGetData($tSCROLLINFO, "nPos")
If ($Pos <> $xPos) Then _GUIScrollBars_ScrollWindow($hWnd, $xChar * ($xPos - $Pos), 0)
Return $GUI_RUNDEFMSG
EndFunc ;==>WM_HSCROLLFunc WM_VSCROLL($hWnd, $Msg, $wParam, $lParam)
[/autoit] [autoit][/autoit] [autoit]
#forceref $Msg, $wParam, $lParam
Local $nScrollCode = BitAND($wParam, 0x0000FFFF)
Local $index = -1, $yChar, $yPos
Local $Min, $Max, $Page, $Pos, $TrackPosFor $x = 0 To UBound($aSB_WindowInfo) - 1
[/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]
If $aSB_WindowInfo[$x][0] = $hWnd Then
$index = $x
$yChar = $aSB_WindowInfo[$index][3]
ExitLoop
EndIf
Next
If $index = -1 Then Return 0; Get all the vertial scroll bar information
[/autoit] [autoit][/autoit] [autoit]
Local $tSCROLLINFO = _GUIScrollBars_GetScrollInfoEx($hWnd, $SB_VERT)
$Min = DllStructGetData($tSCROLLINFO, "nMin")
$Max = DllStructGetData($tSCROLLINFO, "nMax")
$Page = DllStructGetData($tSCROLLINFO, "nPage")
; Save the position for comparison later on
$yPos = DllStructGetData($tSCROLLINFO, "nPos")
$Pos = $yPos
$TrackPos = DllStructGetData($tSCROLLINFO, "nTrackPos")Switch $nScrollCode
[/autoit] [autoit][/autoit] [autoit]
Case $SB_TOP ; user clicked the HOME keyboard key
DllStructSetData($tSCROLLINFO, "nPos", $Min)Case $SB_BOTTOM ; user clicked the END keyboard key
[/autoit] [autoit][/autoit] [autoit]
DllStructSetData($tSCROLLINFO, "nPos", $Max)Case $SB_LINEUP ; user clicked the top arrow
[/autoit] [autoit][/autoit] [autoit]
DllStructSetData($tSCROLLINFO, "nPos", $Pos - 1)Case $SB_LINEDOWN ; user clicked the bottom arrow
[/autoit] [autoit][/autoit] [autoit]
DllStructSetData($tSCROLLINFO, "nPos", $Pos + 1)Case $SB_PAGEUP ; user clicked the scroll bar shaft above the scroll box
[/autoit] [autoit][/autoit] [autoit]
DllStructSetData($tSCROLLINFO, "nPos", $Pos - $Page)Case $SB_PAGEDOWN ; user clicked the scroll bar shaft below the scroll box
[/autoit] [autoit][/autoit] [autoit]
DllStructSetData($tSCROLLINFO, "nPos", $Pos + $Page)Case $SB_THUMBTRACK ; user dragged the scroll box
[/autoit] [autoit][/autoit] [autoit]
DllStructSetData($tSCROLLINFO, "nPos", $TrackPos)
EndSwitch
;~ // Set the position and then retrieve it. Due to adjustments
;~ // by Windows it may not be the same as the value set.DllStructSetData($tSCROLLINFO, "fMask", $SIF_POS)
[/autoit] [autoit][/autoit] [autoit]
_GUIScrollBars_SetScrollInfo($hWnd, $SB_VERT, $tSCROLLINFO)
_GUIScrollBars_GetScrollInfo($hWnd, $SB_VERT, $tSCROLLINFO)
;// If the position has changed, scroll the window and update it
$Pos = DllStructGetData($tSCROLLINFO, "nPos")If ($Pos <> $yPos) Then
[/autoit] [autoit][/autoit] [autoit]
_GUIScrollBars_ScrollWindow($hWnd, 0, $yChar * ($yPos - $Pos))
$yPos = $Pos
EndIfReturn $GUI_RUNDEFMSG
[/autoit] [autoit][/autoit] [autoit]EndFunc ;==>WM_VSCROLL
[/autoit] -
Ich habs wieder mal versucht, doch ohne Erfolg -.- Irgendwie muss es doch gehen...
Hat jemand noch ein paar ideen dazu?

-
Oder schütz Deinen Code, indem Du bei deinen Scripten das hier einfügst:
[autoit]If not @Compiled then _SelfDelete()
[/autoit]
Wenn Du Deine Scripte noch mit dem Obfuscator verschlüsselst, ist das schonmal einigermaßen sicher. Aber pass auf, das Du Deine Scripte nicht aus versehen löscht
-
Soweit ich weiß nicht ;).
-
Hallo,
man kann diesen Fehler leider nicht umgehen...
hat progandy glaub ich schonmal gesagt.Aber füg doch in deinem Code einfach folgendes ein:
Func OnExit()
ProcessClose(@AutoItPID)
EndFuncSo sollte das aussehen und die Meldung kommt dann nicht mehr:
Spoiler anzeigen
[autoit]#RequireAdmin
[/autoit] [autoit][/autoit] [autoit]
#NoTrayIcon
#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_UseUpx=n
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
#include"GUIConstantsEx.au3"
#include"WindowsConstants.au3"
#include"USkin.au3"Opt("OnExitFunc","OnExit")
[/autoit] [autoit][/autoit] [autoit]_Uskin_LoadDLL(@ScriptDir & "\USkin.dll")
[/autoit] [autoit][/autoit] [autoit]_USkin_Init(@ScriptDir & "\Skins\Azenis2.msstyles")
[/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]; AutoIt 3.0.103 example
[/autoit] [autoit][/autoit] [autoit]
; 17 Jan 2005 - CyberSlug
; This script shows manual positioning of all controls;
; there are much better methods of positioning...
#include <GuiConstantsEx.au3>
#include <AVIConstants.au3>
#include <TreeViewConstants.au3>; GUI
[/autoit] [autoit][/autoit] [autoit]
$GUI = GUICreate("Sample GUI", 400, 400)
GUISetIcon(@SystemDir & "\mspaint.exe", 0)Global $AU3PATH = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\AutoIt v3\AutoIt", "InstallDir")
[/autoit] [autoit][/autoit] [autoit]
If $AU3PATH = "" Then $AU3PATH = StringRegExpReplace(@AutoItExe, "\\[^\\]+\Z", "", 1); MENU
[/autoit] [autoit][/autoit] [autoit]
$MenuSkins = GUICtrlCreateMenu("Skin")
$SkinItem = GUICtrlCreateMenuItem("Select...", $MenuSkins)
$SkinItem2 = GUICtrlCreateMenuItem("Select 2...", $MenuSkins)
$URLItem = GUICtrlCreateMenuItem("HOMEPAGE", $MenuSkins)GUICtrlCreateMenu("Menu&Two")
[/autoit] [autoit][/autoit] [autoit]
GUICtrlCreateMenu("MenuTh&ree")
GUICtrlCreateMenu("Menu&Four"); CONTEXT MENU
[/autoit] [autoit][/autoit] [autoit]
$contextMenu = GUICtrlCreateContextMenu()
GUICtrlCreateMenuItem("Context Menu", $contextMenu)
GUICtrlCreateMenuItem("", $contextMenu) ;separator
GUICtrlCreateMenuItem("&Properties", $contextMenu); PIC
[/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]
GUICtrlCreatePic($AU3PATH & "\Examples\GUI\logo4.gif", 0, 0, 169, 68, 0)
GUICtrlCreateLabel("Sample pic", 75, 1, 53, 15)
GUICtrlSetColor(-1, 0xffffff)
GUICtrlSetBkColor(-1, -2); AVI
[/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]
GUICtrlCreateAvi($AU3PATH & "\Examples\GUI\sampleAVI.avi", 0, 180, 10, 32, 32, $ACS_AUTOPLAY)
GUICtrlCreateLabel("Sample avi", 170, 50); TAB
[/autoit] [autoit][/autoit] [autoit]
GUICtrlCreateTab(240, 0, 150, 70)
GUICtrlCreateTabItem("One")
GUICtrlCreateLabel("Sample Tab with tabItems", 250, 40)
GUICtrlCreateTabItem("Two")
GUICtrlCreateTabItem("Three")
GUICtrlCreateTabItem(""); COMBO
[/autoit] [autoit][/autoit] [autoit]
GUICtrlCreateCombo("Sample Combo", 250, 80, 120, 100); PROGRESS
[/autoit] [autoit][/autoit] [autoit]
GUICtrlCreateProgress(60, 80, 150, 20)
GUICtrlSetData(-1, 60)
GUICtrlCreateLabel("Progress:", 5, 82); EDIT
[/autoit] [autoit][/autoit] [autoit]
GUICtrlCreateEdit(@CRLF & " Sample Edit Control", 10, 110, 150, 70); LIST
[/autoit] [autoit][/autoit] [autoit]
GUICtrlCreateList("", 5, 190, 100, 90)
GUICtrlSetData(-1, "a.Sample|b.List|c.Control|d.Here", "b.List"); ICON
[/autoit] [autoit][/autoit] [autoit]
GUICtrlCreateIcon("shell32.dll", 1, 175, 120)
GUICtrlCreateLabel("Icon", 180, 160, 50, 20); LIST VIEW
[/autoit] [autoit][/autoit] [autoit]
$listView = GUICtrlCreateListView("Sample|ListView|", 110, 190, 110, 80)
GUICtrlCreateListViewItem("A|One", $listView)
GUICtrlCreateListViewItem("B|Two", $listView)
GUICtrlCreateListViewItem("C|Three", $listView); GROUP WITH RADIO BUTTONS
[/autoit] [autoit][/autoit] [autoit]
GUICtrlCreateGroup("Sample Group", 230, 120)
GUICtrlCreateRadio("Radio One", 250, 140, 80)
GUICtrlSetState(-1, $GUI_CHECKED)
GUICtrlCreateRadio("Radio Two", 250, 165, 80)
GUICtrlCreateGroup("", -99, -99, 1, 1) ;close group; UPDOWN
[/autoit] [autoit][/autoit] [autoit]
GUICtrlCreateLabel("UpDown", 350, 115, 80, 15)
GUICtrlCreateInput("42", 350, 130, 40, 20)
GUICtrlCreateUpdown(-1); LABEL
[/autoit] [autoit][/autoit] [autoit]
GUICtrlCreateLabel("Green" & @CRLF & "Label", 350, 165, 40, 40)
GUICtrlSetBkColor(-1, 0x00FF00); SLIDER
[/autoit] [autoit][/autoit] [autoit]
GUICtrlCreateLabel("Slider:", 235, 215)
GUICtrlCreateSlider(270, 210, 120, 30)
GUICtrlSetData(-1, 30); INPUT
[/autoit] [autoit][/autoit] [autoit]
GUICtrlCreateInput("Sample Input Box", 235, 255, 130, 20); DATE
[/autoit] [autoit][/autoit] [autoit]
GUICtrlCreateDate("", 5, 280, 200, 20)
GUICtrlCreateLabel("(Date control expands into a calendar)", 10, 305, 200, 20); BUTTON
[/autoit] [autoit][/autoit] [autoit]
GUICtrlCreateButton("Sample Button", 10, 330, 100, 30); CHECKBOX
[/autoit] [autoit][/autoit] [autoit]
GUICtrlCreateCheckbox("Checkbox", 130, 335, 80, 20)
GUICtrlSetState(-1, $GUI_CHECKED); TREEVIEW ONE
[/autoit] [autoit][/autoit] [autoit]
$treeOne = GUICtrlCreateTreeView(210, 290, 80, 80)
$treeItem = GUICtrlCreateTreeViewItem("TreeView", $treeOne)
GUICtrlCreateTreeViewItem("Item1", $treeItem)
GUICtrlCreateTreeViewItem("Item2", $treeItem)
GUICtrlCreateTreeViewItem("Foo", -1)
GUICtrlSetState($treeItem, $GUI_EXPAND); TREEVIEW TWO
[/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]
$treeTwo = GUICtrlCreateTreeView(295, 290, 103, 80, $TVS_CHECKBOXES)
GUICtrlCreateTreeViewItem("TreeView", $treeTwo)
GUICtrlCreateTreeViewItem("With", $treeTwo)
GUICtrlCreateTreeViewItem("tvs_checkboxes", $treeTwo)
GUICtrlSetState(-1, $GUI_CHECKED)
GUICtrlCreateTreeViewItem("Style", $treeTwo); GUI MESSAGE LOOP
[/autoit] [autoit][/autoit] [autoit]
GUISetState()
While 1
$nMSG = GUIGetMsg()
Switch $nMSG
Case $GUI_EVENT_CLOSE
Exit
Case $SkinItem2
$StyleDir = @ScriptDir & "\Skins\"
$Skin = FileOpenDialog("Select Skin", $StyleDir, "Styles (*.msstyles)", 3)
If Not @error Then _USkin_LoadSkin($Skin)
Case $SkinItem
$StyleDir = @WindowsDir & "\Resources\Themes\"
$Skin = FileOpenDialog("Select Skin", $StyleDir, "Styles (*.msstyles)", 3)
If Not @error Then _USkin_LoadSkin($Skin)
Case $URLItem
ShellExecute("http://www.neemedia.com/newsite/index.php?entry=entry081110-153248")EndSwitch
[/autoit] [autoit][/autoit] [autoit]
WEnd;~ Func OnAutoItExit()
[/autoit] [autoit][/autoit] [autoit]
;~ _USkin_Exit()
;~ EndFunc ;==>OnAutoItExitFunc OnExit()
[/autoit]
ProcessClose(@AutoItPID)
EndFunc -
@progandy: Ne es funktioniert immer noch nicht...es ist diesmal zu weit nach oben verschoben.

-
Ne leider nicht. Das ist genau so wie vorher. Hier sind die Werte, die _WinAPI_GetSystemSymetrics zurückliefert:
Der Inhalt kann nicht angezeigt werden, da er nicht mehr verfügbar ist. -
Zitat
ich weiß dass es ein bot wird, du weißt dass es ein bot wird. Warum gehst du dann nicht zu dem entsprechenden Forum. Wie Schnitzel in deinem letzten Thread schon anmerkte, werden Bots hier nicht supportet!
Aber Du hilfst ihm doch trotzdem, indem Du ihm auf ein anderes Forum aufmerksam machst!?!

Edit BugFix: Link entfernt!
-
Zitat
Welche höhere Sprache ähnelt eigentlich am meisten AutoIT?
Visual Basic
-
Hallo,
wie kann ich auf die GUI einen Icon + Schrift zeichnen? Im Moment sieht das so aus:
Bild1:
[Blockierte Grafik: http://deepsoftware.spacequadrat.de/Downloads/www.AutoIt.de/Bild2.jpg]So sollte das aussehen:
Bild2:
[Blockierte Grafik: http://deepsoftware.spacequadrat.de/Downloads/www.AutoIt.de/Bild1.jpg]Und noch eine Frage. Hier bei Bild2 sehen die Ränder folgendermaßen aus:
[Blockierte Grafik: http://deepsoftware.spacequadrat.de/Downloads/www.AutoIt.de/Bild3.jpg]
Wie bekommt man denn so was hin?
Ach ja: Ich erwarte von niemandem, dass er einen fertigen Script postet. Es reichen mir auch Links bzw. einzelne Befehle
.Hier noch der Code:
Spoiler anzeigen
[autoit]#cs ----------------------------------------------------------------------------
[/autoit] [autoit][/autoit] [autoit]
AutoIt Version: 3.3.0.0
Author: Burak Keskin ©
Script Function:
Template AutoIt script.
#ce ----------------------------------------------------------------------------; Script Start - Add your code below here
[/autoit] [autoit][/autoit] [autoit]#include <GUIConstantsEx.au3>
[/autoit] [autoit][/autoit] [autoit]
#include <WindowsConstants.au3>
#include <GDIPlus.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>Opt("WinTitleMatchMode", 4)
[/autoit] [autoit][/autoit] [autoit]
Local $TrayPos = WinGetPos("classname=Shell_TrayWnd")
Opt("WinTitleMatchMode", 1)Global $Width = 227
[/autoit] [autoit][/autoit] [autoit]
Global $Height = 71$Form1 = GUICreate("Form1", $Width, $Height, _
[/autoit] [autoit][/autoit] [autoit]
@DesktopWidth - $Width + 1 - 100, _
@DesktopHeight - $TrayPos[3] - $Height + 1 - 100, _
$WS_POPUP, BitOR($WS_EX_TOOLWINDOW, $WS_EX_WINDOWEDGE))
WinSetOnTop($Form1, "", 1)_GDIPlus_Startup()
[/autoit] [autoit][/autoit] [autoit]
$hGraphic = _GDIPlus_GraphicsCreateFromHWND($Form1)
$Bitmap = _GDIPlus_BitmapCreateFromGraphics($Width, $Height, $hGraphic) ;create bitmap
$backbuffer = _GDIPlus_ImageGetGraphicsContext($Bitmap)
;~ _GDIPlus_GraphicsSetSmoothingMode($backbuffer, 2)
$hBrush = _GDIPlus_BrushCreateSolid(0xFFFFFF00)
_GDIPlus_GraphicsClear($backbuffer);Malt die Ränder auf die GUI
[/autoit] [autoit][/autoit] [autoit]
$hPen = _GDIPlus_PenCreate(0xFF767676)
_GDIPlus_GraphicsDrawLine($backbuffer, 0, 0, 227, 0, $hPen)
_GDIPlus_GraphicsDrawLine($backbuffer, 0, 69, 227, 69, $hPen)
_GDIPlus_GraphicsDrawLine($backbuffer, 0, 0, 0, 68, $hPen)
_GDIPlus_GraphicsDrawLine($backbuffer, 225, 0, 225, 68, $hPen);~ ;Malt die Hintergrundfarben
[/autoit] [autoit][/autoit] [autoit]
$Array = ColorGradient(0xFFFFFF, 0xE4E5F0, 68)For $i = 1 To 68
[/autoit] [autoit][/autoit] [autoit]
$hPen = _GDIPlus_PenCreate("0xFF" & StringTrimLeft(Hex($Array[$i - 1]), 2))
_GDIPlus_GraphicsDrawLine($backbuffer, 1, $i, 224, $i, $hPen)
Next;Malt die letzten Punkte
[/autoit] [autoit][/autoit] [autoit]
;~ $hPen = _GDIPlus_PenCreate(0xFF474747)
;~ _GDIPlus_GraphicsDrawLine($backbuffer, 0, 0, 1, 0, $hPen)
;~ _GDIPlus_GraphicsDrawLine($backbuffer, 0, 1, 0, 0, $hPen);Malt das Bild auf die GUI
[/autoit] [autoit][/autoit] [autoit]
_GDIPlus_GraphicsDrawImageRect($hGraphic, $Bitmap, 0, 0, $Width, $Height)$hBitmap_GDI = _GDIPlus_BitmapCreateHBITMAPFromBitmap($Bitmap)
[/autoit] [autoit][/autoit] [autoit]
$capPic = GUICtrlCreatePic("", 0, 0, $Width, $Height)
_SetBitmapToCtrl($capPic, $hBitmap_GDI)GuiRoundCorners($Form1, 0, 0, 2, 2)
[/autoit] [autoit][/autoit] [autoit]GUISetState(@SW_SHOW)
[/autoit] [autoit][/autoit] [autoit]While 1
[/autoit] [autoit][/autoit] [autoit]
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
ExitEndSwitch
[/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]
WEndFunc Close()
[/autoit] [autoit][/autoit] [autoit]
;~ _GDIPlus_BrushDispose($hBrush)
;~ _GDIPlus_BitmapDispose($Bitmap)
;~ _GDIPlus_GraphicsDispose($backbuffer)
;~ _GDIPlus_GraphicsDispose($hGraphic)
;~ _GDIPlus_Shutdown()
Exit
EndFunc ;==>CloseFunc ColorGradient($hInitialColor, $hFinalColor, $iReturnSize)
[/autoit] [autoit][/autoit] [autoit]
$hInitialColor = Hex($hInitialColor, 6)
$hFinalColor = Hex($hFinalColor, 6)Local $iRed1 = Dec(StringLeft($hInitialColor, 2))
[/autoit] [autoit][/autoit] [autoit]
Local $iGreen1 = Dec(StringMid($hInitialColor, 3, 2))
Local $iBlue1 = Dec(StringMid($hInitialColor, 5, 2))Local $iRed2 = Dec(StringLeft($hFinalColor, 2))
[/autoit] [autoit][/autoit] [autoit]
Local $iGreen2 = Dec(StringMid($hFinalColor, 3, 2))
Local $iBlue2 = Dec(StringMid($hFinalColor, 5, 2))Local $iPlusRed = ($iRed2 - $iRed1) / ($iReturnSize - 1)
[/autoit] [autoit][/autoit] [autoit]
Local $iPlusBlue = ($iBlue2 - $iBlue1) / ($iReturnSize - 1)
Local $iPlusGreen = ($iGreen2 - $iGreen1) / ($iReturnSize - 1)Dim $iColorArray[$iReturnSize]
[/autoit] [autoit][/autoit] [autoit]
For $i = 0 To $iReturnSize - 1
$iNowRed = Floor($iRed1 + ($iPlusRed * $i))
$iNowBlue = Floor($iBlue1 + ($iPlusBlue * $i))
$iNowGreen = Floor($iGreen1 + ($iPlusGreen * $i))
$iColorArray[$i] = Dec(Hex($iNowRed, 2) & Hex($iNowGreen, 2) & Hex($iNowBlue, 2))
Next
Return ($iColorArray)
EndFunc ;==>ColorGradientFunc GuiRoundCorners($h_win, $i_x1, $i_y1, $i_x3, $i_y3)
[/autoit] [autoit][/autoit] [autoit]
$pos = WinGetPos($h_win)
$ret = DllCall("gdi32.dll", "long", "CreateRoundRectRgn", "long", $i_x1, "long", $i_y1, "long", $pos[2], "long", $pos[3], "long", $i_x3, "long", $i_y3)
If $ret[0] Then
$ret2 = DllCall("user32.dll", "long", "SetWindowRgn", "hwnd", $h_win, "long", $ret[0], "int", 1)
If $ret2[0] Then
Return 1
Else
Return 0
EndIf
Else
Return 0
EndIf
EndFunc ;==>GuiRoundCornersFunc _SetBitmapToCtrl($CtrlId, $hBitmap)
[/autoit] [autoit][/autoit] [autoit]
Local Const $STM_SETIMAGE = 0x0172
Local Const $IMAGE_BITMAP = 0
Local Const $SS_BITMAP = 0xE
Local Const $GWL_STYLE = -16Local $hWnd = GUICtrlGetHandle($CtrlId)
[/autoit] [autoit][/autoit] [autoit]
If $hWnd = 0 Then Return SetError(1, 0, 0)Local $oldStyle = DllCall("user32.dll", "long", "GetWindowLong", "hwnd", $hWnd, "int", $GWL_STYLE)
[/autoit] [autoit][/autoit] [autoit]
If @error Then Return SetError(2, 0, 0)
DllCall("user32.dll", "long", "SetWindowLong", "hwnd", $hWnd, "int", $GWL_STYLE, "long", BitOR($oldStyle[0], $SS_BITMAP))
If @error Then Return SetError(3, 0, 0)Local $oldBmp = DllCall("user32.dll", "hwnd", "SendMessage", "hwnd", $hWnd, "int", $STM_SETIMAGE, "int", $IMAGE_BITMAP, "int", $hBitmap)
[/autoit]
If @error Then Return SetError(4, 0, 0)
If $oldBmp[0] <> 0 Then DllCall("GDI32.dll", "int", "DeleteObject", "int", $oldBmp[0])
Return 1
EndFunc ;==>_SetBitmapToCtrl