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

Beiträge von Micha_he

  • hilfe bin neu hier

    • Micha_he
    • 23. März 2011 um 16:12

    Man erkennt im Titel nicht ob das Thema in den eigenen Wissensbereich fällt und muss das Thema erst öffnen und lesen.
    Vielen öffnen unter Umständen ein derartiges Thema gar nicht mehr, wenn ein Titel so unaussagekräftig ist.

    Edit: Schau in der Hilfe unter...

    [autoit]

    _IELinkClickByText()
    _IENavigate()
    _IELinkGetCollection()

    [/autoit]
  • hilfe bin neu hier

    • Micha_he
    • 23. März 2011 um 15:57

    Erster Fehler: Dein Titel "hilfe ich bin neu hier"
    Mit so einem Titel weiß jeder gleich worum es geht, oder ?

    Zweiter Fehler: Kein Beispielscript. So rät jeder was Du eigentlich meinst.
    Na gut, Du bist ja neu ;-))

  • Wandeln String nach Makro- Referenz

    • Micha_he
    • 19. März 2011 um 15:58

    Meinst Du ?

    [autoit]

    $Str = "@WindowsDir"
    MsgBox(4096, "", $Str) ; ==> Anzeige @WindowsDir

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

    ;$Dir = @WindowsDir
    $Dir = Execute($Str)
    MsgBox(4096, "", $Dir) ; ==> Anzeige C:\Windows

    [/autoit]
  • Performance bei strings kopieren

    • Micha_he
    • 19. März 2011 um 15:53
    Zitat von Dustmaster80


    An der 3. und 4. Stelle steht die länge der für mich relevanten Daten im String.

    Das der 3. Parameter die Länge ist, steht ja in der AutoIt-Hilfe. Ist mir also Klar.
    Aber warum gibts Du den Parameter in Binär/Hexform an ?

  • Performance bei strings kopieren

    • Micha_he
    • 19. März 2011 um 14:46
    Zitat von Dustmaster80

    $sRaw = $sRaw & StringMid($string,10, "0x" & StringMid($string, 2, 2)*2)

    Ohne zu Testen, fällt mir eines auf: Was machst Du mit "0x" im Count-Parameter (3te) der StringMid-Funktion ?

  • Festplatte indizieren?

    • Micha_he
    • 18. März 2011 um 15:50

    Wenn Du schon mit FileFindNextFile() arbeitest, prüfe doch jedesmal mit FileGetAttrib() auf das "D" für einen Ordner.
    In diesem Falle lässt Du den Eintrag weg und fährst mit dem nächsten fort.

  • Datum berechnen

    • Micha_he
    • 18. März 2011 um 15:09

    Ich hatte gerade Lust darauf:

    [autoit]

    #Include <Date.au3>
    $iYear = @Year
    $iMonth = @Mon
    If @MDay > 13 Then $iMonth += 1
    While 1
    If _DateToDayOfWeek($iYear, $iMonth, 13) = 6 Then
    Msgbox(0,"","Der nächsten 'Freitag der 13.' ist : 13." & $iMonth & "." & $iYear)
    Exit
    EndIf
    $iMonth += 1
    If $iMonth = 13 Then
    $iMonth = 1
    $iYear += 1
    EndIf
    Wend

    [/autoit]

    Edit: Bessere Variante !
    Edit2: Nochmal erweitert !
    Edit3: Andere Variante (es werden nur die Freitage geprüft, was etwas schnelle sein sollte)

    [autoit]

    #Include <Date.au3>
    $add = 6 - @WDay
    If $add = -1 Then $add = 6
    $nextDate = _DateAdd("D", $add, _NowCalcDate())
    While 1
    If StringMid($nextDate, StringInStr($nextDate, "/", 1, -1) + 1) = "13" Then
    Msgbox(0,"","Der nächsten 'Freitag der 13.' ist : " & _DateTimeFormat($nextDate, 2))
    Exit
    EndIf
    $nextDate = _DateAdd("D", 7, $nextDate)
    Wend

    [/autoit]
  • Verlinkung

    • Micha_he
    • 18. März 2011 um 14:10
    Zitat von BadBunny

    Hast du es schonmal mit

    [autoit]

    ShellExecute()

    [/autoit]

    versucht?

    Das wäre doch in seinem Fall egal. Wenn alles richtig ist, muss es auch mit Run() funktionieren.

    Zum Ausschließen von Fehlern, könnte er schonmal

    [autoit]

    Run ('C:\Programme\AutoIt3\AutoIt3.exe C:\Programme\AutoIt3\test.au3')

    [/autoit]


    schreiben. Da die Pfade nicht variabel sind und keine Leerzeichen enthalten, kann man das "&" und auch die Anführungszeichen vereinfachen.

  • auf 2 Optionen prüfen mit WinWait

    • Micha_he
    • 17. März 2011 um 16:14

    Ich würde das wie folgt lösen:

    [autoit]

    $start = TimerInit()
    Do
    If WinExists("Titel1") Then ExitLoop
    If WinExists("Titel2") Then ExitLoop
    Sleep(50)
    Until TimerDiff($start) > 5000 ; Timeout 5000 = 5s

    [/autoit]


    ungetestet

  • Benutzerkontosteuerung verhindern

    • Micha_he
    • 12. März 2011 um 00:58

    Na klar !

  • Benutzerkontosteuerung verhindern

    • Micha_he
    • 11. März 2011 um 17:11
    Zitat von SEuBo

    In das ProgramFilesDir (C:\Program Files\) kann nur geschrieben werden, wenn das Programm über Adminrechte verfügt. Verfügt das Programm über keine Adminrechte, leitet Windows das ganze um, und die Dateien werden in das Benutzerverzeichnis geschoben - frag mich allerdings nicht wohin, das weiß ich nämlich nicht mehr.

    Oder man ändert auch hier nach der Installation eines Programms nach @ProgramFilesDir die Berechtigung, damit ein Benutzer ändern darf. Dies ist zwar nicht die feine Art, aber eine letzte Möglichkeit.

    Das mit dem Umlenken der Schreibzugriffe auf einen Ordner der vom User beschrieben werden kann, soll aber erst ab Windows7 gehen. Ich habe Windows7 Pro 64bit, kann dies aber bisher nicht bestätigen. Wenn ich als User versuche in einem Systemordner etwas zu schreiben, taucht die UAC auf. Es wird also nix umgelenkt und das Ist auch gut so, so entsteht nach kurzer Zeit ein riesen Chaos.

    Die sauberste Lösung ist nunmal: User schreiben nur in HKCU, @AppDataDir, @DesktopDir, @UserProfileDir u.ä.

  • Benutzerkontosteuerung verhindern

    • Micha_he
    • 11. März 2011 um 12:33
    Zitat von MehmeX

    Oh man, ist das kompliziert. Ich habe es mal ohne #RequireAdmin gestartet und da kam dann kein UAC. Das Problem ist nur, wenn ich es ohne #RequireAdmin starte, kann das Programm keine Registry Einträge etc. schreiben.

    Wenn das Script mit Userrecht in der Regstry schreiben soll dann entweder nur in HKCU wie Autobert es schrieb oder Du stelltst die Zugriffsrechte des Registryzweiges so um, das auch Anwender dort "ändern" dürfen.

    Oder Du lebst mit "#RequireAdmin" was deinem Script ja "anweist", sich Adminrechte zu besorgen. Dann musst Du auch mit der UAC leben, bzw. solltest froh sein das sie "nachfragt", sonst würde das Script ja gar nicht arebiten !

  • PID herausfinden

    • Micha_he
    • 14. Februar 2011 um 07:01

    Ich benutze folgende Funktion:

    _ShellExecuteEx
    [autoit]

    ; =================================================================================================
    ; Func _ShellExecuteEx($sCmd, $sParams = "", $sFolder = "", $sVerb = "", $iState = @SW_SHOWNORMAL,$bCloseProcessHandle=True)
    ;
    ; Parameters are the same as ShellExecute(), except for the addition of:
    ;
    ; $bCloseProcessHandle = If True (recommended unless planning on using Process Handles),
    ; then the Process Handle (if received) is closed
    ; If False, the Process Handle (if received) is returned - this can be used to do additional work with Processes
    ; Usage is mostly recommended for the _ShellExecuteExWait() function and/or getting exit code.
    ;
    ; Return is different from ShellExecute() in the following way:
    ; Success: @error = 0, and either the process ID (if $bCloseProcessHandle is True, and process ID received) is returned,
    ; or a 2-element array (if $bCloseProcessHandle is False):
    ; $array[0]=Process ID if new process started (and process handle+ID received),
    ; $array[1]=Process Handle if new process started (and process handle received)
    ; Failure: @error set and 0 is returned
    ; @error = 1 = parameters error
    ; @error = 2 = call failed (probably due to parameter error. can use _WinAPI_GetLastError())
    ;
    ; NOTE: Recommended to run on Windows 2000 or higher because:
    ; According to Microsoft at http://msdn2.microsoft.com/en-us/library/bb762154.aspx,
    ; Windows 95/98/Me: ShellExecuteEx is supported by the Microsoft Layer for Unicode (MSLU).
    ; To use this, you must add certain files to your application,
    ; as outlined in Microsoft Layer for Unicode on Windows Me/98/95 Systems.
    ; So it appears it will break on those machines without MSLU(?)
    ;
    ; Initial Code from MrCreatoR on AutoIt Forum Topic:: http://www.autoitscript.com/forum/index.php?showtopic=69868
    ; Enhancements/Modifications by: Ascend4nt
    ; (including process handle/ID extract & close-handle code, plus Unicode/path enhancements, & CoInitializeEx call)
    ; =================================================================================================

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

    Func _ShellExecuteEx($sCmd, $sParams = "", $sFolder = "", $sVerb = "", $iState = @SW_SHOWNORMAL,$bCloseProcessHandle=True)
    Local $stINFO,$stVerb,$stPath,$stArgs,$stWDir,$aRet,$hWnd=0,$aProcessArray[2]=[0,0]
    Local $iParamLen,$iCmdLen,$iFolderLen

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

    $iParamLen=StringLen($sParams)
    ; Verify string lengths are less than maximum.
    ; Through testing, 1997 (1996+1 NULL-term) is the maximum parameter length for this call (Unicode)
    If $iParamLen>1996 Then Return SetError(1,0,0)

    $iCmdLen=StringLen($sCmd)
    ; Verify string lengths are less than maximum. [MAX_PATH is 260, but Unicode allows exceptions]
    ; 32767 max length for Unicode strings if prefixed with '\\?\'
    If $iCmdLen>259 Then
    ; 32767-NULL=32766 - 4 (\\?\) = 32762
    If $iCmdLen>(32766-4) Then Return SetError(1,0,0)
    $sCmd='\\?\' & $sCmd
    EndIf

    $iFolderLen=StringLen($sFolder)
    ; Verify string lengths are less than maximum. [MAX_PATH is 260, but Unicode allows exceptions]
    ; 32767 max length for Unicode strings if prefixed with '\\?\'
    If $iFolderLen>259 Then
    ; 32767-NULL=32766 - 4 (\\?\) = 32762
    If $iFolderLen>(32766-4) Then Return SetError(1,0,0)
    $sFolder='\\?\' & $sFolder
    EndIf

    ; Setup string structures
    $stVerb = DllStructCreate("wchar["&(StringLen($sVerb)+1)&"]")
    $stPath = DllStructCreate("wchar[" &($iCmdLen+1)& "];wchar")
    $stArgs = DllStructCreate("wchar[" &($iParamLen+1)& "];wchar")
    $stWDir = DllStructCreate("wchar[" &($iFolderLen+1)& "];wchar")

    ; Initialize string structures (which are then used by pointer in the larger SHELLEXECUTEINFO structure)
    DllStructSetData($stVerb, 1, $sVerb)
    DllStructSetData($stPath, 1, $sCmd)
    DllStructSetData($stWDir, 1, $sFolder)
    DllStructSetData($stArgs, 1, $sParams)

    ; SHELLEXECUTEINFO structure
    $stINFO = DllStructCreate("ulong;ulong;long;ptr;ptr;ptr;ptr;long;long;ptr;ptr;long;ulong;long;long")

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

    ; SHELLEXECUTEINFO structure initialize
    DllStructSetData($stINFO, 1, DllStructGetSize($stINFO)) ; cbSize, size (in bytes) of structure
    ; ------------------------------------------------------------------------------------------------------
    ; fMask Options:
    ; 0x40 = SEE_MASK_NOCLOSEPROCESS. The 15th element in structure (hProcess) will be set with the Process handle
    ; NOTE: per MSDN, this handle *must* be closed by the caller. (similar to how "OpenProcess" must use "CloseProcess")
    ; 0x400 = SEE_MASK_FLAG_NO_UI = Do not display an error message box if an error occurs.
    ; This is not default ShellExecute() behavior, which will display the error message box
    ; ------------------------------------------------------------------------------------------------------
    DllStructSetData($stINFO, 2, BitOR(0x40,0x400)) ; fMask
    ; HWND - MSDN: A window handle to any message boxes that the system might produce while executing this function.
    DllStructSetData($stINFO, 3, $hWnd) ; Is this supposed to *receive* instead of send? I have yet to get clarity on this.
    DllStructSetData($stINFO, 4, DllStructGetPtr($stVerb)) ; lpVerb: pointer to the verb string
    DllStructSetData($stINFO, 5, DllStructGetPtr($stPath)) ; lpFile: pointer to the $cmd string
    DllStructSetData($stINFO, 6, DllStructGetPtr($stArgs)) ; lpParameters: pointer to the parameters/arguments string
    DllStructSetData($stINFO, 7, DllStructGetPtr($stWDir)) ; lpDirectory: pointer to working directory string
    DllStructSetData($stINFO, 8, $iState) ; nShow = state to show window as

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

    #cs
    ; ------------------------------------------------------------------------------------------------------
    ; Per MSDN Documentation, the following call should be done prior to calling ShellExecuteEx:
    ; CoInitializeEx(NULL, COINIT_APARTMENTTHREADED | COINIT_DISABLE_OLE1DDE) ; COINIT_APARTMENTTHREADED = 0x2,COINIT_DISABLE_OLE1DDE = 0x4
    ; Reason:
    ; "Because ShellExecuteEx can delegate execution to Shell extensions (data sources, context menu handlers, verb implementations)
    ; that are activated using Component Object Model (COM), COM should be initialized before ShellExecuteEx is called.
    ; Some Shell extensions require the COM single-threaded apartment (STA) type. In that case, COM should be initialized as shown here.
    ; There are certainly instances where ShellExecuteEx does not use one of these types of Shell extension and those instances would not
    ; require COM to be initialized at all. Nonetheless, it is good practice to always initalize COM before using this function."
    ; ------------------------------------------------------------------------------------------------------
    #ce
    DllCall("ole32.dll", "int", "CoInitializeEx", "ptr", Chr(0), "dword", BitOR(2,4))
    ; I don't care if it succeeds. Doesn't seem to make much difference even to call it.

    $aRet=DllCall("shell32.dll", "int", "ShellExecuteExW", "ptr", DllStructGetPtr($stINFO))

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

    If @error Or Not $aRet[0] Then
    ; DLLStructDelete()'s:
    $stINFO=0
    $stVerb=0
    $stPath=0
    $stArgs=0
    $stWDir=0
    Return SetError(2,@error,0)
    EndIf
    ; Get Process Handle, if one exists (non-NULL if new process started, otherwise
    ; NULL if app that performs 'verb' is already running, or is perhaps a 'properties' dialog etc)
    $aProcessArray[1]=DllStructGetData($stINFO,15)
    ; Get Process ID from Handle
    If ($aProcessArray[1]) Then
    $aRet=DllCall("Kernel32.dll","dword","GetProcessId","long",$aProcessArray[1])
    If IsArray($aRet) Then $aProcessArray[0]=$aRet[0]
    EndIf

    ;ConsoleWrite("Handle passed to function:" & Number($hWnd) & ", Handle AFTER call:" & Number(DllStructGetData($stINFO,3)) & @CRLF)
    ;ConsoleWrite("Process Handle:" & Number($hProcess) & ", Process ID:" & Number($vProcessID) & @CRLF)

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

    ; Close Handle
    If $bCloseProcessHandle And $aProcessArray[1] Then DllCall('kernel32.dll','ptr', 'CloseHandle','ptr', $aProcessArray[1])

    ; DLLStructDelete()'s:
    $stINFO=0
    $stVerb=0
    $stPath=0
    $stArgs=0
    $stWDir=0
    If ($bCloseProcessHandle) Then Return SetError(0,0,$aProcessArray[0])
    SetError(0,0)
    Return $aProcessArray
    EndFunc

    [/autoit]
  • Win XP nochmal installieren

    • Micha_he
    • 11. Februar 2011 um 15:48
    Zitat von floschlo

    Wass soll ich tun

    Ich würde sagen: Dumm aus der Wäsche gucken !
    Dummheit wird halt manchmal bestraft, z.B. mit dem Erwerb einer neuen Betriebssystemlizenz !

  • Eigener "Software"Drucker

    • Micha_he
    • 9. Februar 2011 um 15:27

    Hä ?

    basementmedia hat doch noch nicht einmal gesagt, was das zweite Autoit-Tool mit der übergebenen PDF-Datei macht !

    Aber Du weist schon, wie er sie bearbeiten muss !? Nicht schlecht.

  • Eigener "Software"Drucker

    • Micha_he
    • 9. Februar 2011 um 14:27
    Zitat von danielsan85

    Ich mache das immer mit PDFCreator.

    FreePDFXP war ja auch nur ein Vorschlag vieler Möglichkeiten.

    Mir gefällt es von der Oberfläche her am besten, weil man einfach umschalten kann zwischen : Einer oder mehrerer Seiten / Speichern oder Versenden per Mail (was dann in basementmedia's Fall die Übergabe an das Autoit-Script wäre).

  • Eigener "Software"Drucker

    • Micha_he
    • 8. Februar 2011 um 17:20

    Warum das Rad neu erfinden ? FreePDFXP kann dies doch schon.

    Einfach in der Config unter Pfade als fpmailer das Tool eintragen und wenn man aus dem Dialog "per Mail senden" auswählt (kann man auch automatisieren) dann wird das temporäre PDF an das Tool übergeben.

  • Knut reloaded 2011

    • Micha_he
    • 4. Februar 2011 um 16:17

    Nur gering 'lustig' !

  • In ACCESS Tabelle schreiben

    • Micha_he
    • 2. Februar 2011 um 15:56

    Ich habe den Test auch einmal durchgeführt. Auch WinXP & Office 2k. Gleiches Problem !

    Scheinbar funktioniert die Methode "Version" des Access.Application-Objekts, welches in der AccessConstants.au3 genutzt wird, nicht.
    Und bei denen welche keine Access-Installation haben, wird das Objekt schon nicht erzeugt, daher taucht kein Fehler auf und der Provider-String bleibt auf 'Standard'.

    Als Workarround kann ich Dir folgendes anbieten. In der 'AccessConstants.au3' ganz am Ende in der Funktion '_adoProvider()' die zweite Zeile wie folgt abändern:

    [autoit]

    Local $objCheck ;= ObjCreate("Access.application")

    [/autoit]

    Meiner Meinung nach funktioniert das dann so lange man 'nur Windows' oder 'bis Office 2003' hat. Ab 'Office 2007' wird ein anderer ADO-Provider-String benötigt. Dies sollte die Funktion ja eigentlich auch machen. Nur eine universelle Lösung fällt mir zur Zeit auch nicht ein. Man müsste die Version der ODBC-Treiber ermitteln können !

  • In ACCESS Tabelle schreiben

    • Micha_he
    • 1. Februar 2011 um 18:01
    Zitat von HaTe

    MMhhh... glaube nicht dass es am PW liegt. Wenn ich die Access.au3 schon ausführen will kommt der gleiche Fehler.

    Dann leg Dir doch zum Test eine Dummy-DB mit einer Tabelle zum testen an !

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™