-
Posts
36 -
Joined
-
Last visited
About waardd
- Birthday 11/19/1972
waardd's Achievements
Seeker (1/7)
0
Reputation
-
GUICTRLCreateEdit v.s. MSGBOX formatting
waardd replied to waardd's topic in AutoIt General Help and Support
If i put in the data myself that would be great but.... The StdOut of plink.exe puts in the data. It goes like this: Global $ret = _MyRun("C:uldplink.exe -v -pw "&$connectww&" "&$connectuser&"@"&$connectserver&$command&$tocheck) GUICtrlSetData($output, $ret) My Editfield shows it as one string. But if i msgbox it it shows it formatted. Entry: blablablaUsername: xxxxxxxxUser ID: 29022Primary group: blablablaCompany ID: lkdjfsldkfjUser info: pa, Jones (John), 465100Email address: something@dot.comCreated: Wed Oct 5 07:23:34 CEST 2011Password expire: Sun Aug 5 05:35:40 CEST 2012User revoke date: (none)Exp. warned: 0Failed logins: 0Authgroup: Sysgroup: vallues But if i msgbox it it shows it formatted MsgBox(0,"test",$ret) --------------------------- blablabla --------------------------- Entry: blablabla Username: xxxxxxxx User ID: 29022 Primary group: blablabla Company ID: lkdjfsldkfj User info: pa, Jones (John), 465100 Email address: something@dot.com Created: Wed Oct 5 07:23:34 CEST 2011 Password expire: Sun Aug 5 05:35:40 CEST 2012 User revoke date: (none) Exp. warned: 0 Failed logins: 0 Authgroup: Sysgroup: vallues --------------------------- OK --------------------------- -
The title is a little wierd but here is my problem. I have a plink output wich displays a big chunck of output. If i put it in a messagebox the formatting is good. All lines are under each other and its good readable. When i put the output in a editfield it displays as one long string. My question is How can i control the edit field so it displays as lines as well like the messagebox?
-
Thanks to Water!!! That UDF did the trick. It read the complete file!!! Tnx
-
What i get is the first 524 lines of my list. If i'm correct its 33274 characters in total (including the keynn=).... so it could be that it is running into a limitation... Damn...... Any suggestions?
-
Hi there, Im stumbling upon a problem. I have a file with several arrayentrys wich i load in to my arry with a function. But when i read thge array with the combobox it displays only a part of the lines? I have a total of 677 lines and the last entry in my combo is line 524 File to read: [sERVERLIJST] key1=aardslang rbf (A)|AIX|A|rbf|aardslang.mydomain . . . key677=xat1 ssox (O)|AIX|O|ssox|xat1.mydomain My functions to load array and send array to combo are: Func _populateARRAY() ; Get the entries Local $srvREAD = IniReadSection("c:\mvdd\settings\serverlijst.ini", "SERVERLIJST") ; Size the Global array correctly Global $ASservers[$srvREAD[0][0] + 1][6] ; Declare this Local array outside the loop Local $srvREAD2 For $i = 1 To $srvREAD[0][0] ; Split the delimited string into an array $srvREAD2 = StringSplit($srvREAD[$i][1], "|") ; Now add the elements to the Global array For $j = 1 To $srvREAD2[0] $ASservers[$i][$j] = $srvREAD2[$j] Next Next EndFunc ;==>_populateARRAY Func _FillCombo() $sServer_Data = "" For $i = 1 To UBound($ASservers) - 1 $sServer_Data &= "|" & $ASservers[$i][1] Next GUICtrlSetData($Cmb_Servers, $sServer_Data) EndFunc My combois formatted as: $Cmb_Servers = GUICtrlCreateCombo("Cmb_Servers", 90, 15, 160, 25, BitOR($CBS_DROPDOWNLIST,$WS_VSCROLL, $CBS_SORT))
-
count number of specific windows
waardd replied to waardd's topic in AutoIt General Help and Support
EUREKA!!! I got it working. With help from a routine by bobsyuruncle I coded it like this: #include <Array.au3> Global $maxlines, $Wlist, $hwnd $Wlist = winlist() $Plist = ProcessList("putty.exe") ;_ArrayDisplay($Wlist,"Wlist") ;_ArrayDisplay($Plist,"Processlist") $maxlinesW = $Wlist[0][0] $maxlinesP = $Plist[0][0] ConsoleWrite("WinlistAantal "&$maxlinesW&@CRLF) ConsoleWrite("PlistAantal "&$maxlinesP&@CRLF) Global $puttyarray[1] _ArrayDisplay($puttyarray) For $j = 1 to $maxlinesP $hwnd = _GetHwndFromPID($Plist[$j][1]) ConsoleWrite("Gevonden PID's> "&$Plist[$j][0]&" "&$Plist[$j][1]&" met hwnd "&$HWND&@CRLF&@CRLF) For $i = 1 to $maxlinesW if $Wlist[$i][1] = $hwnd then Consolewrite($Wlist[$i][0]&" "&$Wlist[$i][1]&@CRLF) $arrayline = $Wlist[$i][0]&" "&$Wlist[$i][1] _arrayadd($puttyarray, $arrayline) EndIf Next Next _ArrayDelete($puttyarray, 0) _ArrayDisplay($puttyarray) Func _GetHwndFromPID($PID); Tnx for this routine bobsyuruncle $hWnd = 0 $stPID = DllStructCreate("int") Do $winlist2 = WinList() For $i = 1 To $winlist2[0][0] If $winlist2[$i][0] <> "" Then DllCall("user32.dll", "int", "GetWindowThreadProcessId", "hwnd", $winlist2[$i][1], "ptr", DllStructGetPtr($stPID)) If DllStructGetData($stPID, 1) = $PID Then $hWnd = $winlist2[$i][1] ExitLoop EndIf EndIf Next Sleep(100) Until $hWnd <> 0 Return $hWnd EndFunc ;==>_GetHwndFromPID -
count number of specific windows
waardd replied to waardd's topic in AutoIt General Help and Support
Arraysearch returns the rowvalue for a partial string, however as said in earlier posts, this is a very variiable string. What im looking for (i think) is this. put processes in a list with winlist()search the putty sessions with a routine that links PID to HWNDput the result in a new arrayprocess the new array -
count number of specific windows
waardd replied to waardd's topic in AutoIt General Help and Support
That depends. Sometimes its just a servername in the Title and sometimes the complete info like lsrv4172 as waarddd /home/waarddd in the title as mentioned before. The examples where all from the title bar. I can winlist() to put all processes in an array but i can't search on a partial string in the array. -
count number of specific windows
waardd replied to waardd's topic in AutoIt General Help and Support
Nope sorry Any other idea's ?? >>>> Window <<<< Title: ridgeback as waardd /home/tab_unix/waardd Class: PuTTY Position: 175, 175 Size: 675, 424 Style: 0x14EF0000 ExStyle: 0x00000100 Handle: 0x00260C18 >>>> Control <<<< Class: Instance: ClassnameNN: Name: Advanced (Class): ID: Text: Position: Size: ControlClick Coords: Style: ExStyle: Handle: >>>> Mouse <<<< Position: 257, 82 Cursor ID: 0 Color: 0x000000 >>>> StatusBar <<<< >>>> ToolsBar <<<< >>>> Visible Text <<<< -
Use diskusage function for multiple disks
waardd replied to waardd's topic in AutoIt General Help and Support
Tnx Hannes08 I found the functions and combined it with my script to look something like this #include <GUIConstantsEx.au3> $Form1_1 = GUICreate("DiscInfo", 615, 350, 192, 124) $var = DriveGetDrive( "all" ) If NOT @error Then For $i = 1 to $var[0] $FileSys = DriveGetFileSystem( $var[$i] ) $SizeFree = (DriveSpaceFree( $var[$i] )/1024) $SizeTotal = (DriveSpaceTotal($var[$i])/1024) $SizeUsed = $SizeTotal - $SizeFree $PercUsed = ($SizeUsed/$SizeTotal)*100 $PercRounded2 = StringFormat("%.2f", $PercUsed) if $PercRounded2 < 0 Then GUICtrlCreateLabel("Drive "&$var[$i]&" is unknown",10,$i*15, 190) Else GUICtrlCreateLabel("Drive "&$var[$i]&" uses "&$PercRounded2&" %",10,$i*15, 190) GUICtrlCreateProgress(200,$i*15,200,15,-1,-1) GuiCtrlSetData(-1,$PercUsed) EndIf Next EndIf GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd This is with help from example script for compinfo.au3 by JSThePatriot -
I have a function to calculate diskusage and set it on a progressbar. $PercC = GUICtrlCreateLabel("",20,55,125,15,-1,-1) $BarC = GUICtrlCreateProgress(20,40,200,15,-1,-1) Func _diskC() $FileSys = DriveGetFileSystem( "c:\" ) $SizeFree = (DriveSpaceFree( "c:\" )/1024) $SizeTotal = (DriveSpaceTotal("c:\")/1024) $SizeUsed = $SizeTotal - $SizeFree $PercUsed = ($SizeUsed/$SizeTotal)*100 $PercRounded2 = StringFormat("%.2f", $PercUsed)&"% in use op C:" GuiCtrlSetData($BarC,$PercUsed) GuiCtrlSetData($PercC,$PercRounded2) EndFunc What i want is a automated routine to do this for al disks in a system independant of the configuration and show them al in on screen (kinda like explorer in windows)
-
count number of specific windows
waardd replied to waardd's topic in AutoIt General Help and Support
Here are some title examples of putty sessions bobtail as waardd /home/tab_unix/waardd ridgeback as waardd /home/tab_unix/waardd lsrv4172 as waarddd /home/waarddd lsrv1173 as waarddd /home/waarddd lsrv1173 as gkkp /appl/gkk/prod tuatara snuitmot waarddd@lsrv1200:~ So you see there are lots of options -
count number of specific windows
waardd replied to waardd's topic in AutoIt General Help and Support
I want to count the windows that are running a putty session. To count the processes i already have a function. Each putty session (putty.exe proces) can have a different connection and therefor a different window title. Example: window title 1: lsrv1200 as waardd window title 2: spinner as waardd window title 3: spinner as waard window title 4: lsrv1300 as waard what i want is a list of connections like: connected to spinner 2 times connected to lsrv1200 1 time connected to lsrv1300 1 time But remember te window title varies a lot!! -
Check status co-worker in communicator 2007
waardd replied to waardd's topic in AutoIt General Help and Support
Tnx Furek86. This really helped me out -
I have a function that can count instances of putty.exe Func _puttyteller();check aantal puttys $list = ProcessList() $puttycount = 0 ;_ArrayDisplay($list) For $i = 1 To $list[0][0] If $list[$i][0] = "putty.exe" Then $puttycount = $puttycount + 1 EndIf Next GuiCtrlSetData($Inputputtycount, $puttycount) ;MsgBox(0, "", $x) EndFunc But what i really want is a function that counts the various instances of putty connected to different servers. For example. If there are 4 connections to servers with putty (2x serverA, 1x serverB and 1x serverC) my function counts 4 times putty. What i am looking for is a function that gives me: ServerA 2 ServerB 1 ServerC 1