
SlowCoder74
Active Members-
Posts
178 -
Joined
-
Last visited
-
Days Won
1
Content Type
Forums
Downloads
Forum Articles
Events
Everything posted by SlowCoder74
-
Resolved--RunAs Admin within Script
SlowCoder74 replied to Wena's topic in AutoIt General Help and Support
My method of mitigating this problem, if I understand correctly, is to: 1. Run script as non-elevated user 2. Prompt for elevated credentials. 3. Call the same script again with RunAs, and the elevated credentials, with "/STOPSERVICE" in the commandline. 4. Elevated script sees commandline and does what's needed. ... all as a single script. -
Send arguments to a non-compiled script
SlowCoder74 replied to Mechaflash's topic in AutoIt General Help and Support
I had the exact same question, and it has now been answered. Thank you. -
Looking for non-unique windows?
SlowCoder74 replied to SlowCoder74's topic in AutoIt General Help and Support
Yeah, I located the tool and used it. Unfortunately it doesn't return the text from the window I'm working with. I believe it's because the window is written in Java. The tool works fine for other windows/apps. Sigh ... -
I have a project that needs to test for an appropriate window to be open. In some cases, the window can be found by looking at the unique window title. But in other cases, the window may not have a unique window title, but the text inside the window will be unique. What are some good ways to test for this? I see that functions like "WinWaitActive" have a text parameter. What does that do?
-
Not specifically an AutoIT problem, but I'm hoping someone has some information ... My program simply duplicates the HKCU\Printers\Connections key, which contains network printer configurations, from user account #1 to #2. In XP, it works great, making the printers available to user #2. In Windows 7, the copy is successful. But here's where things get off ... Open an application under user #2's account, and the printers aren't there. Close the app, and reopen it, and they're there, and can be printed to. It's as if something needs to be triggered for Windows 7 to recognize the new printers. Any ideas?
-
Resolved - AutoLogon in Windows 7
SlowCoder74 replied to SlowCoder74's topic in AutoIt General Help and Support
That worked a gem. Thanks! -
Resolved - AutoLogon in Windows 7
SlowCoder74 replied to SlowCoder74's topic in AutoIt General Help and Support
I found some information that may be the answer, but how to implement in AutoIT? http://msdn.microsoft.com/en-us/library/aa384129%28v=VS.85%29.aspx -
I wrote a security tool that reads the autologon keys within HKLM\Software\Microsoft\Windows NT\CurrentVersion\WinLogon. The values are DefaultUsername, DefaultPassword, DefaultDomainName, AutoAdminLogon and ForceAutoLogon. It works great in WinXP, but not in Win7. So, I found Wow6432Node and added the values there and it reads from there. But that doesn't fix the problem. I deleted the values from the non-Wow6432Node path, and Win 7 no longer auto-logs in. Therefore, I'm stuck ... 1. It seems I can have Win 7 auto-login, but not be able to read the values. or 2. I can change the values in Wow6432Node, but Win 7 ignores them. What are my options?
-
@Melba23, I was moving in the direction of destroying and recreating, but I'll check out that UDF you posted. Thanks! @JLocal3o13, My application is designed to provide read-only information about the logged in Windows user and PC. Network admins can log into my app for more advanced management functions. FYI: In another attempt, I created a tabbed control with an embedded group control. When I disabled or hid the group control using GUICtrlSetState($Group1, $GUI_DISABLE), it remained enabled. I guess group controls can't be disabled or hidden? Here's my test code. #include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <TabConstants.au3> #include <WindowsConstants.au3> #Region ### START Koda GUI section ### Form= $Form2 = GUICreate("Form2", 413, 305, 245, 167) $Tab1 = GUICtrlCreateTab(48, 24, 281, 169) $TabSheet1 = GUICtrlCreateTabItem("TabSheet1") $TabSheet2 = GUICtrlCreateTabItem("TabSheet2") GUICtrlSetState(-1,$GUI_SHOW) $Group1 = GUICtrlCreateGroup("Group1", 88, 64, 177, 97) $Button1 = GUICtrlCreateButton("Button1", 112, 88, 97, 25) $Input1 = GUICtrlCreateInput("Input1", 120, 112, 121, 21) GUICtrlCreateGroup("", -99, -99, 1, 1) GUICtrlSetState(-1, $GUI_DISABLE) GUICtrlSetState(-1, $GUI_HIDE) $Button2 = GUICtrlCreateButton("Enable", 128, 168, 73, 17) GUICtrlCreateTabItem("") GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit case $Button2 GUICtrlSetState($Group1,$GUI_ENABLE) GUICtrlSetState($Group1,$GUI_SHOW) EndSwitch WEnd
-
I'm working on an application that starts with 2 tabs. Upon a user's login, it will present them with 2 more tabs. It's easy enough to add the new tabs. But I'd like the new tabs to appear to the left of the existing tabs. Is there any way to accomplish this in AutoIT? ... or maybe to hide the tabs until it's time to show them?
-
Loops in a single line?
SlowCoder74 replied to Mechaflash's topic in AutoIt General Help and Support
I agree that would be useful. I don't think AutoIT is capable of handling more than 1 statement/command on a single line. -
Submitting my version of a date converter UDF
SlowCoder74 replied to SlowCoder74's topic in AutoIt Example Scripts
Wow ... you realize you totally blew away my function with that? LOL! That's much more succinct! Thanks! -
SELF RESOLVED BECAUSE SLOWCODER IS AN IDIOT!!! The data was passing just fine, but the field wasn't wide enough to show the data. Nothing else to see here ... move on, move on ... I need to be able to pass time data to a GUI input box. When I attempt to pass a numeric string through to an input object, it apparently gets converted to a number, and if there's a 0 (zero) at the beginning, it is trimmed off. I need the entire string to be passed. Here is a sample of what I'm up against: #include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> $MyData = "0730" msgbox(0,"",$MyData) ;verify proper data is held in variable $frmShowReport = GUICreate("", 378, 346, -1, -1) $inp = GUICtrlCreateInput("", 256, 272, 33, 21) GUICtrlSetColor(-1, 0x000000) GUISetState(@SW_SHOW) GUICtrlSetData($inp,string($MyData)) ;GUICtrlSetData($inp,$MyData) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd Notice that I did try to force it by using string(), but that did nothing.
-
Submitting my version of a date converter UDF
SlowCoder74 replied to SlowCoder74's topic in AutoIt Example Scripts
If what you're getting at is if my code can deal with it, the answer is yes. -
Submitting my version of a date converter UDF
SlowCoder74 replied to SlowCoder74's topic in AutoIt Example Scripts
LOL! Do you also live where they drive cars on the wrong side of the road? As an example where this can be useful ... I'm using ShowPopupCalendar (a great little UDF), it returns the date in "MM/DD/YYYY" format. Whereas, I need to run _DateDiff on it, which accepts the date as "YYYY/MM/DD". Seems a bit of inconsistency in the published functions, but that is where my code comes into play. -
Would like to know what you think of it. It's pretty well capable of converting any numeric-based date format to any other. They don't even have to be standard date formats. The reason I coded it is that I find that AutoIT dates are often formatted as "YYYY/MM/DD", while people like to use "MM/DD/YYYY". Very often I prefer to use "YYYYMMDD" in my code or data. And sometimes there are other formats. I'd appreciate comments, including if you feel the documentation is clear. Is it useful? Func _ConvertDateFormat($sDateToConvert,$sOrigDelimiter,$sOrigDateMask,$sNewDateMask) ;Function to convert any numeric date format to any other numeric date format. ;$sDateToConvert - Any numeric date format ;sOrigDelimiter - Delimiter in $sDateToConvert that separates each part of the date. Usually "/" or "-". ;$sOrigDateMask - Format changes, and depends on whether $sOrigDelimiter is empty or not. ; if $sOrigDelimiter = non-empty value: $sOrigDateMask will be something like "Y/M/D". Single letters denoting which part of the string are year,month,day respectively. ; if $sOrigDelimiter = empty value: $sOrigDateMask must match the format of $sDateToConvert. E.g. If $sDateToConvert is "2012/05/28", then $sOrigDateMask must be "YYYY/MM/DD". ;$sNewDateMask - New masked format to be returned. E.g. "MM/DD/YYYY" (returns "05/28/2012") or "YYYYMMDD" (returns "20120528") ; Will also accept YY for 2 digit year output, M for 1 digit month (if able), and D for 1 digit day (if able). E.g. "M-D-YY" for "01/01/2012" will reformat to "1-1-12" ;Ex: $d = ConvertDateFormat("2012/05/28","Y/M/D","/","MM-DD-YYYY") - will convert "2012/05/28" to "05-28-2012" ;Ex: $d = ConvertDateFormat("20120528","YYYYMMDD","","MM-DD-YYYY") - will convert "20120528" to "05-28-2012" ;Note: if the year, month or day parts are not retrieved from $sDateToConvert, function will assume current value for that part. ;Note: The current date can even be returned in any format using the following: _ConvertDateFormat("","","","YYYYMMDD") local $sYear local $sMonth local $sDay local $aDateParts,$aDateMaskParts local $iA if $sOrigDelimiter <> "" then ;delimiter supplied. $aDateParts = StringSplit($sDateToConvert,$sOrigDelimiter) ;split original date into parts $aDateMaskParts = StringSplit($sOrigDateMask,$sOrigDelimiter) ;split original date mask into parts for $iA = 1 to $aDateParts[0] Switch StringUpper($aDateMaskParts[$iA]) case "M" ;month $sMonth = StringStripWS($aDateParts[$iA],3) case "D" ;day $sDay = StringStripWS($aDateParts[$iA],3) case "Y" ;year $sYear = StringStripWS($aDateParts[$iA],3) EndSwitch Next Else ;delimiter not supplied. Use mask to manually pull parts ;parse into year, month, day for $iA = 1 to StringLen($sDateToConvert) $sCurChar = stringupper(stringmid($sDateToConvert,$iA,1)) switch stringupper(stringmid($sOrigDateMask,$iA,1)) case "M" ;month $sMonth = $sMonth & $sCurChar case "D" ;day $sDay = $sDay & $sCurChar case "Y" ;year $sYear = $sYear & $sCurChar EndSwitch Next EndIf ;fix length of date parts ;year if $sYear = "" then $sYear = @YEAR if stringlen($sYear) = 2 then $sYear = "20" & $sYear ;adjust year to 4 digits ;month if $sMonth = "" then $sMonth = @MON if stringlen($sMonth) = 1 then $sMonth = "0" & $sMonth ;adjust month to 2 digits ;day if $sDay = "" then $sDay = @MDAY if stringlen($sDay) = 1 then $sDay = "0" & $sDay ;adjust day to 2 digits ;create new format $sNewDateMask = StringReplace($sNewDateMask,"YYYY",$sYear) ;apply 4-digit year $sNewDateMask = StringReplace($sNewDateMask,"YY",StringRight($sYear,2)) ;apply 2-digit year $sNewDateMask = StringReplace($sNewDateMask,"MM",$sMonth) ;apply 2-digit month if StringInStr($sNewDateMask,"M") > 0 Then $sNewDateMask = StringReplace($sNewDateMask,"M",int($sMonth)) ;apply 1-digit month $sNewDateMask = StringReplace($sNewDateMask,"DD",$sDay) ;apply 2-digit day if StringInStr($sNewDateMask,"D") > 0 Then $sNewDateMask = StringReplace($sNewDateMask,"D",int($sDay)) ;apply 1-digit day ;return new format Return $sNewDateMask EndFunc
-
Finding a value, or numbers in string
SlowCoder74 replied to Stinkux's topic in AutoIt General Help and Support
Uh, you may want to read the forum rules before the mods get to you. -
I understand about checking for a change in an input object. But I'm not looking for a change in the object's value/data. I'd really like to just be able to click on a label or input object and pop up a box/dialog, whatever. For instance, a label that displays a date. Click on it, and it pops up a calendar to select a new date. Is that possible?
-
I know that some objects, like buttons, act like onclick events. But what about labels or input boxes? I've tried using Opt("GUIOnEventMode", 1) and setting GUICtrlSetOnEvent, but things like input boxes don't trigger until the box is unfocussed, so the event is really an onchange type of event.
-
I have a field I need to set to a date. It would be really nice if the date was chosen by a popup calendar, rather than forcing the user to manually type in the date. Is there anything already in place for such a function?
-
"Variable used without being declared."
SlowCoder74 replied to SlowCoder74's topic in AutoIt General Help and Support
Actually, upon more consideration, as I'd previously mentioned, I would write some of my own code with my own variables. Not explicitly declared, but still used, and the code works. If I close and reopen the source, it may fail with the error. So it's not an includes problem. Yes, that is good to know. Thank you. -
"Variable used without being declared."
SlowCoder74 replied to SlowCoder74's topic in AutoIt General Help and Support
Good info, guys! I was using 3.3.6.1 because I'd only downloaded it a few months ago, and hadn't checked for updates. But now I'm up to 3.3.8.1. Also downloaded SciTE4AutoIT3. Added "#AutoIt3Wrapper_Add_Constants=y", and see that it automatically added the needed includes. Awesome! -
Ok, so strange situation. I'm using AutoIT 3.3.6.1. I write source, and it works great. I save and close, then come back later. I get "Variable used without being declared.". It definitely seems to be a random thing. I may close and reopen again, and it'll work fine. I know correct programming dictates that I should declare all my variables, but it's not required unless I put "Opt(MustDeclareVars,1)", right? Anyway, I downloaded ScriptoMatic from the download page, and got the error again, so I'm sure it's not me. Here's the console error: >"C:\Program Files\AutoIt3\SciTE\..\autoit3.exe" /ErrorStdOut "C:\Documents and Settings\[username]\Desktop\scriptomatic.au3" C:\Documents and Settings\[username]\Desktop\scriptomatic.au3 (27) : ==> Variable used without being declared.: GuiCreate("AutoIt Scriptomatic Tool", 684, 561,(@DesktopWidth-684)/2, (@DesktopHeight-561)/2 , $WS_OVERLAPPEDWINDOW + $WS_VISIBLE + $WS_CLIPSIBLINGS) GuiCreate("AutoIt Scriptomatic Tool", 684, 561,(@DesktopWidth-684)/2, (@DesktopHeight-561)/2 , ^ ERROR >Exit code: 1 Time: 0.775I'm not blaming ScriptoMatic. I think it's something else. Ideas?