ich habe ein Problem mit einem Script. Der Aufruf per Gosub, AllesLaden funktioniert, aber per SetTimer, AllesLaden, 10000 zyklisch geht nicht. Es iwrd nichts am Gui geändert, obwohl das Sub richtig druchläuft.
hier das Script
Code: Select all
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn ; Enable warnings to assist with detecting common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
;*********************************
; GUI Einstellungen
;*********************************
faktorSchrift := 1
SchriftGR = 10
SysGet, VirtualScreenWidth, 78
SysGet, VirtualScreenHeight, 79
SysGet, WorkArea, MonitorWorkArea, 1
dpi := GET_DPI()/100
ProgScreenWidth := Round(WorkAreaRight/dpi)-100
ProgScreenHeight := Round(WorkAreaBottom/dpi)-100
AbstandFensterChild := 350
HoGroupBoxModul1 := ProgScreenHeight-AbstandFensterChild-150
Gui PARENT:+DPIScale
;*******************************
; GUI PARENT definieren
;*****************************
Colorn=0xB7CBE3
Colorn=0x003366
Gui, PARENT:New
Gui, PARENT:Color, %Colorn%, 0x003366
Gui, PARENT: +MinimizeBox -Theme -border -Caption
gui, PARENT:-Resize ;+0x40000 +0x200000
Gui, PARENT:font, s%SchriftGR%, arial
MarginX := 5
MarginY := 5
Gui, PARENT:Margin, %MarginX%, %MarginY%
Gui, +LastFound
;WinSet, Transparent, 180
;**************************************
;*** GUI Statusbar
;**************************************
;Gui, PARENT:Add, Picture, x0 y0 w%ProgScreenWidth% h%ProgScreenHeight% +0x4000000, %A_ScriptDir%\03_Konfig\background3.jpg
;Gui, PARENT:Add, StatusBar, 0x100, Version:%aktVers% / UG:%Usergrup% / %EPtext%
;SB_SetText("Version: " . aktVers . " /UG: " . Usergrup . " / " . EPtext)
;SB_SetParts(150, 85, 50, 300)
;SB_SetText("Username: " . Benutzer . "/" . FreigabeFunktionen, 1)
;SB_SetText("Version: " . Version, 2)
;SB_SetText("Modus: " . PARENT, 3)
;SB_SetText("Befehl: " , 4)
BrGroupBox1:= (ProgScreenWidth*0.5)-20
HoGroupBox1 := ProgScreenHeight*0.4
;Gui, PARENT:Add, Button, x600 h50 w80 gRefresh, Neu Laden
Gui, PARENT:font, s24 bold, arial
Gui, PARENT:Add, Text, x0 y10 w%ProgScreenWidth% Center cwhite vTitelAbteilung,
Gui, PARENT:font, s20 bold, arial
Gui, PARENT:Add, Text, x0 w%ProgScreenWidth% Center cwhite vTitelTeam,
Gui, PARENT:font, s14 bold, arial
Gui, PARENT:Add, GroupBox, x10 y100 h%HoGroupBox1% w%BrGroupBox1% cwhite, Mitarbeiter
BrGroupBox2:= (ProgScreenWidth*0.5)-20
HoGroupBox2 := ProgScreenHeight*0.4
Gui, PARENT:Add, GroupBox, % "x" BrGroupBox1+20 " y100 h" HoGroupBox1 " w" BrGroupBox1 " cwhite", Kennzahlen
HoGroupBox1Bild := HoGroupBox1*0.7
BrGroupBox1Bild := BrGroupBox1*0.45
BrGroupBox1Text := BrGroupBox1*0.45
Gui, PARENT:Add, Picture, x20 yp+25 w%BrGroupBox1Bild% h-1 AltSubmit vBildMA
Gui, PARENT:font, s12 bold, arial
Gui, PARENT:Add, Text, % "x+" 20 " w" BrGroupBox1Text-10 " r2 vNameMA cwhite"
Gui, PARENT:font, s10 normal, arial
Gui, PARENT:Add, Text, % "y+5 w" BrGroupBox1Text-10 " vFunktionMA cwhite"
Gui, PARENT:Add, Text, % "y+5 w" BrGroupBox1Text-10 " r2 vInfoMA cwhite"
HoGroupBox2Bild := HoGroupBox1*0.7
BrGroupBox2Bild := BrGroupBox1*0.45
BrGroupBox2Text := BrGroupBox1*0.45
Gui, PARENT:Show, w%ProgScreenWidth% h%ProgScreenHeight% Center,MITARBEITERTAFEL
gosub, allesLaden ; geht
;#Persistent
;SetTimer, AllesLaden, 10000 ; geht nicht
return
; GUI ENDE ###############################
AllesLaden:
;SetTimer, AllesLaden, Off
Loop, Files, %A_ScriptDir%\*.*, D ; Recurse into subfolders.
{
IniRead, TitelAbteilungIni, %A_LoopFileFullPath%\%A_index%.ini, Konfig, Name
If TitelAbteilungIni = Error
Continue
IniRead, TitelTeamIni, %A_LoopFileFullPath%\%A_index%.ini, Konfig, Beschreibung
IniRead, AnzMAIni, %A_LoopFileFullPath%\%A_index%.ini, Konfig, AnzMA
IniRead, AnzKZIni, %A_LoopFileFullPath%\%A_index%.ini, Kennzahlen, AnzKZ
GuiControl, ,TitelAbteilung, %TitelAbteilungIni%
GuiControl, ,TitelTeam, %TitelTeamIni%
;msgbox, %A_LoopFileFullPath%\%A_index%.ini`n%TitelAbteilungIni%`n%TitelTeamIni%`n%AnzMAIni%
ZaehlerTeam := A_Index
if AnzMAIni > 0
{
Loop, %AnzMAIni%
{
IniRead, MANameIni, %A_LoopFileFullPath%\%ZaehlerTeam%.ini, Mitarbeiter, MA%A_Index%Name
IniRead, MAFunktionIni, %A_LoopFileFullPath%\%ZaehlerTeam%.ini, Mitarbeiter, MA%A_Index%Funktion
IniRead, MAInfoIni, %A_LoopFileFullPath%\%ZaehlerTeam%.ini, Mitarbeiter, MA%A_Index%Info
IniRead, MABildIni, %A_LoopFileFullPath%\%ZaehlerTeam%.ini, Mitarbeiter, MA%A_Index%Bild
GuiControl, ,NameMA, %MANameIni%
GuiControl, ,FunktionMA, %MAFunktionIni%
GuiControl, ,InfoMA, %MAInfoIni%
GuiControl, ,BildMA, %A_ScriptDir%\%ZaehlerTeam%\BilderMA\%MABildIni%
Sleep,3000
}
}
}
;SetTimer, AllesLaden, On
return
PARENTGuiClose:
ExitApp
;*****************************************************
; DPI Abfragen / Schriftgröße
;by IsNull
GET_DPI(){
;http://msdn.microsoft.com/en-us/library/dd144877%28VS.85%29.aspx
DESKTOP_DC := DllCall("GetDC","int",0)
DPI := DllCall("gdi32.dll\GetDeviceCaps","int",DESKTOP_DC,"int",88)
DllCall("gdi32.dll\ReleaseDC","Uint",DESKTOP_DC)
return, DPI
}
gosub, allesLaden ; geht
aber das nicht:
Code: Select all
#Persistent
SetTimer, AllesLaden, 10000 ; geht nicht