kpu
Active Members-
Posts
198 -
Joined
-
Last visited
Profile Information
-
Location
Minnesota
-
WWW
http://www.kpunderground.com/index.php
kpu's Achievements
Prodigy (4/7)
1
Reputation
-
auto-it-tous reacted to a post in a topic:
Printer Tool
-
Thanks! That did the trick. Handy little snippet!
-
I'm working with a third party utility that has a basic memory leak. Since the application has to run on a running windows session, eventually the memory leak causes the application to crash. In the past, I've resolved this by basically cycling the window state to maximized and then to minimized - which releases the memory. However, I found that it doesn't work when the RDP or VmWare console isn't active (Just to be clear, the console has a user logged in at all times). Here is the function. As you can see, not much to it. Func CycleWindowState($title) $return = WinSetState($title,"",@SW_MAXIMIZE) $return = WinActivate($title) ;if($return == 0) Then ; SendEmail($emailFromAddress, $emailToAddress,$emailSubjectLine,"Unable to Activate Window","") ;EndIf Send("{ALT}{SPACE}n") Sleep(100) EndFunc Does anyone know how I can cycle the window state when the RDP or VmWare session isn't active? What's failing to run is "Send("{ALT}{SPACE}n")". I can't use the WinSetState function as it doesn't release the memory like I expect. One solution I had working was to click on the task-bar item after maximizing it. However, if someone logs into the console with a different screen resolution, it won't click on the coordinates. If you're confused on what I'm taking about on releasing memory: 1) Open notepad maximized 2) Then your look at you the Task Manager and click on the "Processes" tab, and note the "Mem Usage" 3) Minimize notepad and you'll see the memory usage decreases.
-
I'm glad it worked for you! Another one that is very helpfully is: Opt("MustDeclareVars", 1) ;0=no, 1=require pre-declare This helps to prevent the attack of "fat fingers" or type-o's.
-
In your code, try AutoItSetOption("TrayIconDebug",1) to see where it's hanging.
-
Hey Tittoproject I've updated my code to refresh the list based upon the settings.ini file under the configurations section. (I know, I've been spelling refresh wrong... ) Maybe there is a better way to do this, but I'm closing the app and reopening it. Basically, if this works for the person I'm writing it for, I will most likely go through the code again and clean everything up. Lets just say it's a beta for now. I coded the "IF" statements that way so if I chose to add something to it, I can easily do so. I don't see the performance difference in coded it the way you have shown. However, thank you for your help with the ini file. If I had not gotten that from you, it may have taken me a lot longer or possibly not at all to figure out the best solution. Thanks again for your help!
-
Never mind, I figured it out. I think I'm learning something. I changed: $clientNumber = StringTrimLeft($sectionNames[$i], 6) To $clientNumber = $clientNumber + 1
-
Thanks everyone, see post below.
-
Thanks! What you've done is way passed my comprehension...but I like it! Now I just have to dissect it to understand what you've done.
-
First, thanks for taking the time to read my post. I appreciate any help anyone can provide me. My Goal: I'm trying to read an ini section name, then a section called Name and create a tray menu item from the "Name" with a defined variable that can be called be the "TrayGetMsg()". My problem is that I don't know how to correctly create the variable for the menu item. Here's what the ini file looks like. There are multiple names...client1, client2, client3...etc. [Client1] Name=My Client Address= 10.10.10.10 Heres what I have for code so far: #Include <Constants.au3> #NoTrayIcon Dim $strSettings = "settings.ini" Dim $strClient, $x, $client,$strClientMenu,$StrClientName Opt("TrayMenuMode",1) _GetRDPSessions() TrayCreateItem("") $settingsitem = TrayCreateMenu("Settings") TrayCreateItem("") $aboutitem = TrayCreateItem("About") TrayCreateItem("") $exititem = TrayCreateItem("Exit") TraySetState() While 1 $msg = TrayGetMsg() Select Case $msg = 0 ContinueLoop Case $msg = $aboutitem Exitloop Case $msg = $strClientMenu[$x] MsgBox(64,"Selection","You've selected " & $strClientMenu[$x]) Case $msg = $exititem ExitLoop EndSelect WEnd Exit Func _GetRDPSessions() $var = IniReadSectionNames($strSettings) If @error Then MsgBox(4096, "", "Error occurred, probably no INI file.") Else For $i = 1 To $var[0] ;Read Name in section $strClient = IniRead($strSettings,$var[$i],"Name","") If $var[$i] = "Configuration" then Else ;Create menu item ;MsgBox(4096, "Client", "File:" & $strSettings & @CRLF & "Clientname: " & $var[$i] & @CRLF & "Name:" & $strClient) _CreateTrayMenu($strClient) EndIf Next EndIf EndFunc Func _CreateTrayMenu($StrClient) For $x = 1 To $x[0][0] $strClientMenu[$x] = TrayCreateItem($StrClient) Next EndFunc Is there any good documentation somewhere that explains what the heck For $i = 1 To $var[0]. I have a basic idea, but I'm apparently missing some basics here. Again, Thanks for any help you can provide me!
-
Using Novell's LDAP to log into program
kpu replied to kpu's topic in AutoIt General Help and Support
Thanks, this would work if I was looking to at vaildating the user is a group. It's an idea to try. -
Using Novell's LDAP to log into program
kpu replied to kpu's topic in AutoIt General Help and Support
I forgot about this post. You are correct in your assumption. I'm looking for a way to vaildate the password hash somehow. -
JerryD, Awesome job on the AdQuery.au3! I've been fighting with converting this for an hour! Great job!
-
Script will auto log you into groupwise and then launch notify. Uses _StringEncrypt() to keep your password safe. Change $strEncyrptString to whatever you want. Enjoy! #include <string.au3> #NoTrayIcon Dim $DecryptD_upw,$encPword,$password,$sPword $strTitle = "GroupWise Password" $strGWTitle = "Novell GroupWise - Mailbox" $strRegPath = "HKCU\Software\Kpundergound\GroupWiseSSO" $strRun = "C:\Novell\GroupWise\GrpWise.exe /@u- /bl" & @UserName $strGWNotify= "C:\Novell\GroupWise\notify.exe" $strEncyrptString = DriveGetSerial("C:\") _RunProgram() Func _RunProgram() Run($strRun) _DecryptCreditals() WinWaitActive($strGWTitle,"",2) If WinActive($strGWTitle) Then Else WinWaitActive("Dialog","",3) EndIf Select Case WinActive("Dialog") = "1" ControlClick("Ent","","Button1") MsgBox(64,"Warning!","Your SSO information is incorrect. Please retype your information") _IncorrectSetting() Case WinActive($strGWTitle) = "1" WinWaitActive($strGWTitle,"") Winsetstate($strGWTitle,"",@SW_MAXIMIZE) EndSelect ;~ If WinWaitActive("Dialog") = "1" Then ;~ MsgBox(64,"Warning!","Your SSO information is incorrect. Please retype your information") ;~ _IncorrectSetting() ;~ Elseif WinWaitActive($strGWTitle) = "1" Then ;~ WinWaitActive($strGWTitle,"") ;~ Winsetstate($strGWTitle,"",@SW_MAXIMIZE) ;~ EndIf Run($strGWNotify) EndFunc Func _DecryptCreditals() $password = RegRead($strRegPath,"pname") If $password = "" Then Sleep(2000) _SetProgramSettings() $password = RegRead($strRegPath,"pname") $DecryptD_upw = _StringEncrypt(0,$password,$strEncyrptString,1) _SendSSOInformation() Else $DecryptD_upw = _StringEncrypt(0,$password,$strEncyrptString,1) _SendSSOInformation() EndIf EndFunc Func _SetProgramSettings() $sPword= InputBox("Username","Please type in your GroupWise Password","","*","-1","-1","-1","-1") Select Case @Error = 0;OK - The string returned is valid $encPword = _StringEncrypt(1,$sPword,$strEncyrptString,1) RegWrite($strRegPath,"pname","REG_SZ",$encPword) Case @Error = 1;The Cancel button was pushed Exit Case @Error = 3;The InputBox failed to open EndSelect EndFunc Func _SendSSOInformation() WinWaitActive($strTitle) ControlSetText($strTitle,"","Edit1",$DecryptD_upw) ControlClick($strTitle,"","Button1") EndFunc Func _IncorrectSetting() _SetProgramSettings() $password = RegRead($strRegPath,"pname") $DecryptD_upw = _StringEncrypt(0,$password,$strEncyrptString,1) ControlSetText("Dialog","","Edit1",$DecryptD_upw) ControlClick("Dialog","","Button1") WinWaitActive($strGWTitle,"") Winsetstate($strGWTitle,"",@SW_MAXIMIZE) EndFunc
-
Script Running On Remote Desktop
kpu replied to schnikies79's topic in AutoIt General Help and Support
I think since your not logged into the remote PC, there isn't a session open for your program to work. How are you starting your script remotely? -
It changed from strComputer to $strComputer. I changed it to @ComputerName