einfach mal willenlos text reinkopiert und siehe da:
hab auch win 7 64Bit
Beiträge von Torni
-
-
genialo...thx dafür..
kleines Manko, wenn ich ca. 2000 Zeichen reinpacke, verkleinert sich die Gui und kein QR ist zu sehen..
p.s. gibt es so was auhc für 128er-BarCode??
-
muss auch sagen, super Teil.
Danke dafür..
-
hey das ist super und vor allem sauschnell... danke dir
-
nee, das gibt bei USB-Platten Fixed aus..
-
Hi,
kann mir einer der Autoit/WMI-Spezies mal erläutern, warum diese WMI-Abfrage (so ähnlich aus Forum) so lange dauert bzw.obs was anderes gibt??
Pro Festplatte bzw. Aufruf der Func USBPL() dauert es ca. 2-4 SekundenHintergrund ist der, dass ich prüfen will, welche Festplatte eine USB-Platte ist, das unten aber Notifications "auswertet" und eher ungeeignet ist.
[autoit]
[/autoit][autoit][/autoit][autoit]
Func USBPL($sfpl)Local $strComputer = "."
[/autoit][autoit][/autoit][autoit]
Local $objWMIService = ObjGet("winmgmts:\\" & $strComputer & "\root\cimv2")$colEvents = $objWMIService.ExecNotificationQuery("Select * From __InstanceOperationEvent Within 5 Where " & "TargetInstance isa 'Win32_LogicalDisk'")
[/autoit][autoit][/autoit][autoit]$objEvent = $colEvents.NextEvent
[/autoit]
If $objEvent.TargetInstance.DriveType = 2 Then
Consolewrite("Drive " & $objEvent.TargetInstance.DeviceId & " is a removable Harddrive." & @CR)
Return True
EndIf
Return False
EndFuncDiese Funktion müsste ich mehrmals aufrufen können, was ja aber zu lange dauert.
Aufrufen tue ich die in einer Schleife:
[autoit]
[/autoit]
...
Switch DriveGetType($aLW[$i])
Case 'Fixed'
If USBPL($aDrives[$i]) = True Then
$iIcon = 4
Else
$iIcon= 5
EndIf
...Ich hab mir auf MSDN den Wolf gesucht..
-
-
seltsamerweise auf regexe.de geht es mit dem Ausdruck:
-
Then you have different Input-Forms??
A simple possibility is to choose which Listview-Row is selected an then decide what to do like
[autoit]...
[/autoit]
Case $Button1
Local $iNum = _GUICtrlListView_GetSelectionMark($List_1)
Switch $iNum
Case 0
GUICtrlSetData($tbChosen, $iNum , 1)
MsgBox(64,"Test", $iNum & " selected")
Case 1
GUICtrlSetData($tbChosen, $iNum , 1)
MsgBox(64,"Test", $iNum & " selected")
EndSwitch
GUISetState(@SW_HIDE, $Form1)
EndSwitch
...p.s.: I'm not a professional-scripter, so do not expect to much from me, hrhr
-
just change the lines:
[autoit]Case $Button1
[/autoit]
GUICtrlSetData($tbChosen, GUICtrlRead($Input1) & @CRLF & _
GUICtrlRead($Input2) & @CRLF & _
GUICtrlRead($Input3) & @CRLF, 1)into similar like:
[autoit]Case $Button1
[/autoit]
GUICtrlSetData($tbChosen, '0' & GUICtrlRead($Input1) & ';' & @CRLF & _
'(-- ' & GUICtrlRead($Input2) & ' --)' & @CRLF & _
'G97M3S' & GUICtrlRead($Input3) & ';' & @CRLF, 1)you can combine Strings with the "&"-operator like you want/need
-
quick und vor allem dirty-lösung:
Spoiler anzeigen
[autoit]
[/autoit] [autoit][/autoit] [autoit]
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <ProgressConstants.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <WinAPI.au3>$Form1_1 = GUICreate("Form1", 310, 220, 273, 249)
[/autoit] [autoit][/autoit] [autoit]
$Input1 = GUICtrlCreateInput("", 24, 40, 121, 21, BitOR($GUI_SS_DEFAULT_INPUT,$ES_PASSWORD))
$Label1 = GUICtrlCreateLabel("Password:", 24, 16, 67, 22)
GUICtrlSetFont(-1, 10, 800, 0, "Trebuchet MS")
$Group1 = GUICtrlCreateGroup("Install Printer ", 24, 72, 273, 129)
GUICtrlSetFont(-1, 9, 400, 0, "Trebuchet MS")
GUICtrlSetState(-1, $GUI_HIDE)
$Button1 = GUICtrlCreateButton("Button1", 112, 168, 75, 17)
GUICtrlSetState(-1, $GUI_HIDE)
$Label2 = GUICtrlCreateLabel("Install Generic / Text Only @ LPT1", 40, 104, 238, 22)
GUICtrlSetState(-1, $GUI_HIDE)
GUICtrlSetFont(-1, 10, 400, 0, "Trebuchet MS")
GUICtrlSetState(-1, $GUI_HIDE)
$Progress1 = GUICtrlCreateProgress(64, 136, 166, 9)
GUICtrlSetState(-1, $GUI_HIDE)
GUICtrlCreateGroup("", -99, -99, 1, 1)GUISetState(@SW_SHOW)
[/autoit] [autoit][/autoit] [autoit]GUIRegisterMsg($WM_COMMAND, 'WM_COMMAND')
[/autoit] [autoit][/autoit] [autoit]While 1
[/autoit] [autoit][/autoit] [autoit]
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
ExitEndSwitch
[/autoit] [autoit][/autoit] [autoit]
WEndFunc WM_COMMAND($hWnd, $iMsg, $iwParam, $ilParam)
[/autoit] [autoit][/autoit] [autoit]
#forceref $hWnd, $iMsg
Local $hWndFrom, $iIDFrom, $iCode
$hWndFrom = $ilParam
$iIDFrom = BitAND($iwParam, 0xFFFF) ; Low Word
$iCode = BitShift($iwParam, 16) ; Hi Word
Select
Case $iCode; = 0x0
Local $ID = _WinAPI_GetDlgCtrlID(ControlGetHandle($Form1_1, '', ControlGetFocus($Form1_1)))
Switch $ID
Case $input1
If GUICtrlRead($Input1) = "test" Then
GUICtrlSetState($Group1, $GUI_SHOW)
GUICtrlSetState($Button1, $GUI_SHOW)
GUICtrlSetState($Label2, $GUI_SHOW)
GUICtrlSetState($Progress1, $GUI_SHOW)
Else
GUICtrlSetState($Group1, $GUI_HIDE)
GUICtrlSetState($Button1, $GUI_HIDE)
GUICtrlSetState($Label2, $GUI_HIDE)
GUICtrlSetState($Progress1, $GUI_HIDE)
EndIfEndSwitch
[/autoit]
EndSelect
Return $GUI_RUNDEFMSG
EndFunc ;==>WM_COMMAND -
ok, nach langem probieren und suchen gelöst:
[autoit]
[/autoit][autoit][/autoit][autoit]
...$tNMHDR = DllStructCreate($tagNMHDR, $ilParam)
[/autoit][autoit][/autoit][autoit]
$hWndFrom = DllStructGetData($tNMHDR, "hWndFrom")
$iIDFrom = DllStructGetData($tNMHDR, "IDFrom")
$iCode = DllStructGetData($tNMHDR, "Code")....
[/autoit][autoit][/autoit][autoit]Case $NM_RCLICK
[/autoit]
Local $tPoint = _WinAPI_GetMousePos(True, $hWndFrom), $tHitTest
$tHitTest = _GUICtrlTreeView_HitTestEx($hWndFrom, DllStructGetData($tPoint, 1), DllStructGetData($tPoint, 2))
If BitAND(DllStructGetData($tHitTest, "Flags"), $TVHT_ONITEM) Then
_GUICtrlTreeView_SelectItem($hWndFrom, DllStructGetData($tHitTest, 'Item'))
Local $sPfads = StringReplace(_GUICtrlTreeView_GetTree($hTreeview, _GUICtrlTreeView_GetSelection($hTreeview)), $Delim1, $Delim)
EndIf
GUICtrlSetData($Input1, $sPfads) -
Da reicht der Code von nem normalen TreeView:
Spoiler anzeigen
[autoit]
[/autoit] [autoit][/autoit] [autoit]
#include<GUIConstantsEx.au3>
#include<GuiTreeView.au3>
#include<TreeViewConstants.au3>
#include<WindowsConstants.au3>Global $hGui = GUICreate('TreeView', 200, 200)
[/autoit] [autoit][/autoit] [autoit]
Global $hTreeView = GUICtrlCreateTreeView(5, 5, 190, 190, BitOR($GUI_SS_DEFAULT_TREEVIEW, $TVS_CHECKBOXES), $WS_EX_CLIENTEDGE)
Global $hRoot = GUICtrlCreateTreeViewItem('Test', $hTreeView)
_GUICtrlTreeView_BeginUpdate($hTreeView)
For $x = 1 To 3
$hItem1 = _GUICtrlTreeView_AddChild($hTreeView, GUICtrlGetHandle($hRoot), StringFormat('d', $x))
Next
_GUICtrlTreeView_EndUpdate($hTreeView)
_GUICtrlTreeView_Expand($hTreeView)
GUISetState()While True
[/autoit]
Switch GUIGetMsg()
Case $GUI_EVENT_CLOSE
Exit
EndSwitch
WEndDas Verhalten ist da automatisch drin. Sobald man mit rechts was anderes anklickt und loslässt ist er wieder beim vorher Selektierten.
Mein Versuch war ein Codeschnipsel den ich irgendwo gefunden habe, per WM_Notify die rechte Maus abzufangen:
[autoit]
[/autoit]
Case $NM_RCLICK
$tPoint = _WinAPI_GetMousePos(1, $hTreeView)
$tTVHTI = _GUICtrlTreeView_HitTestEx($hTreeView, DllStructGetData($tPoint, 1), DllStructGetData($tPoint, 2))
$hItem = DllStructGetData($tTVHTI, 'Item')
If BitAND(DllStructGetData($tTVHTI, 'Flags'), $TVHT_ONITEM) Then
MsgBox(0,"", ".,.");;;;;;;;;;;;;;;;;;;;;;;;; hier kommt er nicht mal hin..
_GUICtrlTreeView_SelectItem($hTreeView, $hItem)
EndIfWie gesagt, gefundener Code-Schnipsel..
-
Hallo,
ich hab ein TreeView
Wenn ich auf ein Nicht-selektiertes TreeView-Item mit rechter Maustaste klicke und wieder loslasse, wird wieder das vorher angewählte Item selektiert.
Ich möchte jedoch das vorher mit rechts angewählte Item selektiert lassen.
Im Beispiel oben habe ich mit rechter-Maustaste auf "87687" geklickt und losgelassen und schon springt er wieder auf "Bewerbung".
Ist bestimmt einfach, finde jedoch kein Ansatz.. -
Auch von mir alles Gute zum Geburtstag..
-
Mach mal vor die Schleife:
[autoit]AdlibRegister("Zaehlen", 1000)
[/autoit]und entferne:
[autoit]while 1
[/autoit]
Zaehlen()
ExitLoop
Sleep (2000)
WEndDa flackert nix mehr und der CPU gehts auch gut *G*
-
Hiho,
es geht um die WinApiEx.au3:
Mittels dem Beispiel
Spoiler anzeigen
[autoit]
[/autoit] [autoit][/autoit] [autoit]
#Include <APIConstants.au3>
#Include <WinAPIEx.au3>Opt('MustDeclareVars', 1)
[/autoit] [autoit][/autoit] [autoit]Global $hDesktop, $hPrev, $pText, $tProcess, $tStartup
[/autoit] [autoit][/autoit] [autoit]; Retrieve a handle to the current desktop and create a new desktop named "MyDesktop"
[/autoit] [autoit][/autoit] [autoit]
$hPrev = _WinAPI_GetThreadDesktop(_WinAPI_GetCurrentThreadID())
$hDesktop = _WinAPI_CreateDesktop('MyDesktop', BitOR($DESKTOP_CREATEMENU, $DESKTOP_CREATEWINDOW, $DESKTOP_SWITCHDESKTOP))
If Not $hDesktop Then
MsgBox(16, 'Error', 'Unable to create desktop.')
Exit
EndIf; Switch to the newly created desktop
[/autoit] [autoit][/autoit] [autoit]
_WinAPI_SwitchDesktop($hDesktop); Run "calc.exe" on "MyDesktop" and wait until a process will not be closed by user
[/autoit] [autoit][/autoit] [autoit]
$pText = _WinAPI_CreateString('MyDesktop')
$tProcess = DllStructCreate($tagPROCESS_INFORMATION)
$tStartup = DllStructCreate($tagSTARTUPINFO)
DllStructSetData($tStartup, 'Size', DllStructGetSize($tStartup))
DllStructSetData($tStartup, 'Desktop', $pText)
If _WinAPI_CreateProcess('', @SystemDir & '\calc.exe', 0, 0, 0, $CREATE_NEW_PROCESS_GROUP, 0, 0, DllStructGetPtr($tStartup), DllStructGetPtr($tProcess)) Then
ProcessWaitClose(DllStructGetData($tProcess, 'ProcessID'))
EndIf; Switch to previous desktop and close "MyDesktop"
[/autoit] [autoit][/autoit] [autoit]
_WinAPI_SwitchDesktop($hPrev)
_WinAPI_CloseDesktop($hDesktop); Free memory allocated for a string
[/autoit]
_WinAPI_FreeMemory($pText)Kann man bequem Desktops "erzeugen".
Wie bekommt man jedoch die ganzen Icons und die Taskleiste hinzu?
Hat dajemand schon mal daran gearbeitet? Oder eine andere Möglichkeit? -
so ähnlich wie das... natürlich noch registrieren per GUIRegisterMsg($WM_NOTIFY, "WM_NOTIFY")
Spoiler anzeigen
[autoit]
[/autoit] [autoit][/autoit] [autoit]
Func WM_NOTIFY($hWnd, $iMsg, $wParam, $lParam)
#forceref $hWnd, $iMsg, $wParam
;
Local $hWndFrom, $iIDFrom, $iCode, $tNMHDR, $hWndListViewPC
$hWndListViewPC = $LVPCIf Not IsHWnd($LVPC) Then $hWndListViewPC = GUICtrlGetHandle($LVPC)
[/autoit] [autoit][/autoit] [autoit]$tNMHDR = DllStructCreate("hwnd hWndFrom;uint_ptr IDFrom;INT Code", $lParam)
[/autoit] [autoit][/autoit] [autoit]
$hWndFrom = HWnd(DllStructGetData($tNMHDR, "hWndFrom"))
$iIDFrom = DllStructGetData($tNMHDR, "IDFrom")
$iCode = DllStructGetData($tNMHDR, "Code")If $hWndFrom = $hWndListViewPC Then
[/autoit] [autoit][/autoit] [autoit]
$RDPString = _GUICtrlListView_GetItemText($hWndListViewPC, _GUICtrlListView_GetSelectionMark($hWndListViewPC),0)
If $iCode = -2 Then ;NM_CLICK
Testping() ; mach dies und das..
EndIf
EndIfReturn 'GUI_RUNDEFMSG'
[/autoit]
EndFunc ;==>WM_NOTIFY -
-