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

Beiträge von UEZ

  • Check Ping Status v1.05 Build 2014-09-19 Beta

    • UEZ
    • 27. November 2011 um 22:49

    Salut wakillon,

    merci de vos commentaires - devrait maintenant fonctionner parfaitement.

    Cordialement,
    UEZ

  • GDI+ bild als Button benutzen

    • UEZ
    • 27. November 2011 um 12:50

    Du kannst auch ein Bild laden und es in den Button senden. Siehe hier: File to Base64 String Code Generator v1.03 Build 2011-11-21 (1. Beispiel).


    Oder:

    Spoiler anzeigen
    [autoit]


    ;By Malkey
    #include <GuiConstantsEx.au3>
    #include <GDIPlus.au3>
    #include <WindowsConstants.au3>

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

    Opt("MouseCoordMode", 2) ;1=absolute, 0=relative, 2=client

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

    Global $hGUI, $hGraphicGUI, $hBMPBuff

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

    _Main()
    Func _Main()
    Local $hBMP, $hBitmap, $hGraphic, $hImage, $iX, $iY, $hClone, $t, $aMPos
    Local $GuiSizeX = 400, $GuiSizeY = 300
    Local $pngFile = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\AutoIt v3\AutoIt", "InstallDir") _
    & "\Examples\GUI\Advanced\Images\Button.png"

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

    ; Create GUI
    $hGUI = GUICreate("GDI+", $GuiSizeX, $GuiSizeY)
    ;GUISetBkColor(0xFFFFEF)
    GUISetState()

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

    _GDIPlus_Startup()

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

    $hBitmap = _GDIPlus_ImageLoadFromFile($pngFile)
    $hGraphicGUI = _GDIPlus_GraphicsCreateFromHWND($hGUI)
    $hBMPBuff = _GDIPlus_BitmapCreateFromGraphics($GuiSizeX, $GuiSizeY, $hGraphicGUI)
    $hGraphic = _GDIPlus_ImageGetGraphicsContext($hBMPBuff)

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

    _GDIPlus_GraphicsDrawImage($hGraphic, $hBitmap, 0, 0)
    GUIRegisterMsg(0xF, "MY_PAINT"); Register PAINT-Event 0x000F = $WM_PAINT (WindowsConstants.au3)
    GUIRegisterMsg(0x85, "MY_PAINT") ; $WM_NCPAINT = 0x0085 (WindowsConstants.au3)Restore after Minimize.
    _GDIPlus_GraphicsDrawImage($hGraphicGUI, $hBMPBuff, 0, 0)

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

    Do
    $aMPos = MouseGetPos()
    If ispressed("01") Then
    Select
    Case _WinAPI_PtInRectEx($aMPos[0], $aMPos[1], 5, 5, 112, 56)
    MsgBox(0, "", " Top button clicked", 1)
    Case _PointInEllipse($aMPos[0], $aMPos[1], 122, 100, 132, 45)
    MsgBox(0, "", "Middle elliptic button clicked", 1)
    Case _WinAPI_PtInRectEx($aMPos[0], $aMPos[1], 5, 192, 112, 243)
    MsgBox(0, "", "Lowest button clicked", 1)
    EndSelect
    EndIf
    Until GUIGetMsg() = $GUI_EVENT_CLOSE

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

    ; Clean up resources
    _GDIPlus_GraphicsDispose($hGraphicGUI)
    _GDIPlus_GraphicsDispose($hGraphic)
    _GDIPlus_BitmapDispose($hBitmap)
    _GDIPlus_BitmapDispose($hBMPBuff)
    _GDIPlus_Shutdown()

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

    EndFunc ;==>_Main

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

    ; ($xPt, $yPt) - x, y position of the point to check
    ; $xTL, $yTL, Top left x Pos, top left Y position of the rectangle encompassing the ellipse.
    ; $w, $h - The width an height of ellipse
    ; http://www.autoitscript.com/forum/index.ph…ndpost&p=639786
    ;
    Func _PointInEllipse($xPt, $yPt, $xTL, $yTL, $w, $h)
    Local $bInside = False, $a = $w / 2, $b = $h / 2
    Local $c1X, $c2X, $dist, $xc = $xTL + $a, $yc = $yTL + $b
    $c1X = $xc - ($a ^ 2 - $b ^ 2) ^ (1 / 2); 1st focal point x position
    $c2X = $xc + ($a ^ 2 - $b ^ 2) ^ (1 / 2); 2nd focal point x position
    $dist = (($xPt - $c1X) ^ 2 + ($yPt - $yc) ^ 2) ^ 0.5 + (($xPt - $c2X) ^ 2 + ($yPt - $yc) ^ 2) ^ 0.5
    If $dist <= $w Then $bInside = Not $bInside
    Return $bInside
    EndFunc ;==>_PointInEllipse

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

    ; ($iX, $iY) - x, y position of the point to check
    ; ($iLeft, $iTop) - x, y position of the top left corner of rectangle
    ; ($iRight, $iBottom) - x, y position of the bottom right corner of rectangle
    ; http://www.autoitscript.com/forum/index.ph…ndpost&p=639786
    ;
    Func _WinAPI_PtInRectEx($iX, $iY, $iLeft, $iTop, $iRight, $iBottom)
    Local $aResult
    Local $tRect = DllStructCreate($tagRECT)
    DllStructSetData($tRect, "Left", $iLeft)
    DllStructSetData($tRect, "Top", $iTop)
    DllStructSetData($tRect, "Right", $iRight)
    DllStructSetData($tRect, "Bottom", $iBottom)
    $aResult = DllCall("User32.dll", "int", "PtInRect", "ptr", DllStructGetPtr($tRect), "int", $iX, "int", $iY)
    If @error Then Return SetError(@error, 0, False)
    Return $aResult[0] <> 0
    EndFunc ;==>_WinAPI_PtInRectEx

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

    ; Copied from ...\Include\Misc.au3 File
    Func IsPressed($sHexKey)
    Local $a_R = DllCall('user32.dll', "int", "GetAsyncKeyState", "int", '0x' & $sHexKey)
    If Not @error And BitAND($a_R[0], 0x8000) = 0x8000 Then Return 1
    Return 0
    EndFunc ;==>IsPressed

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

    ;Func to redraw on PAINT MSG
    Func MY_PAINT($hWnd, $msg, $wParam, $lParam)
    _GDIPlus_GraphicsDrawImage($hGraphicGUI, $hBMPBuff, 0, 0)
    _WinAPI_RedrawWindow($hGUI, "", "", BitOR($RDW_INVALIDATE, $RDW_FRAME, $RDW_ALLCHILDREN)) ;
    Return $GUI_RUNDEFMSG
    EndFunc ;==>MY_PAINT

    [/autoit]

    Oder:

    Spoiler anzeigen
    [autoit]


    ;By smashly
    #include <GuiConstantsEx.au3>
    #include <GDIPlus.au3>
    #include <WinAPI.au3>

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

    _Main()

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

    Func _Main()
    Local $hGUI, $iPicButton, $hGraphic, $hImage, $hBitmap1, $hGraphic1, $hBMP1, $iMsg
    Local $pngFile = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\AutoIt v3\AutoIt", "InstallDir") _
    & "\Examples\GUI\Advanced\Images\Button.png"

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

    $hGUI = GUICreate("GDI+", 400, 300)
    GUISetBkColor(0x000000, $hGUI)
    $iPicButton = GUICtrlCreatePic("", 10, 10, 82, 36)
    GUISetState()

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

    _GDIPlus_Startup()

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

    $hImage = _GDIPlus_ImageLoadFromFile($pngFile)
    $hGraphic = _GDIPlus_GraphicsCreateFromHWND($hGUI)

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

    $hBitmap1 = _GDIPlus_BitmapCreateFromGraphics(82, 36, $hGraphic)
    $hGraphic1 = _GDIPlus_ImageGetGraphicsContext($hBitmap1)
    _GDIPlus_GraphicsDrawImageRectRect($hGraphic1, $hImage, 11, 145, 82, 36, 0, 0, 82, 36)
    $hBMP1 = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hBitmap1)

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

    _GDIPlus_GraphicsDispose($hGraphic1)
    _GDIPlus_BitmapDispose($hBitmap1)
    _GDIPlus_GraphicsDispose($hGraphic)
    _GDIPlus_ImageDispose($hImage)
    _GDIPlus_Shutdown()

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

    _WinAPI_DeleteObject(GUICtrlSendMsg($iPicButton, 0x0172, 0, $hBMP1))

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

    While 1
    $iMsg = GUIGetMsg()
    Switch $iMsg
    Case $GUI_EVENT_CLOSE
    _WinAPI_DeleteObject($hBMP1)
    ExitLoop
    Case $iPicButton
    MsgBox(64, "Picture Clicked", "Yep picture has been clicked")
    EndSwitch
    WEnd
    EndFunc ;==>_Main

    [/autoit]


    Gruß,
    UEZ

  • Raupi - alles Gute zum Geburtstag!

    • UEZ
    • 26. November 2011 um 19:56

    Happy Birthday to you und alles Gute!

    Gruß,
    UEZ

  • _FilePathTrimToLimit

    • UEZ
    • 24. November 2011 um 22:12

    Die Lösung des Problems ist hier: _GuiCtrlSetPath

    Gruß,
    UEZ

  • _GuiCtrlSetPath

    • UEZ
    • 24. November 2011 um 16:29

    Ich habe mal die WinAPIEx gecheckt und da ist bereits die Funktion implementiert... Aber egal!

    Gruß,
    UEZ

  • GDI+ String zentrieren

    • UEZ
    • 24. November 2011 um 16:19

    Hilft dir vielleicht _GDIPlus_StringFormatSetAlign() weiter?

    Gruß,
    UEZ

  • _GuiCtrlSetPath

    • UEZ
    • 24. November 2011 um 16:02

    Cool, was so in der WinAPI alles steckt!

    Gruß,
    UEZ

  • _FilePathTrimToLabelWidth

    • UEZ
    • 24. November 2011 um 13:29

    Du kannst das Skript extrem beschleunigen, wenn du _GDIPlus_Startup() / _GDIPlus_Shutdown() vorher aufrufst!

    Spoiler anzeigen
    [autoit]


    #include <GDIPlus.au3>
    _GDIPlus_Startup()

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

    $iFontSize = 24
    $sFontname = 'Times New Roman'
    ;~ $sFontname = 'Courier New'
    $hGui = GUICreate('Test', 600, 200)
    GUISetFont($iFontSize, 400, 0, $sFontname)
    $hPath1 = GUICtrlCreateLabel('', 10, 10, 300, 50)
    GUICtrlSetBkColor(-1, 0xCCCCCC)
    $hPath2 = GUICtrlCreateLabel('', 10, 80, 580, 50)
    GUICtrlSetBkColor(-1, 0xCCCCCC)
    GUISetState()

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

    ; Beispiel 1
    $sPath1 = 'c:\Users\Oscar\Pictures\Urlaub2011\Pic1045.jpg'
    $iTimer = TimerInit()
    $sPath1 = _FilePathTrimToLabelWidth($sPath1, $hGui, $hPath1, $iFontSize, $sFontname)
    ConsoleWrite(Int(TimerDiff($iTimer)) & ' mSec.' & @CR)
    GUICtrlSetData($hPath1, $sPath1)

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

    ; Beispiel 2
    $sPath2 = '\\Server\d\Backup\Users\Oscar\Pictures\Urlaub2011\Pic1045.jpg'
    $iTimer = TimerInit()
    $sPath2 = _FilePathTrimToLabelWidth($sPath2, $hGui, $hPath2, $iFontSize, $sFontname)
    ConsoleWrite(Int(TimerDiff($iTimer)) & ' mSec.' & @CR)
    GUICtrlSetData($hPath2, $sPath2)

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

    Do
    Until GUIGetMsg() = -3
    _GDIPlus_Shutdown()

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

    ;===============================================================================
    ; Function Name: _FilePathTrimToLabelWidth($sFilepath, $CtrlID, $iFontSize, $sFontname)
    ; Description:: Begrenzt einen Dateipfad auf die Breite eines Labels.
    ; Dabei wird er aber nicht vorn oder hinten abgeschnitten,
    ; sondern es bleibt das Device erhalten und der rechte Teil
    ; des Pfades.
    ; Parameter(s): $sFilepath = der Pfad, der gekürzt werden soll
    ; $hGui = das Handle des Fensters
    ; $CtrlID = die Control ID des Label
    ; $iFontSize = Fontgröße
    ; $sFontname = Fontname
    ; Requirement(s): #include <GDIPlus.au3>
    ; Return Value(s): Der gekürzte Pfad
    ; Author(s): Oscar + UEZ + peethebee (http://www.autoit.de)
    ;===============================================================================
    Func _FilePathTrimToLabelWidth($sFilepath, $hGui, $CtrlID, $iFontSize, $sFontname)
    Local $sDevice, $iLen = StringLen($sFilepath)
    Local $iSize = _GetStringSize($sFilepath, $sFontname, $iFontSize, 0)
    Local $aPosCtrl = ControlGetPos($hGui, '', $CtrlID)
    If $iSize < $aPosCtrl[2] Then Return $sFilepath
    $sDevice = StringRegExpReplace($sFilepath, '([a-z]:\\|\\\\.+?\\[a-z]\\).+', '$1') & '...'
    For $i = $iLen - StringLen($sDevice) To 1 Step -1
    $iSize = _GetStringSize($sDevice & StringRight($sFilepath, $i), $sFontname, $iFontSize, 0)
    If $iSize < $aPosCtrl[2] Then ExitLoop
    Next
    Return $sDevice & StringRight($sFilepath, $i)
    EndFunc ;==>_FilePathTrimToLabelWidth

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

    Func _GetStringSize($string, $font, $fontsize, $fontstyle)
    Local $GDIp = False
    Local $iWidth = StringLen($string) * $fontsize
    Local $iHeight = 2 * $fontsize
    If Not $ghGDIPDll Then
    _GDIPlus_Startup()
    $GDIp = True
    EndIf
    Local $aResult = DllCall($ghGDIPDll, 'uint', 'GdipCreateBitmapFromScan0', 'int', $iWidth, 'int', $iHeight, 'int', 0, 'int', 0x0026200A, 'ptr', 0, 'int*', 0)
    Local $hBitmap = $aResult[6]
    Local $hGrphContext = _GDIPlus_ImageGetGraphicsContext($hBitmap)
    Local $hFormat = _GDIPlus_StringFormatCreate()
    Local $hFamily = _GDIPlus_FontFamilyCreate($font)
    Local $hFont = _GDIPlus_FontCreate($hFamily, $fontsize, $fontstyle)
    Local $tLayout = _GDIPlus_RectFCreate(0, 0, 0, 0)
    Local $aInfo = _GDIPlus_GraphicsMeasureString($hGrphContext, $string, $hFont, $tLayout, $hFormat)
    _GDIPlus_FontDispose($hFont)
    _GDIPlus_FontFamilyDispose($hFamily)
    _GDIPlus_StringFormatDispose($hFormat)
    _GDIPlus_BitmapDispose($hBitmap)
    _GDIPlus_GraphicsDispose($hGrphContext)
    If $GDIp Then _GDIPlus_Shutdown()
    Return Int(DllStructGetData($aInfo[0], 'Width'))
    EndFunc ;==>_GetStringSize

    [/autoit]

    Gruß,
    UEZ

  • _FilePathTrimToLimit

    • UEZ
    • 24. November 2011 um 13:26

    War auch nur eine "Studie". Leider dauert das Erstellen in _FilePathTrimToLabelWidth zu lange.

    Ich schaue mal, ob mir dazu noch was einfällt....

    Gruß,
    UEZ

  • Fenster verkleinern

    • UEZ
    • 24. November 2011 um 12:28

    Z.B. das IE Fenster im Vollbildmodus unter Win7:

    [autoit]


    $hIE = WinGetHandle("[CLASS:IEFrame; INSTANCE:1]", "")
    WinSetState($hIE, "", @SW_RESTORE)

    [/autoit]

    Gruß,
    UEZ

  • _FilePathTrimToLimit

    • UEZ
    • 24. November 2011 um 10:31

    Und dies hier?

    Spoiler anzeigen
    [autoit]


    #include <GDIPlus.au3>

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

    $iFontSize = 12
    $sFontname = 'Courier New'
    $hGui = GUICreate('Test', 400, 200)
    GUISetFont($iFontSize, 400, 0, $sFontname)
    $hPath1 = GUICtrlCreateLabel('', 10, 10, 280, 20)
    GUICtrlSetBkColor(-1, 0xCCCCCC)
    $hPath2 = GUICtrlCreateLabel('', 10, 60, 300, 20)
    GUICtrlSetBkColor(-1, 0xCCCCCC)
    GUISetState()

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

    ; Beispiel 1
    $sPath1 = 'c:\Users\Oscar\Pictures\Urlaub2011\Pic1045.jpg'
    $sPath1 = _FilePathTrimToLimit($sPath1, $hPath1, $iFontSize, $sFontname)
    GUICtrlSetData($hPath1, $sPath1)

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

    ; Beispiel 2
    $sPath2 = '\\Server\d\Backup\Users\Oscar\Pictures\Urlaub2011\Pic1045.jpg'
    $sPath2 = _FilePathTrimToLimit($sPath2, $hPath2, $iFontSize, $sFontname)
    GUICtrlSetData($hPath2, $sPath2)

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

    Do
    Until GUIGetMsg() = -3

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

    ;===============================================================================
    ; Function Name: _FilePathTrimToLimit($sFilepath, $iLimit)
    ; Description:: Begrenzt einen Dateipfad auf eine anzugebene Stringlänge.
    ; Dabei wird er aber nicht vorn oder hinten abgeschnitten,
    ; sondern es bleibt das Device erhalten und der rechte Teil
    ; des Pfades.
    ; Parameter(s): $sFilepath = der Pfad, der gekürzt werden soll
    ; $CtrlID = die Control ID des Label
    ; $iFontSize = die Fontgröße des Labels
    ; $sFontname = Font Name
    ; Requirement(s): ---
    ; Return Value(s): Der gekürzte Pfad
    ; Author(s): Oscar (http://www.autoit.de)
    ;===============================================================================
    Func _FilePathTrimToLimit($sFilepath, $CtrlID, $iFontSize, $sFontname)
    Local $aSize = GetStringSize($sFilepath, $sFontname, $iFontSize, 0)
    Local $aPosCtrl = ControlGetPos("", "", $CtrlID)
    Local $iLimit = StringLen($sFilepath) - Ceiling(Ceiling(1 + ($aSize[0] - $aPosCtrl[2]) / 100) + ($aSize[0] - $aPosCtrl[2]) / $iFontSize)
    Local $sDevice, $iLen = StringLen($sFilepath)
    If $iLimit < 1 Or $iLimit >= $iLen Then Return $sFilepath
    $sDevice = StringRegExpReplace($sFilepath, '([a-z]:\\|\\\\.+?\\[a-z]\\).+', '$1') & '...'
    Return $sDevice & StringRight($sFilepath, $iLimit - StringLen($sDevice))
    EndFunc ;==>_FilePathTrimToLimit

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

    Func GetStringSize($string, $font, $fontsize, $fontstyle)
    Local $GDIp = False
    Local $iWidth = StringLen($string) * $fontsize
    Local $iHeight = 2 * $fontsize
    If Not $ghGDIPDll Then
    _GDIPlus_Startup()
    $GDIp = True
    EndIf
    Local $aResult = DllCall($ghGDIPDll, "uint", "GdipCreateBitmapFromScan0", "int", $iWidth, "int", $iHeight, "int", 0, "int", 0x0026200A, "ptr", 0, "int*", 0)
    Local $hBitmap = $aResult[6]
    Local $hGrphContext = _GDIPlus_ImageGetGraphicsContext($hBitmap)
    ;~ Local $hBrush = _GDIPlus_BrushCreateSolid(0xFF000000)
    Local $hFormat = _GDIPlus_StringFormatCreate()
    Local $hFamily = _GDIPlus_FontFamilyCreate($font)
    Local $hFont = _GDIPlus_FontCreate($hFamily, $fontsize, $fontstyle)
    Local $tLayout = _GDIPlus_RectFCreate(0, 0, 0, 0)
    Local $aInfo = _GDIPlus_GraphicsMeasureString($hGrphContext, $string, $hFont, $tLayout, $hFormat)
    ;~ _GDIPlus_GraphicsDrawStringEx($hGrphContext, $string, $hFont, $aInfo[0], $hFormat, $hBrush)
    _GDIPlus_FontDispose($hFont)
    _GDIPlus_FontFamilyDispose($hFamily)
    _GDIPlus_StringFormatDispose($hFormat)
    ;~ _GDIPlus_BrushDispose($hBrush)
    _GDIPlus_BitmapDispose($hBitmap)
    _GDIPlus_GraphicsDispose($hGrphContext)
    If $GDIp Then _GDIPlus_Shutdown()
    Local $aDim[2] = [Int(DllStructGetData($aInfo[0], "Width")), Int(DllStructGetData($aInfo[0], "Height"))]
    Return $aDim
    EndFunc

    [/autoit]

    Gruß,
    UEZ

  • _FilePathTrimToLimit

    • UEZ
    • 24. November 2011 um 09:34

    Nette Funktion!

    Cool wäre es, wenn die Funktion anhand der String Länge respektiv Font Größe und die Länge/Breite des Label berechnen würde.

    Wenn du z.B. in deinem Beispiel die Zeile

    $hPath1 = GUICtrlCreateLabel('', 10, 10, 380, 20)

    in

    $hPath1 = GUICtrlCreateLabel('', 10, 10, 280, 20)

    umänderst, dann fehlt ein Teil des Dateinamens.

    Gruß,
    UEZ

  • skript endet nicht als exe

    • UEZ
    • 23. November 2011 um 14:47

    So würde auch das nicht machen!

    Eher so:

    [autoit]


    $run = Run(@ComSpec & " /k ipconfig", "", @SW_SHOW)

    [/autoit]

    Gruß,
    UEZ

  • Check Ping Status v1.05 Build 2014-09-19 Beta

    • UEZ
    • 23. November 2011 um 14:06

    Danke für den Hinweis! Kann ich vielleicht bei Gelegenheit einbauen, wenn es Sinn macht.

    http://www.downforeveryoneorjustme.com/www.amazon.de funzt auch nicht!

    Gruß,
    UEZ

  • Check Ping Status v1.05 Build 2014-09-19 Beta

    • UEZ
    • 23. November 2011 um 12:58

    Und wieder ein kleines Update.

    Gruß,
    UEZ

  • Bilder verpacken

    • UEZ
    • 22. November 2011 um 20:55

    Oder hier: File to Base64 String Code Generator v1.03 Build 2011-11-21

    Gruß,
    UEZ

  • Remotestart

    • UEZ
    • 22. November 2011 um 11:24

    Ich hab's mal getestet und Notepad.exe wird zwar gestartet, aber man bekommt die GUI nicht zu sehen!

    Spoiler anzeigen
    [autoit]


    Func _RemoteStart($Program, $RemoteComputer, $ShowWindow, $usr, $pass)
    ;ShowWindow = 1 => Show / 0 => Hide
    Local $oWMIService, $oStartup, $oConfig, $oProcess
    Local $iProcessID, $iReturn
    Local $objWMILocator = ObjCreate("WbemScripting.SWbemLocator")
    Local $oWMIService = $objWMILocator.ConnectServer($RemoteComputer, "\root\cimv2", $usr, $pass, "", "", 128)
    ;~ $oWMIService = ObjGet("winmgmts:{impersonationLevel=impersonate,authenticationLevel=pktPrivacy, (Debug)}!\\" & $RemoteComputer & "\root\cimv2")

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

    $oStartup = $oWMIService.Get("Win32_ProcessStartup")
    $oConfig = $oStartup.SpawnInstance_
    $oConfig.ShowWindow = $ShowWindow

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

    $oProcess = $oWMIService.Get("Win32_Process")
    $iReturn = $oProcess.Create($Program, Default, $oConfig, $iProcessID)

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

    $oWMIService = 0
    $oStartup = 0
    $oConfig = 0
    $oProcess = 0

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

    If $iReturn <> 0 Then
    Return False
    Else
    Return True
    EndIf
    EndFunc ;==>_RemoteStart

    [/autoit]

    Der Prozess wird unter svchost.exe -> wmiprvse.exe -> notepad.exe aufgehängt.

    Gruß,
    UEZ

  • Remotestart

    • UEZ
    • 22. November 2011 um 11:08

    Hast du auf dem Remote System die entsprechenden Rechte? Das Skript versucht mit den angemeldeten Account auf dem Remote Computer zuzugreifen.

    Gruß,
    UEZ

  • cd rippen

    • UEZ
    • 21. November 2011 um 19:48

    Schaue mal hier rein: Audio CD To Wave Or MP3

    Gruß,
    UEZ

  • [Beispiel] - Fenster Sliden (hinein- hinausgeleiten) auf dem Desktop - optimiert für Multi-Monitorlösungen

    • UEZ
    • 21. November 2011 um 15:47

    Funzt nicht im Multi Monitor Betrieb (siehe Bild)!

    Du kannst z.B. die Größe so abfragen:

    [autoit]


    $hFullScreen = WinGetHandle("[TITLE:Program Manager;CLASS:Progman]")
    $aFullScreen = WinGetPos($hFullScreen)

    [/autoit]

    In aFullScreen stehen die Infos.
    Bei mir:

    Code
    @@ Debug(3) : $aFullScreen[0] = -1280
    >Error code: 0
    @@ Debug(4) : $aFullScreen[1] = 0
    >Error code: 0
    @@ Debug(5) : $aFullScreen[2] = 2960
    >Error code: 0
    @@ Debug(6) : $aFullScreen[3] = 1050

    Gruß,
    UEZ

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™