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

Beiträge von veronesi

  • Ausführliches Logfile

    • veronesi
    • 31. März 2011 um 07:36

    Hallo Chip, auch Dir vielen Dank.

    Ist eine Interessante Idee, muss ich mal anschauen.
    Das Problem ist, dass mein "Programm" bereits aus vier (4) parallel laufenden Programmen besteht!
    (Z.B. die GUI ist schon separat um das Programm nicht auszubremsen)

    Aber wie gesagt, alles läuft einwandfrei.

    Was meinen die Anderen? Wäre ein paralleles Program eine gute idee?

  • Ausführliches Logfile

    • veronesi
    • 31. März 2011 um 07:33

    Hallo Mega!

    Vielen Dank!
    Ja, im Abbruchsfall würde nichts geloggt werden... Habe ich total übersehen!
    Auch das mit der globalen Variable ist eine gute Idee. So kann ich das loggen global Ein- / Aus- oder teilweise einschalten!

    Frage: Was ist die schnellste Methode um in eine Datei zu schreiben? Ich meine ich muss die Datei ja nach jeder Zeile wieder schliessen, sonst ist sie bei einem Absturz auch nicht gespeichert!

  • Ausführliches Logfile

    • veronesi
    • 31. März 2011 um 07:01

    Hallo zusammen,
    ich habe mal wieder eine etwas dämliche Frage ;)

    Ich habe ein (einwandfrei funktionierendes) Programm mit knapp 5'000 Zeilen Code.
    Nun ist gewünscht worden, dass das Programm zur Laufzeit so ziemlich alles "dokumentiert" (Logfile) was es macht, bzw. was die Rückgabewerte waren.

    Für mich bedeutet das natürlich ein sehr grosser Aufwand, da zu den 5'000 Zeilen vermutlich nun 2'000 Zeilen für die Doku dazukommen würden.

    • Ist es möglich, dass AutoIt nach jedem Befehl mit Rückgabewert automatisch in eine Funktion springt und den Rückgabewert übergibt? (Vermutlich eher nicht...)
    • Wie stelle ich es an, dass mein eigentliches Programm nicht durch das loggen ausgebremst wird? Soll ich die ganzen Texte und Rückgabewerte in ein Array schreiben und am Schluss erst in eine Datei?
      Was wäre der Beste Ansatz, um ein möglichst vollständiges Logfile zu erhalten und doch nicht unbedingt tagelang das Hauptprogramm anzupassen?.

    Die Leute möchten das Logfile einfach für den Fall, falls bei einem Kunden mal irgendetwas schief läuft. Dann könnte man einfacher nachvollziehen, wo das Problem liegt.

    Vielen Dank für Eure Ideen.
    Grüsse Veronesi

  • TaskScheduler / Aufgabenplaner mittels ObjCreate("Schedule.Service") ansteuern

    • veronesi
    • 30. März 2011 um 14:53

    Hallo zusammen,

    so, nun konnte ich auch noch die letzten Punkte bewältigen

    - Nur Ausführen, wenn der Benutzer angemeldet ist / bw. Unabhängig davon => Funktioniert
    - Mit höchsten Privilegien => Funktioniert
    - Beim Ausführen der Aufgaben folgendes Benutzerkonto verwenden..... =>Funktioniert

    Hier deshalb die (momentan) letzte und aktuellste Version des Programmes.
    Es sind zwar recht viele mögliche Parameter, doch ich denke ich habe sie recht gut beschrieben!


    Spoiler anzeigen
    [autoit]

    #include-once
    Dim $oMyError, $ErrorFound = False

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

    ;==================================================================================
    ; Function: _CreateTask($TaskName, $TaskDescription, $TriggerEvent, $StartTrigger, $EndTrigger, $DaysOfWeek, $DaysOfMonth, $MonthOfYear, $WeeksOfMonth, $DaysInterval, $Interval, $RepetitionEnabled, $LogonType, $RunLevel, $Username, $Password, $Program, $WorkingDirectory = "", $Arguments = "", $RunOnlyIfNetworkAvailable = True)
    ; Description: Creates a scheduled task
    ; Parameter(s): $h_Window - Handle to the Window to update
    ; $i_Mode - Update Mode; 0=Small Update; 1=Normal Update.
    ; Return Value(s): On Success - Return 1, @ERROR = 0
    ; On Failure - Sets @ERROR = 1, Return 0
    ; - Wrong OS (Needs Vista or higher) @Error = 2 Return 0
    ; Author(s): Unknown (http://www.autoit.de/index.php?page…4517#post214517)
    ; Changes: Veronesi
    ; Note(s): Works only on Win7 and above (Perhaps also Win Vista, but not tested!)
    ; Example: _CreateTask("Testname", "Description of this task", 3, "2011-03-30T08:00:00", "", 2, 1, 1, 1, 1, "PT1H", False, 3, 0, "", "", '"c:\windows\system32\notepad.exe"', "", "", True)
    ;==================================================================================

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

    #cs
    $TaskName => String, Free text

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

    $TaskDescription => String, Free text

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

    $TriggerEvent => http://msdn.microsoft.com/en-us/library/…v=VS.85%29.aspx
    (0: TASK_TRIGGER_EVENT; Triggers the task when a specific event occurs.) => Not working yet
    1: TASK_TRIGGER_TIME; Triggers the task at a specific time of day.
    2: TASK_TRIGGER_DAILY; Triggers the task on a daily schedule. For example, the task starts at a specific time every day, every-other day, every third day, and so on.
    3: TASK_TRIGGER_WEEKLY; Triggers the task on a weekly schedule. For example, the task starts at 8:00 AM on a specific day every week or other week.
    4: TASK_TRIGGER_MONTHLY; Triggers the task on a monthly schedule. For example, the task starts on specific days of specific months.
    5: TASK_TRIGGER_MONTHLYDOW; Triggers the task on a monthly day-of-week schedule. For example, the task starts on a specific days of the week, weeks of the month, and months of the year.
    6: TASK_TRIGGER_IDLE; Triggers the task when the computer goes into an idle state.
    7: TASK_TRIGGER_REGISTRATION; Triggers the task when the task is registered.
    8: TASK_TRIGGER_BOOT; Triggers the task when the computer boots. => Needs Admin-Rights!
    9: TASK_TRIGGER_LOGON; Triggers the task when a specific user logs on. => Needs Admin-Rights!
    11:TASK_TRIGGER_SESSION_STATE_CHANGE; Triggers the task when a specific session state changes. => Needs Admin-Rights!

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

    $StartTrigger => String with Start time / date (Year-Month-DayTHour:Min:Sec) E.g. "2011-03-30T08:00:00"

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

    $EndTrigger => String with End time / date (Year-Month-DayTHour:Min:Sec) E.g. "2011-03-30T08:00:00"

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

    $DaysOfWeek => Integer; 1 = Sunday / 2 = Monday / 4 = Tuesday / 8 = Wednesday / 16 = Thursday / 32 = Friday / 64 = Saturday (http://msdn.microsoft.com/en-us/library/…4(v=VS.85).aspx)
    3 = Sunday AND Monday!
    This value works only in TriggerEvent 3 or 5

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

    $DaysOfMonth => Integer http://msdn.microsoft.com/en-us/library/aa380735(VS.85).aspx
    This value is only noted when $TriggerEvent = 4
    Day 1; 1
    Day 2; 2
    Day 3; 4
    Day 4; 8
    Day 5; 16
    Day 6; 32
    Day 7; 64
    Day 8; 128
    Day 9; 256
    Day 10; 512
    Day 11; 1024
    Day 12; 2048
    Day 13; 4096
    Day 14; 8192
    Day 15; 16384
    Day 16; 32768
    Day 17; 65536
    Day 18; 131072
    Day 19; 262144
    Day 20; 524288
    Day 21; 1048576
    Day 22; 2097152
    Day 23; 4194304
    Day 24; 8388608
    Day 25; 16777216
    Day 26; 33554432
    Day 27; 67108864
    Day 28; 134217728
    Day 29; 268435456
    Day 30; 536870912
    Day 31; 1073741824
    Last Day; 2147483648

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

    $MonthOfYear => http://msdn.microsoft.com/en-us/library/…6(v=VS.85).aspx
    This value is only noted when $TriggerEvent = 4
    January; 1
    February; 2
    March; 4
    April; 8
    May; 16
    June; 32
    July; 64
    August; 128
    September; 256
    October; 512
    November; 1024
    December; 2048
    January + February = 3...

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

    $WeeksOfMonth => http://msdn.microsoft.com/en-us/library/…3(v=VS.85).aspx
    This value is only noted when $TriggerEvent = 5
    First; 1
    Second; 2
    Third; 4
    Fourth; 8
    Fifth; 16
    Last; 32

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

    $DaysInterval => Integer of Days Interval; http://msdn.microsoft.com/en-us/library/…0(v=VS.85).aspx
    This value is only noted when $TriggerEvent = 2

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

    $Interval => String for Interval; http://msdn.microsoft.com/en-us/library/…8(v=VS.85).aspx
    P<days>DT<hours>H<minutes>M<seconds>S (for example, "PT5M" is 5 minutes, "PT1H" is 1 hour, and "PT20M" is 20 minutes). The maximum time allowed is 31 days, and the minimum time allowed is 1 minute.

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

    $RepetitionEnabled => True = Interval Trigger enabled / False = Interval Trigger disabled

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

    $LogonType => 2 = TASK_LOGON_S4U / Independant from an userlogin
    3 = User must already be logged in
    ;http://msdn.microsoft.com/en-us/library/…v=VS.85%29.aspx

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

    $RunLevel => 0 = lowest, 1 = highest; http://msdn.microsoft.com/en-us/library/…v=VS.85%29.aspx
    Highest Need Admin-Rights!

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

    $Username => String with domainname "\" and Username. Use blank string ("") for actual user

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

    $Password => Password for the specified user

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

    $Program => String, Full Path and Programname to run

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

    $WorkingDirectory => Optional String

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

    $Arguments => Optional String

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

    $RunOnlyIfNetworkAvailable => Optional Boolean (Default = True)

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

    #ce

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

    Func _CreateTask($TaskName, $TaskDescription, $TriggerEvent, $StartTrigger, $EndTrigger, $DaysOfWeek, $DaysOfMonth, $MonthOfYear, $WeeksOfMonth, $DaysInterval, $Interval, $RepetitionEnabled, $LogonType, $RunLevel, $Username, $Password, $Program, $WorkingDirectory = "", $Arguments = "", $RunOnlyIfNetworkAvailable = True)
    If @OSVersion = "WIN_XP" Or @OSVersion = "WIN_XPe" Or @OSVersion = "WIN_2000" Then Return SetError (2, 2, 0)

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

    Local $oService, $oFolder, $oTaskDefinition, $oRegistrationInfo, $oSettings
    Local $oPrincipal, $oColActions, $oAction, $oTrigger, $oColTriggers, $oTriggerRepetition

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

    If $TaskName = "" Or $Program = "" Then Return SetError (1,1,1)

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

    ;http://www.scriptinganswers.com/forum2/forum_posts.asp?TID=3282
    ;http://www.autoit.de/index.php?page…4517#post214517
    ;http://msdn.microsoft.com/en-us/library/…v=VS.85%29.aspx
    $oMyError = ObjEvent("AutoIt.Error", "MyCreateTaskErrFunc") ; Initialize a COM error handler
    $oService = ObjCreate("Schedule.Service")
    $oService.Connect()

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

    $oFolder = $oService.GetFolder("\")
    $oTaskDefinition = $oService.NewTask(0)

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

    $oRegistrationInfo = $oTaskDefinition.RegistrationInfo()
    $oRegistrationInfo.Description() = $TaskDescription
    $oRegistrationInfo.Author() = @LogonDomain & "\" & @UserName

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

    $oSettings = $oTaskDefinition.Settings()
    $oSettings.MultipleInstances() = 0 ;Starts a new instance while an existing instance of the task is running.
    $oSettings.DisallowStartIfOnBatteries() = False
    $oSettings.StopIfGoingOnBatteries() = False
    $oSettings.AllowHardTerminate() = True
    $oSettings.StartWhenAvailable() = True ;Start task as soon as possible when task missed
    $oSettings.RunOnlyIfNetworkAvailable() = $RunOnlyIfNetworkAvailable

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

    $oSettings.Enabled() = True ;True ; The task can be performed only when this setting is True.
    $oSettings.Hidden() = False
    $oSettings.RunOnlyIfIdle() = False
    $oSettings.WakeToRun() = False
    $oSettings.ExecutionTimeLimit() = "P1D" ; When this parameter is set to Nothing, the execution time limit is infinite.
    $oSettings.Priority() = 5 ;http://msdn.microsoft.com/en-us/library/…0(v=VS.85).aspx 0 = Realtime, 10 = Idle

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

    $oPrincipal = $oTaskDefinition.Principal()
    $oPrincipal.Id() = @UserName
    $oPrincipal.DisplayName() = @UserName
    $oPrincipal.LogonType() = $LogonType
    $oPrincipal.RunLevel() = $RunLevel

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

    $oColTriggers = $oTaskDefinition.Triggers()
    $oTrigger = $oColTriggers.Create($TriggerEvent)

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

    $oTrigger.Id() = "TriggerID"
    $oTrigger.Enabled() = True
    $oTrigger.StartBoundary() = $StartTrigger
    $oTrigger.EndBoundary() = $EndTrigger
    If $TriggerEvent = 3 Or $TriggerEvent = 5 Then
    $oTrigger.DaysOfWeek() = $DaysOfWeek
    EndIf

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

    If $TriggerEvent = 4 Then
    $oTrigger.DaysOfMonth() = $DaysOfMonth
    $oTrigger.MonthsOfYear() = $MonthOfYear
    EndIf

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

    If $TriggerEvent = 5 Then
    $oTrigger.WeeksOfMonth() = $WeeksOfMonth
    EndIf

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

    If $TriggerEvent = 2 Then
    $oTrigger.DaysInterval() = $DaysInterval
    EndIf

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

    If $RepetitionEnabled Then
    $oTriggerRepetition = $oTrigger.Repetition()
    $oTriggerRepetition.Interval() = $Interval
    EndIf

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

    $oColActions = $oTaskDefinition.Actions()
    $oColActions.Context() = @UserName
    $oAction = $oTaskDefinition.Actions.Create(0)
    $oAction.Path() = $Program
    $oAction.WorkingDirectory() = $WorkingDirectory
    $oAction.Arguments() = $Arguments

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

    ; call rootFolder.RegisterTaskDefinition(strTaskName, taskDefinition, FlagTaskCreate, , , LogonTypeInteractive)
    $oFolder.RegisterTaskDefinition($TaskName, $oTaskDefinition, 6, $Username, $Password, $LogonType, "")

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

    If $ErrorFound Then Return SetError(1,1,0)
    Return 1
    EndFunc ;==>_CreateTask

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

    Func MyCreateTaskErrFunc()
    $ErrorFound = True
    Return 0

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

    MsgBox(0, "AutoItCOM Test", "We intercepted a COM Error !" & @CRLF & @CRLF & _
    "err.description is: " & @TAB & $oMyError.description & @CRLF & _
    "err.windescription:" & @TAB & $oMyError.windescription & @CRLF & _
    "err.number is: " & @TAB & Hex($oMyError.number, 8) & @CRLF & _
    "err.lastdllerror is: " & @TAB & $oMyError.lastdllerror & @CRLF & _
    "err.scriptline is: " & @TAB & $oMyError.scriptline & @CRLF & _
    "err.source is: " & @TAB & $oMyError.source & @CRLF & _
    "err.helpfile is: " & @TAB & $oMyError.helpfile & @CRLF & _
    "err.helpcontext is: " & @TAB & $oMyError.helpcontext _
    )

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

    Local $err = $oMyError.number
    Local $g_eventerror
    If $err = 0 Then $err = -1

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

    $g_eventerror = $err ; to check for after this function returns
    EndFunc ;==>MyCreateTaskErrFunc

    [/autoit]

    Grüsse Veronesi

    Edit: 08.04.2011 / 15:44 Kleine Ergänzung im Script: Nur ab Win7 und höher. Möglicherweise geht Vista auch.

  • TaskScheduler / Aufgabenplaner mittels ObjCreate("Schedule.Service") ansteuern

    • veronesi
    • 30. März 2011 um 09:50

    So, nun kann man auch auf täglicher Basis das Tagesinterval und die Wiederholung (stündlich, minütlich, alle 25 Minuten) eingeben.
    Hier das neue Program:

    Spoiler anzeigen
    [autoit]

    #include-once
    Dim $oMyError, $ErrorFound = False

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

    ;==================================================================================
    ; Function: _CreateTask($TaskName, $TaskDescription, $TriggerEvent, $StartTrigger, $EndTrigger, $DaysOfWeek, $DaysOfMonth, $MonthOfYear, $WeeksOfMonth, $DaysInterval, $Interval, $RepetitionEnabled, $Program, $WorkingDirectory = "", $Arguments = "", $RunOnlyIfNetworkAvailable = True)
    ; Description: Creates a scheduled task
    ; Parameter(s): $h_Window - Handle to the Window to update
    ; $i_Mode - Update Mode; 0=Small Update; 1=Normal Update.
    ; Return Value(s): On Success - Return 1, @ERROR = 0
    ; On Failure - Sets @ERROR = 1, Return 0
    ; Author(s): Unknown (http://www.autoit.de/index.php?page…4517#post214517)
    ; Changes: Veronesi
    ; Note(s):
    ; Example: _CreateTask("Testname", "Description of this task", 3, "2011-03-30T08:00:00", "2011-03-30T08:00:00", 2, 1, 1, 1, 1, "PT1H", False, "c:\windows\system32\notepad.exe", "c:\windows\system32", "", True)
    ;==================================================================================

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

    #cs
    _CreateTask($TaskName, $TaskDescription, $TriggerEvent, $StartTrigger, $EndTrigger, $DaysOfWeek, $DaysOfMonth, $MonthOfYear, $WeeksOfMonth, $DaysInterval, $Interval, $RepetitionEnabled, $Program, $WorkingDirectory = "", $Arguments = "", $RunOnlyIfNetworkAvailable = True)
    $TaskName => String, Free text

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

    $TaskDescription => String, Free text

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

    $TriggerEvent => http://msdn.microsoft.com/en-us/library/…v=VS.85%29.aspx
    (0: TASK_TRIGGER_EVENT; Triggers the task when a specific event occurs.) => Not working yet
    1: TASK_TRIGGER_TIME; Triggers the task at a specific time of day.
    2: TASK_TRIGGER_DAILY; Triggers the task on a daily schedule. For example, the task starts at a specific time every day, every-other day, every third day, and so on.
    3: TASK_TRIGGER_WEEKLY; Triggers the task on a weekly schedule. For example, the task starts at 8:00 AM on a specific day every week or other week.
    4: TASK_TRIGGER_MONTHLY; Triggers the task on a monthly schedule. For example, the task starts on specific days of specific months.
    5: TASK_TRIGGER_MONTHLYDOW; Triggers the task on a monthly day-of-week schedule. For example, the task starts on a specific days of the week, weeks of the month, and months of the year.
    6: TASK_TRIGGER_IDLE; Triggers the task when the computer goes into an idle state.
    7: TASK_TRIGGER_REGISTRATION; Triggers the task when the task is registered.
    8: TASK_TRIGGER_BOOT; Triggers the task when the computer boots. => Needs Admin-Rights!
    9: TASK_TRIGGER_LOGON; Triggers the task when a specific user logs on. => Needs Admin-Rights!
    11:TASK_TRIGGER_SESSION_STATE_CHANGE; Triggers the task when a specific session state changes. => Needs Admin-Rights!

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

    $StartTrigger => String with Start time / date (Year-Month-DayTHour:Min:Sec) E.g. "2011-03-30T08:00:00"

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

    $EndTrigger => String with End time / date (Year-Month-DayTHour:Min:Sec) E.g. "2011-03-30T08:00:00"

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

    $DaysOfWeek => Integer; 1 = Sunday / 2 = Monday / 4 = Tuesday / 8 = Wednesday / 16 = Thursday / 32 = Friday / 64 = Saturday (http://msdn.microsoft.com/en-us/library/…4(v=VS.85).aspx)
    3 = Sunday AND Monday!
    This value works only in TriggerEvent 3 or 5

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

    $DaysOfMonth => Integer http://msdn.microsoft.com/en-us/library/aa380735(VS.85).aspx
    This value is only noted when $TriggerEvent = 4
    Day 1; 1
    Day 2; 2
    Day 3; 4
    Day 4; 8
    Day 5; 16
    Day 6; 32
    Day 7; 64
    Day 8; 128
    Day 9; 256
    Day 10; 512
    Day 11; 1024
    Day 12; 2048
    Day 13; 4096
    Day 14; 8192
    Day 15; 16384
    Day 16; 32768
    Day 17; 65536
    Day 18; 131072
    Day 19; 262144
    Day 20; 524288
    Day 21; 1048576
    Day 22; 2097152
    Day 23; 4194304
    Day 24; 8388608
    Day 25; 16777216
    Day 26; 33554432
    Day 27; 67108864
    Day 28; 134217728
    Day 29; 268435456
    Day 30; 536870912
    Day 31; 1073741824
    Last Day; 2147483648

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

    $MonthOfYear => http://msdn.microsoft.com/en-us/library/…6(v=VS.85).aspx
    This value is only noted when $TriggerEvent = 4
    January; 1
    February; 2
    March; 4
    April; 8
    May; 16
    June; 32
    July; 64
    August; 128
    September; 256
    October; 512
    November; 1024
    December; 2048
    January + February = 3...

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

    $WeeksOfMonth => http://msdn.microsoft.com/en-us/library/…3(v=VS.85).aspx
    This value is only noted when $TriggerEvent = 5
    First; 1
    Second; 2
    Third; 4
    Fourth; 8
    Fifth; 16
    Last; 32

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

    $DaysInterval => Integer of Days Interval; http://msdn.microsoft.com/en-us/library/…0(v=VS.85).aspx
    This value is only noted when $TriggerEvent = 2

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

    $Interval => String for Interval; http://msdn.microsoft.com/en-us/library/…8(v=VS.85).aspx
    P<days>DT<hours>H<minutes>M<seconds>S (for example, "PT5M" is 5 minutes, "PT1H" is 1 hour, and "PT20M" is 20 minutes). The maximum time allowed is 31 days, and the minimum time allowed is 1 minute.

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

    $RepetitionEnabled => True = Interval Trigger enabled / False = Interval Trigger disabled

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

    $Program => String, Full Path and Programname to run

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

    $WorkingDirectory => Optional String

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

    $Arguments => Optional String

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

    $RunOnlyIfNetworkAvailable => Optional Boolean (Default = True)

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

    #ce

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

    Func _CreateTask($TaskName, $TaskDescription, $TriggerEvent, $StartTrigger, $EndTrigger, $DaysOfWeek, $DaysOfMonth, $MonthOfYear, $WeeksOfMonth, $DaysInterval, $Interval, $RepetitionEnabled, $Program, $WorkingDirectory = "", $Arguments = "", $RunOnlyIfNetworkAvailable = True)
    Local $oService, $oFolder, $oTaskDefinition, $oRegistrationInfo, $oSettings
    Local $oPrincipal, $oColActions, $oAction, $oTrigger, $oColTriggers, $oTriggerRepetition

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

    If $TaskName = "" Or $Program = "" Then Return SetError (1,1,1)

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

    ;http://www.scriptinganswers.com/forum2/forum_posts.asp?TID=3282
    ;http://www.autoit.de/index.php?page…4517#post214517
    ;http://msdn.microsoft.com/en-us/library/…v=VS.85%29.aspx
    $oMyError = ObjEvent("AutoIt.Error", "MyCreateTaskErrFunc") ; Initialize a COM error handler
    $oService = ObjCreate("Schedule.Service")
    $oService.Connect()

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

    $oFolder = $oService.GetFolder("\")
    $oTaskDefinition = $oService.NewTask(0)

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

    $oRegistrationInfo = $oTaskDefinition.RegistrationInfo()
    $oRegistrationInfo.Description() = $TaskDescription
    $oRegistrationInfo.Author() = @LogonDomain & "\" & @UserName

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

    $oSettings = $oTaskDefinition.Settings()
    $oSettings.MultipleInstances() = 0 ;Starts a new instance while an existing instance of the task is running.
    $oSettings.DisallowStartIfOnBatteries() = False
    $oSettings.StopIfGoingOnBatteries() = False
    $oSettings.AllowHardTerminate() = True
    $oSettings.StartWhenAvailable() = True ;Start task as soon as possible when task missed
    $oSettings.RunOnlyIfNetworkAvailable() = $RunOnlyIfNetworkAvailable

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

    $oSettings.Enabled() = True ;True ; The task can be performed only when this setting is True.
    $oSettings.Hidden() = False
    $oSettings.RunOnlyIfIdle() = False
    $oSettings.WakeToRun() = False
    $oSettings.ExecutionTimeLimit() = "P1D" ; When this parameter is set to Nothing, the execution time limit is infinite.
    $oSettings.Priority() = 5 ;http://msdn.microsoft.com/en-us/library/…0(v=VS.85).aspx 0 = Realtime, 10 = Idle

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

    $oPrincipal = $oTaskDefinition.Principal()
    $oPrincipal.Id() = @UserName
    $oPrincipal.DisplayName() = @UserName
    $oPrincipal.LogonType() = 3 ;http://msdn.microsoft.com/en-us/library/…v=VS.85%29.aspx 3 = User must already be logged in
    $oPrincipal.RunLevel() = 0 ;http://msdn.microsoft.com/en-us/library/…v=VS.85%29.aspx 0 = lowest, 1 = highest

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

    $oColTriggers = $oTaskDefinition.Triggers()
    $oTrigger = $oColTriggers.Create($TriggerEvent)

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

    $oTrigger.Id() = "TriggerID"
    $oTrigger.Enabled() = True
    $oTrigger.StartBoundary() = $StartTrigger
    $oTrigger.EndBoundary() = $EndTrigger
    If $TriggerEvent = 3 Or $TriggerEvent = 5 Then
    $oTrigger.DaysOfWeek() = $DaysOfWeek
    EndIf

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

    If $TriggerEvent = 4 Then
    $oTrigger.DaysOfMonth() = $DaysOfMonth
    $oTrigger.MonthsOfYear() = $MonthOfYear
    EndIf

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

    If $TriggerEvent = 5 Then
    $oTrigger.WeeksOfMonth() = $WeeksOfMonth
    EndIf

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

    If $TriggerEvent = 2 Then
    $oTrigger.DaysInterval() = $DaysInterval
    EndIf

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

    If $RepetitionEnabled Then
    $oTriggerRepetition = $oTrigger.Repetition()
    $oTriggerRepetition.Interval() = $Interval
    EndIf

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

    $oColActions = $oTaskDefinition.Actions()
    $oColActions.Context() = @UserName
    $oAction = $oTaskDefinition.Actions.Create(0)
    $oAction.Path() = $Program
    $oAction.WorkingDirectory() = $WorkingDirectory
    $oAction.Arguments() = $Arguments

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

    ; call rootFolder.RegisterTaskDefinition(strTaskName, taskDefinition, FlagTaskCreate, , , LogonTypeInteractive)
    $oFolder.RegisterTaskDefinition($TaskName, $oTaskDefinition, 6, "", "", 3, "")

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

    If $ErrorFound Then Return SetError(1,1,0)
    Return 1
    EndFunc ;==>_CreateTask

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

    Func MyCreateTaskErrFunc()
    $ErrorFound = True
    Return 0

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

    MsgBox(0, "AutoItCOM Test", "We intercepted a COM Error !" & @CRLF & @CRLF & _
    "err.description is: " & @TAB & $oMyError.description & @CRLF & _
    "err.windescription:" & @TAB & $oMyError.windescription & @CRLF & _
    "err.number is: " & @TAB & Hex($oMyError.number, 8) & @CRLF & _
    "err.lastdllerror is: " & @TAB & $oMyError.lastdllerror & @CRLF & _
    "err.scriptline is: " & @TAB & $oMyError.scriptline & @CRLF & _
    "err.source is: " & @TAB & $oMyError.source & @CRLF & _
    "err.helpfile is: " & @TAB & $oMyError.helpfile & @CRLF & _
    "err.helpcontext is: " & @TAB & $oMyError.helpcontext _
    )

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

    Local $err = $oMyError.number
    Local $g_eventerror
    If $err = 0 Then $err = -1

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

    $g_eventerror = $err ; to check for after this function returns
    EndFunc ;==>MyCreateTaskErrFunc

    [/autoit]
  • TaskScheduler / Aufgabenplaner mittels ObjCreate("Schedule.Service") ansteuern

    • veronesi
    • 30. März 2011 um 08:18

    So, nun konnte ich das Beispiel zum laufen bringen.

    Dann habe ich noch (wirklich ganz kurz) eine kleine Funktion daraus gemacht, mit welcher man ziemlich viele Einstellmöglichkeiten hat, um den Task zu erstellen.
    Damit das Ganze auch korrekt dokumentiert ist, stelle ich es hier nun ein!

    Spoiler anzeigen
    [autoit]

    #include-once
    Dim $oMyError, $ErrorFound = False

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

    ;==================================================================================
    ; Function: _CreateTask($TaskName, $TaskDescription, $TriggerEvent, $StartTrigger, $EndTrigger, $DaysOfWeek, $DaysOfMonth, $MonthOfYear, $WeeksOfMonth, $Program, $WorkingDirectory = "", $Arguments = "", $RunOnlyIfNetworkAvailable = True)
    ; Description: Creates a scheduled task
    ; Parameter(s): $h_Window - Handle to the Window to update
    ; $i_Mode - Update Mode; 0=Small Update; 1=Normal Update.
    ; Return Value(s): On Success - Return 1, @ERROR = 0
    ; On Failure - Sets @ERROR = 1, Return 0
    ; Author(s): Unknown (http://www.autoit.de/index.php?page…4517#post214517)
    ; Changes: Veronesi
    ; Note(s):
    ; Example: _CreateTask("Testname", "Description of this task", 3, "2011-03-30T08:00:00", "2011-03-30T08:00:00", 2, 1, 1, 1, "c:\windows\system32\notepad.exe", "c:\windows\system32", "", True)
    ;==================================================================================

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

    #cs
    _CreateTask($TaskName, $TaskDescription, $TriggerEvent, $StartTrigger, $EndTrigger, $DaysOfWeek, $DaysOfMonth, $MonthOfYear, $WeeksOfMonth, $Program, $WorkingDirectory = "", $Arguments = "", $RunOnlyIfNetworkAvailable = True)
    $TaskName => String, Free text

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

    $TaskDescription => String, Free text

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

    $TriggerEvent => http://msdn.microsoft.com/en-us/library/…v=VS.85%29.aspx
    (0: TASK_TRIGGER_EVENT; Triggers the task when a specific event occurs.) => Not working yet
    1: TASK_TRIGGER_TIME; Triggers the task at a specific time of day.
    2: TASK_TRIGGER_DAILY; Triggers the task on a daily schedule. For example, the task starts at a specific time every day, every-other day, every third day, and so on.
    3: TASK_TRIGGER_WEEKLY; Triggers the task on a weekly schedule. For example, the task starts at 8:00 AM on a specific day every week or other week.
    4: TASK_TRIGGER_MONTHLY; Triggers the task on a monthly schedule. For example, the task starts on specific days of specific months.
    5: TASK_TRIGGER_MONTHLYDOW; Triggers the task on a monthly day-of-week schedule. For example, the task starts on a specific days of the week, weeks of the month, and months of the year.
    6: TASK_TRIGGER_IDLE; Triggers the task when the computer goes into an idle state.
    7: TASK_TRIGGER_REGISTRATION; Triggers the task when the task is registered.
    8: TASK_TRIGGER_BOOT; Triggers the task when the computer boots. => Needs Admin-Rights!
    9: TASK_TRIGGER_LOGON; Triggers the task when a specific user logs on. => Needs Admin-Rights!
    11:TASK_TRIGGER_SESSION_STATE_CHANGE; Triggers the task when a specific session state changes. => Needs Admin-Rights!

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

    $StartTrigger => String with Start time / date (Year-Month-DayTHour:Min:Sec) E.g. "2011-03-30T08:00:00"

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

    $EndTrigger => String with End time / date (Year-Month-DayTHour:Min:Sec) E.g. "2011-03-30T08:00:00"

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

    $DaysOfWeek => Integer; 1 = Sunday / 2 = Monday / 4 = Tuesday / 8 = Wednesday / 16 = Thursday / 32 = Friday / 64 = Saturday (http://msdn.microsoft.com/en-us/library/…4(v=VS.85).aspx)
    3 = Sunday AND Monday!
    This value works only in TriggerEvent 3 or 5

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

    $DaysOfMonth => Integer http://msdn.microsoft.com/en-us/library/aa380735(VS.85).aspx
    This value is only noted when $TriggerEvent = 4
    Day 1; 1
    Day 2; 2
    Day 3; 4
    Day 4; 8
    Day 5; 16
    Day 6; 32
    Day 7; 64
    Day 8; 128
    Day 9; 256
    Day 10; 512
    Day 11; 1024
    Day 12; 2048
    Day 13; 4096
    Day 14; 8192
    Day 15; 16384
    Day 16; 32768
    Day 17; 65536
    Day 18; 131072
    Day 19; 262144
    Day 20; 524288
    Day 21; 1048576
    Day 22; 2097152
    Day 23; 4194304
    Day 24; 8388608
    Day 25; 16777216
    Day 26; 33554432
    Day 27; 67108864
    Day 28; 134217728
    Day 29; 268435456
    Day 30; 536870912
    Day 31; 1073741824
    Last Day; 2147483648

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

    $MonthOfYear => http://msdn.microsoft.com/en-us/library/…6(v=VS.85).aspx
    This value is only noted when $TriggerEvent = 4
    January; 1
    February; 2
    March; 4
    April; 8
    May; 16
    June; 32
    July; 64
    August; 128
    September; 256
    October; 512
    November; 1024
    December; 2048
    January + February = 3...

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

    $WeeksOfMonth => http://msdn.microsoft.com/en-us/library/…3(v=VS.85).aspx
    This value is only noted when $TriggerEvent = 5
    First; 1
    Second; 2
    Third; 4
    Fourth; 8
    Fifth; 16
    Last; 32

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

    $Program => String, Full Path and Programname to run

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

    $WorkingDirectory => Optional String

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

    $Arguments => Optional String

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

    $RunOnlyIfNetworkAvailable => Optional Boolean (Default = True)

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

    #ce

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

    Func _CreateTask($TaskName, $TaskDescription, $TriggerEvent, $StartTrigger, $EndTrigger, $DaysOfWeek, $DaysOfMonth, $MonthOfYear, $WeeksOfMonth, $Program, $WorkingDirectory = "", $Arguments = "", $RunOnlyIfNetworkAvailable = True)
    Local $oService, $oFolder, $oTaskDefinition, $oRegistrationInfo, $oSettings
    Local $oPrincipal, $oColActions, $oAction, $oTrigger, $oColTriggers

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

    If $TaskName = "" Or $Program = "" Then Return SetError (1,1,1)

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

    ;http://www.scriptinganswers.com/forum2/forum_posts.asp?TID=3282
    ;http://www.autoit.de/index.php?page…4517#post214517
    ;http://msdn.microsoft.com/en-us/library/…v=VS.85%29.aspx
    $oMyError = ObjEvent("AutoIt.Error", "MyCreateTaskErrFunc") ; Initialize a COM error handler
    $oService = ObjCreate("Schedule.Service")
    $oService.Connect()

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

    $oFolder = $oService.GetFolder("\")
    $oTaskDefinition = $oService.NewTask(0)

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

    $oRegistrationInfo = $oTaskDefinition.RegistrationInfo()
    $oRegistrationInfo.Description() = $TaskDescription
    $oRegistrationInfo.Author() = @LogonDomain & "\" & @UserName

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

    $oSettings = $oTaskDefinition.Settings()
    $oSettings.MultipleInstances() = 0 ;Starts a new instance while an existing instance of the task is running.
    $oSettings.DisallowStartIfOnBatteries() = False
    $oSettings.StopIfGoingOnBatteries() = False
    $oSettings.AllowHardTerminate() = True
    $oSettings.StartWhenAvailable() = True ;Start task as soon as possible when task missed
    $oSettings.RunOnlyIfNetworkAvailable() = $RunOnlyIfNetworkAvailable

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

    $oSettings.Enabled() = True ;True ; The task can be performed only when this setting is True.
    $oSettings.Hidden() = False
    $oSettings.RunOnlyIfIdle() = False
    $oSettings.WakeToRun() = False
    $oSettings.ExecutionTimeLimit() = "P1D" ; When this parameter is set to Nothing, the execution time limit is infinite.
    $oSettings.Priority() = 5 ;http://msdn.microsoft.com/en-us/library/…0(v=VS.85).aspx 0 = Realtime, 10 = Idle

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

    $oPrincipal = $oTaskDefinition.Principal()
    $oPrincipal.Id() = @UserName
    $oPrincipal.DisplayName() = @UserName
    $oPrincipal.LogonType() = 3 ;http://msdn.microsoft.com/en-us/library/…v=VS.85%29.aspx 3 = User must already be logged in
    $oPrincipal.RunLevel() = 0 ;http://msdn.microsoft.com/en-us/library/…v=VS.85%29.aspx 0 = lowest, 1 = highest

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

    $oColTriggers = $oTaskDefinition.Triggers()
    $oTrigger = $oColTriggers.Create($TriggerEvent)

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

    $oTrigger.Id() = "TriggerID"
    $oTrigger.Enabled() = True
    $oTrigger.StartBoundary() = $StartTrigger
    $oTrigger.EndBoundary() = $EndTrigger
    If $TriggerEvent = 3 Or $TriggerEvent = 5 Then
    $oTrigger.DaysOfWeek() = $DaysOfWeek
    EndIf

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

    If $TriggerEvent = 4 Then
    $oTrigger.DaysOfMonth() = $DaysOfMonth
    $oTrigger.MonthsOfYear() = $MonthOfYear
    EndIf

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

    If $TriggerEvent = 5 Then
    $oTrigger.WeeksOfMonth() = $WeeksOfMonth
    EndIf

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

    $oColActions = $oTaskDefinition.Actions()
    $oColActions.Context() = @UserName
    $oAction = $oTaskDefinition.Actions.Create(0)
    $oAction.Path() = $Program
    $oAction.WorkingDirectory() = $WorkingDirectory
    $oAction.Arguments() = $Arguments

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

    ; call rootFolder.RegisterTaskDefinition(strTaskName, taskDefinition, FlagTaskCreate, , , LogonTypeInteractive)
    $oFolder.RegisterTaskDefinition($TaskName, $oTaskDefinition, 6, "", "", 3, "")

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

    If $ErrorFound Then Return SetError(1,1,0)
    Return 1
    EndFunc ;==>_CreateTask

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

    Func MyCreateTaskErrFunc()
    $ErrorFound = True
    Return 0

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

    MsgBox(0, "AutoItCOM Test", "We intercepted a COM Error !" & @CRLF & @CRLF & _
    "err.description is: " & @TAB & $oMyError.description & @CRLF & _
    "err.windescription:" & @TAB & $oMyError.windescription & @CRLF & _
    "err.number is: " & @TAB & Hex($oMyError.number, 8) & @CRLF & _
    "err.lastdllerror is: " & @TAB & $oMyError.lastdllerror & @CRLF & _
    "err.scriptline is: " & @TAB & $oMyError.scriptline & @CRLF & _
    "err.source is: " & @TAB & $oMyError.source & @CRLF & _
    "err.helpfile is: " & @TAB & $oMyError.helpfile & @CRLF & _
    "err.helpcontext is: " & @TAB & $oMyError.helpcontext _
    )

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

    Local $err = $oMyError.number
    Local $g_eventerror
    If $err = 0 Then $err = -1

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

    $g_eventerror = $err ; to check for after this function returns
    EndFunc ;==>MyCreateTaskErrFunc

    [/autoit]

    Wenn jemand das noch erweitern möchte, damit man noch mehr Optionen hat, so kann er es gerne wieder hier einstellen, so dass dies allen nützt!
    Vor allem folgenden Optionen wäre ich interessiert:
    - Nur Ausführen, wenn der Benutzer angemeldet ist / bw. Unabhängig davon
    - Mit höchsten Privilegien
    - Beim Ausführen der Aufgaben folgendes Benutzerkonto verwenden.....

    Danke + Grüsse
    Veronesi

  • TaskScheduler / Aufgabenplaner mittels ObjCreate("Schedule.Service") ansteuern

    • veronesi
    • 29. März 2011 um 14:25

    Hallo Diggidie,

    vielen Dank für die Antwort. Leider nützt mir das nichts, da ich es momentan genau über die schtasks erzeuge.
    Mein Problem ist, dass ich Zugriff auf u.a. folgende Dinge haben müsste:
    - Aufgabe nur starten, falls Computer im Netzbetrieb ausgeführt wird
    - Nur starten, wenn folgende Netzwerkverbindung verfügbar ist: .....
    - Aufgabe so schnell wie möglich nach einem verpassten Start ausführen
    - Falls Aufgabe scheitert, neu starten alle:...

    Das kann ich leider nicht als Parameter bei der schtasks mitgeben.
    Hat dazu jemand eine Idee?

    PS: Mein Problem ist, dass ich das Skript aus dem ersten Beitrag nicht zum laufen kriege (Win7 x64)

  • TaskScheduler / Aufgabenplaner mittels ObjCreate("Schedule.Service") ansteuern

    • veronesi
    • 29. März 2011 um 11:02

    Hallo KaFu,

    Du hast das anscheinend erfolgreich lösen können.
    Hast Du daraus mal eine Funktion gemacht, welcher man sämtliche Parameter übergeben kann?
    Ich meine so, dass ich mit einem Funktionsaufruf einen Task erstellen kann und bei dem sämtliche Möglichkeiten der Taskerstellung ausgeschöpft werden können?

    Wäre toll, wenn Du so eine Funktion (falls vorhanden oder in Kürze machbar) hier noch einstellen könntest.

    Vielen Dank!
    Veronesi

  • DirCopy funktioniert nicht, warum?

    • veronesi
    • 21. März 2011 um 18:54

    Aus der Hilfe:

    source dir: Pfad zum Quellordner ohne abschließenden Backslash (z.B. "C:\Path1")
    dest dir: Pfad zum Zielordner ohne abschließenden Backslash (z.B. "C:\Path_Copy")

  • Checkbox deaktivieren aber nicht "ausgrauen"

    • veronesi
    • 21. März 2011 um 14:51

    Tschuldigung... falsch verstanden! ;)

  • Checkbox deaktivieren aber nicht "ausgrauen"

    • veronesi
    • 21. März 2011 um 13:40

    Super, danke!
    Das wäre die einfachste Lösung gewesen... Aber naja. Nun ist es schon gemacht!
    Das hätte ich in der Hilfe klarer formuliert.....

    Cheers!

  • Checkbox deaktivieren aber nicht "ausgrauen"

    • veronesi
    • 21. März 2011 um 13:02

    Hallo Progandy,

    das ist ja sehr interessant.
    Aber woher weiss ich dass $BS_Checkbox verhindert, dass das Häkchen manuell verändert werden kann?
    In der Hilfe steht bloss:

    Creates a small, empty check box with a label displayed to the right of it. To display the text to the left of the check box, combine this flag with the BS_RIGHTBUTTON style.

  • Checkbox deaktivieren aber nicht "ausgrauen"

    • veronesi
    • 21. März 2011 um 08:34

    Hallo Grossvater

    Super! Genau das wollte ich! Vielen Dank.
    Das ist mir gar nicht in den Sinn gekommen.

    Danke auf den Anderen für die Antworten.
    Ich habe Grossvaters' Idee umgesetzt, weil dies die kleinste Änderung im Skript bedeutete.
    Dass ich die Checkboxen auch ohne Text machen könnte und statt dessen Labels dahinter, wäre auch eine gute Idee gewesen, aber so ist es für mich die kleinere Änderung.

    Vielen Dank!
    Grüsse Veronesi

  • Checkbox deaktivieren aber nicht "ausgrauen"

    • veronesi
    • 21. März 2011 um 07:22

    Hallo zusammen,

    für ein Projekt müsste ich auf einer GUI Checkboxen darstellen. Diese sollen nicht ausgegraut sein, damit man den Text noch gut lesen kann.
    Aber der Benutzer darf sie auch nicht manuell setzen oder zurücksetzen können!

    Ist sowas möglich?
    PS: Ich möchte nicht mit einem Adlibregister alle paar Millisekunden die Checkboxen zurücksetzen, weil in diesem Programm laufen schon genügen "Timer" im Hintergrund, welche den PC ganz schön belasten werden.

    Vielen Dank für Eure Ideen!
    Grüsse Veronesi

  • Ungewollte Transparenz bei GUICtrlSetImage

    • veronesi
    • 13. März 2011 um 10:22

    Vielen Dank!
    Ich werde mir das genau anschauen. Sieht interessant aus.
    Damit kann ich sicher etwas machen!

    Nochmals Danke!
    Gruss Veronesi

  • Ungewollte Transparenz bei GUICtrlSetImage

    • veronesi
    • 12. März 2011 um 15:49

    Vielen Dank! Und kein Stress! Ich kann das sowieso erst morgen anschauen!

  • Ungewollte Transparenz bei GUICtrlSetImage

    • veronesi
    • 12. März 2011 um 15:29

    Eingebetteter IE? Tönt interessant.
    Ich habe nur mal was mit einem eingebetteten IE und Texten gemacht, weil man dann HTML Tags und somit ein ansprechendes Design gestalten konnte!

    Du hast nicht zufällig ein Beispiel mit einem Bild?
    Mit GDI+ kenne ich mich (noch) nicht aus. Hätte das viele Vorteile?
    Oder wäre ich (da ich GDI+ nicht kenne) mit dem IE besser bedient?

    Edit: für mich muss es vor allem schnell sein und die Transparenz muss funktionieren. Kriege ich das mit dem IE hin?

  • Ungewollte Transparenz bei GUICtrlSetImage

    • veronesi
    • 12. März 2011 um 13:26

    Hallo!
    Entschuldigt, dass ich diesen Thread wieder ausgrabe, aber ich habe ein ähnliches Problem.
    Ich zeige auf der GUI kurz nacheinander mehrere transparente Bilder.
    Das klappt auch wunderbar. Aber bei manchen Bildern sieht man im Hintergrund an gewissen Stellen das letzte und ggfs vorletzte Bild!!

    Bisher habe ich es immer so gemacht, dass ich VOR dem eigentlichen Bild kurz ein vollständig schwarzes Bild setze. Das ist zwar schneller, als wenn man das Bild löscht und neu erstellt, aber am liebsten hätte ich es noch schneller, damit es weniger "blinkt"!

    Habe ich da was übersehen?
    Grüße Veronesi

  • Konzeptfrage / StdoutRead

    • veronesi
    • 11. März 2011 um 15:43

    Hallo Chip!
    Nicht übel! Die Idee scheint mir gar nicht so schlecht! Ich lese alle Bilder in ein Array und erstelle je ein GUICtrlCreatePic.
    Das laden dauert auf meinem PC 1,6 Sekunden für die 152 Bilder. Danach kann ich sie so schnell durchlaufen lassen, dass ich fast gar keines sehe ;)

    Vielen Dank!

  • Konzeptfrage / StdoutRead

    • veronesi
    • 11. März 2011 um 15:31

    ;) Logo!
    Danke für die Tipps!

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™