Vllt funktioniert es, wenn du bei ObjCreate den Usernamen und das Passwort angibst.
Beiträge von funkey
-
-
Beim Edit verwendest du am besten das RichEdit um Bilder anzuzeigen.
-
Saguhilla:
Es gibt überhaupt keinen Grund, diesen gelösten Thread nach über 1000 Tagen wiederzubeleben!!
Schon gar nicht, wenn der Code fast identisch mit dem aus Post 7 uind Post 21 ist!!
Außerdem würde ich dir empfehlen, dass du dir einen anderen Avatar suchst. Dein jetziger gehört BugFix, und den hat kein anderer verdient! -
-
Ich hatte da mal so was gemacht. Allerdings mit GraphicControls.
-
Da waren ja wieder mal geniale Sprüche dabei!!
Danke für'S Sammeln Sprenger120! -
ShellExecuteWait wird immer erolgreich ausgeführt, da das Programm ja gestartet werden kann. Du solltest RunWait verwenden und den @exitCode auswerten.
-
Auch von mir noch alles Gute zum Geburtstag!! Bleib so wie du bist, vor allem aber gesund!
-
Hab die Funktion noch ein wenig erweitert, damit das Control mit neuem Text und Farben upgedatet werden kann.
Code nun komplett in AutoIt. Siehe Post#1 -
Schau dir mal ControlCommand an.
-
Wen meinst du, UEZ?

AndyTR: Der Nachteil bei meiner Methode ist, das GuiCtrlSetData() nicht mehr funktionieren kann, weil das Label in ein Pic-Control umgewandelt wird und der Text im Bild enthalten ist.
-
Hab hier keine neue Version hochgeladen!
Hab nur gesagt, dass bei GuiCreate die Position zu ändern wäre! 
Außerdem habe ich das ganze jetzt selbst mal schnell nach AutoIt übersetzt und zwischenzeitlich hier gepostet.
-
Das Programm muss als x86 ausgeführt werden.
Außerdem habe ich vergessen, die Position bei GuiCreate zu ändern. Das hatte ich nur schnell eingefügt, um die Gui auf dem zweiten Bildschrim anzuzeigen. -
Irgendwo im Forum gab es eine Anfrage für sowas. UEZ hat das zwar gelöst, aber mir hatte es noch nicht ganz gefallen.
Mit der Funktion _LabelMakeTranslucent() wird ein Label (Static) in ein Pic-Control (ebenfalls Static) umgewandelt. Danach wird der Bildbereich eines darunterliegenden Pic-Controls in das ehemalige Label geladen.
Viel Spaß
Spoiler anzeigen
[autoit]
[/autoit] [autoit][/autoit] [autoit]
#region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_Res_LegalCopyright=funkey
#AutoIt3Wrapper_UseX64=n
#endregion ;**** Directives created by AutoIt3Wrapper_GUI ****#include <GDIPlus.au3>
[/autoit] [autoit][/autoit] [autoit]
#include <Array.au3>Global $sFile1 = StringReplace(@AutoItExe, "AutoIt3.exe", "") & '\Examples\GUI\msoobe.jpg'
[/autoit] [autoit][/autoit] [autoit]
Global $sFile2 = StringReplace(@AutoItExe, "AutoIt3.exe", "") & '\Examples\GUI\mslogo.jpg'Global $hGui = GUICreate("Test", 500, 500)
[/autoit] [autoit][/autoit] [autoit]Global $nTab = GUICtrlCreateTab(10, 10, 480, 480)
[/autoit] [autoit][/autoit] [autoit]
GUICtrlCreateTabItem("Tab1")
Global $nPic1 = GUICtrlCreatePic($sFile1, 20, 50, 460, 420, 0)Global $nLbl = GUICtrlCreateLabel("Text-Label", 100, 100, 100, 30)
[/autoit] [autoit][/autoit] [autoit]
GUICtrlSetCursor(-1, 0)
_LabelMakeTranslucent(-1, $nPic1, 0x50000000, 0xFFFFFFFF)GUICtrlCreateLabel("Text-Label", 100, 135, 100, 30, 0x201)
[/autoit] [autoit][/autoit] [autoit]
GUICtrlSetCursor(-1, 0)
_LabelMakeTranslucent(-1, $nPic1, 0x50000000, 0xFFFFFFFF)GUICtrlCreateLabel("Text-Label", 100, 170, 100, 30, 0x202)
[/autoit] [autoit][/autoit] [autoit]
GUICtrlSetCursor(-1, 0)
_LabelMakeTranslucent(-1, $nPic1, 0x50000000, 0xFFFFFFFF)GUICtrlCreateLabel("This is a translucent label", 100, 335, 200, 31, 0x201)
[/autoit] [autoit][/autoit] [autoit]
_LabelMakeTranslucent(-1, $nPic1)GUICtrlCreateLabel("This is a transparent label", 300, 335, 200, 31, 0x201)
[/autoit] [autoit][/autoit] [autoit]GUICtrlCreateTabItem("Tab2")
[/autoit] [autoit][/autoit] [autoit]
Global $nPic2 = GUICtrlCreatePic($sFile2, 20, 50, 460, 420, 0)GUICtrlCreateLabel("Translucent label", 30, 200, 100, 30, 0x201)
[/autoit] [autoit][/autoit] [autoit]
_LabelMakeTranslucent(-1, $nPic2, 0x50FF00FF)GUICtrlCreateLabel("Transparent label", 30, 250, 100, 30, 0x201)
[/autoit] [autoit][/autoit] [autoit]GUICtrlCreateTabItem("")
[/autoit] [autoit][/autoit] [autoit]
GUISetState()Sleep(1000)
[/autoit] [autoit][/autoit] [autoit]
_LabelMakeTranslucent($nLbl, $nPic1, 0x305555f5, 0xFFf0f000, 1, "New Text")Do
[/autoit] [autoit][/autoit] [autoit]
Until GUIGetMsg() = -3Func _LabelMakeTranslucent($nLbl, $nPic, $TransColor = 0x30FFFFFF, $FontColor = 0xFF000000, $StartGdip = 1, $sText = "", $iSize = 8, $sFontName = "Arial", $iStyle = 0)
[/autoit]
Local $hLbl = GUICtrlGetHandle($nLbl)
Local $hPic = GUICtrlGetHandle($nPic)
Local $hImage = _SendMessage($hPic, 371)
Local $hParent = _WinAPI_GetParent($hLbl)
Local $Style = _WinAPI_GetWindowLong($hLbl, -16)
Local $iSS_CENTER = BitAND($Style, 0x1)
Local $iSS_RIGHT = BitAND($Style, 0x2)
Local $iSS_CENTERIMAGE = BitAND($Style, 0x200)
Local $IsPic = BitAND($Style, 0xE)
ConsoleWrite($IsPic & @CR)
If $sText = "" Then $sText = GUICtrlRead($nLbl)
If $IsPic = 0xE Then
$iSS_CENTER = BitAND(GUICtrlRead($nLbl), 0x1)
$iSS_RIGHT = BitAND(GUICtrlRead($nLbl), 0x2)
$iSS_CENTERIMAGE = BitAND(GUICtrlRead($nLbl), 0x200)
Else
GUICtrlSetData($nLbl, $Style) ;remember the old style in text
If $iSS_CENTER Then $Style = BitXOR($Style, 0x1) ;delete SS_CENTER
_WinAPI_SetWindowLong($hLbl, -16, BitOR($Style, 0x200, 0xE))
EndIf
Local $aLblPos = ControlGetPos($hParent, "", $hLbl)
Local $aPicPos = ControlGetPos($hParent, "", $nPic)
If $StartGdip Then _GDIPlus_Startup()
Local $hBitmap = _GDIPlus_BitmapCreateFromHBITMAP($hImage)
Local $hBitmap2 = _GDIPlus_BitmapCloneArea($hBitmap, $aLblPos[0] - $aPicPos[0], $aLblPos[1] - $aPicPos[1], $aLblPos[2], $aLblPos[3])
Local $hGraphics = _GDIPlus_ImageGetGraphicsContext($hBitmap2)
Local $hBrushArea = _GDIPlus_BrushCreateSolid($TransColor)
_GDIPlus_GraphicsFillRect($hGraphics, 0, 0, $aLblPos[2], $aLblPos[3], $hBrushArea)
Local $hBrushText = _GDIPlus_BrushCreateSolid($FontColor)
Local $hFormat = _GDIPlus_StringFormatCreate()
Local $hFontFamily = _GDIPlus_FontFamilyCreate($sFontName)
Local $hFont = _GDIPlus_FontCreate($hFontFamily, $iSize, $iStyle)
Local $tLayout = _GDIPlus_RectFCreate()
If $iSS_CENTERIMAGE Then DllStructSetData($tLayout, 2, $aLblPos[3] / 2 - $iSize + 1) ;vertictal center
Local $aInfo = _GDIPlus_GraphicsMeasureString($hGraphics, $sText, $hFont, $tLayout, $hFormat)
If $iSS_CENTER Then DllStructSetData($aInfo[0], 1, ($aLblPos[2] - DllStructGetData($aInfo[0], 3)) / 2) ;horizontal center
If $iSS_RIGHT Then DllStructSetData($aInfo[0], 1, $aLblPos[2] - DllStructGetData($aInfo[0], 3) - 1) ; right
_GDIPlus_GraphicsDrawStringEx($hGraphics, $sText, $hFont, $aInfo[0], $hFormat, $hBrushText)
Local $hImageNew = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hBitmap2)
_WinAPI_DeleteObject(GUICtrlSendMsg($nLbl, 370, 0, $hImageNew))
_WinAPI_DeleteObject($hImageNew)
_GDIPlus_ImageDispose($hBitmap)
_GDIPlus_ImageDispose($hBitmap2)
_GDIPlus_BrushDispose($hBrushArea)
_GDIPlus_BrushDispose($hBrushText)
_GDIPlus_FontDispose($hFont)
_GDIPlus_FontFamilyDispose($hFontFamily)
_GDIPlus_StringFormatDispose($hFormat)
_GDIPlus_GraphicsDispose($hGraphics)
If $StartGdip Then _GDIPlus_Shutdown()
EndFunc ;==>_LabelMakeTranslucent -
Dann wirst du sowieso nicht drum herum kommen, die einzelnen Labels auf den verschiedenen Seiten manuell sichtbar und unsichtbar zu schalten, egal ob du es mit dieser Funktion oder mit GDIPlus oder so erledigst.
Eine andere Variante kenne ich noch nicht, bzw. fällt mir jetzt keine ein.
-
Schau dir mal _GUICtrlListBox_SetSel() an oder auch _GUICtrlListBox_SelItemRange().
-
Hab auf die schnelle diese Funktion gefunden. Da wird allerdings auch die Schrift transparent.
Spoiler anzeigen
[autoit]GUICreate("Test", 500, 500)
[/autoit] [autoit][/autoit] [autoit]
GUISetBkColor(0xFF0000)GUICtrlCreateLabel("Transparent 1", 10, 10, 100, 30, 0x201)
[/autoit] [autoit][/autoit] [autoit]
GUICtrlSetBkColor(-1, 0xFFFFFF)
_GuiCtrlMakeTrans(-1, 200)GUICtrlCreateLabel("Transparent 2", 10, 90, 100, 30, 0x201)
[/autoit] [autoit][/autoit] [autoit]
GUICtrlSetBkColor(-1, 0xFFFFFF)
_GuiCtrlMakeTrans(-1, 100)GUISetState()
[/autoit] [autoit][/autoit] [autoit]Do
[/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]
Until GUIGetMsg() = -3Func _GuiCtrlMakeTrans($iCtrlID,$iTrans=255)
[/autoit] [autoit][/autoit] [autoit]Local $pHwnd, $nHwnd, $aPos, $a
[/autoit] [autoit][/autoit] [autoit]$hWnd = GUICtrlGetHandle($iCtrlID);Get the control handle
[/autoit] [autoit][/autoit] [autoit]
If $hWnd = 0 then Return SetError(1,1,0)
$pHwnd = DllCall("User32.dll", "hwnd", "GetParent", "hwnd", $hWnd);Get the parent Gui Handle
If $pHwnd[0] = 0 then Return SetError(1,2,0)
$aPos = ControlGetPos($pHwnd[0],"",$hWnd);Get the current pos of the control
If @error then Return SetError(1,3,0)
$nHwnd = GUICreate("", $aPos[2], $aPos[3], $aPos[0], $aPos[1], 0x80000000, 0x00080000 + 0x00000040, $pHwnd[0]);greate a gui in the position of the control
If $nHwnd = 0 then Return SetError(1,4,0)
$a = DllCall("User32.dll", "hwnd", "SetParent", "hwnd", $hWnd, "hwnd", $nHwnd);change the parent of the control to the new gui
If $a[0] = 0 then Return SetError(1,5,0)
If NOT ControlMove($nHwnd,'',$hWnd,0,0) then Return SetError(1,6,-1);Move the control to 0,0 of the newly created child gui
GUISetState(@SW_Show,$nHwnd);show the new child guiWinSetTrans($nHwnd,"",$iTrans);set the transparency
[/autoit] [autoit][/autoit] [autoit]
If @error then Return SetError(1,7,0)
GUISwitch($pHwnd[0]);switch back to the parent GuiReturn $nHwnd;Return the handle for the new Child gui
[/autoit] [autoit][/autoit] [autoit]EndFunc
[/autoit] [autoit][/autoit] [autoit][/autoit] -
Nett, gefällt mir!
Daran könnte man sich gewöhnen. -
Nette Funktion!
Ich bin aber kein Freund von 'Eval()' und Co.
Und da StringFormat beinahe die selben Möglichkeiten bietet, habe ich das ganze mal kurz umgeschrieben.
Hier das Ergebnis:Spoiler anzeigen
[autoit]Local $aTest[8]
[/autoit] [autoit][/autoit] [autoit]For $i = 1 To 5
[/autoit] [autoit][/autoit] [autoit]
For $j = 0 To UBound($aTest) - 1
$aTest[$j] = Random(10, 10000, 1)
Next
ConsoleWrite(_LenGroupedOutput2(10, " ", 0, $aTest) & @CRLF)
NextConsoleWrite(@CRLF)
[/autoit] [autoit][/autoit] [autoit]For $i = 1 To 5
[/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]
For $j = 0 To UBound($aTest) - 1
$aTest[$j] = Random(10, 10000, 1)
Next
ConsoleWrite(_LenGroupedOutput2(10, ".", 1, $aTest) & @CRLF)
NextFunc _LenGroupedOutput2($sLen, $charFill, $iAlign, $a)
[/autoit] [autoit][/autoit] [autoit]
Local $sSinglePattern, $sPattern
If Not IsArray($a) Then Return SetError(1)
If UBound($a) > 32 Then Return SetError(2)If $iAlign = 0 Then
[/autoit]
$sSinglePattern = "%-" & $sLen & "s"
Else
$sSinglePattern = "%" & $sLen & "s"
EndIf
For $i = 1 To UBound($a)
$sPattern &= $sSinglePattern
Next
ReDim $a[32]
Local $sRet = StringFormat($sPattern, $a[0], $a[1], $a[2], $a[3], $a[4], $a[5], $a[6], $a[7], $a[8], $a[9], $a[10], $a[11], $a[12], $a[13], $a[14], $a[15], _
$a[16], $a[17], $a[18], $a[19], $a[20], $a[21], $a[22], $a[23], $a[24], $a[25], $a[26], $a[27], $a[28], $a[29], $a[31], $a[31])
Return StringReplace($sRet, " ", StringLeft($charFill, 1))
EndFunc ;==>_LenGroupedOutput2 -
Nachid: DOS ist da nicht so heikel wie Linux.
@campweb: Der Spoiler kann dir nichts anhaben, ein Blick hinein schadet nicht!