
mattw112
Active Members-
Posts
184 -
Joined
-
Last visited
Content Type
Forums
Downloads
Forum Articles
Events
Everything posted by mattw112
-
I have a combo box on my form GUICtrlCreateCombo("", 24, 152, 1240, 100, BitOR($CBS_DROPDOWNLIST,$CBS_AUTOHSCROLL)) But the down arrow at the end of it is tiny in terms of width, compared to the rest of it. This app is running on a tablet and I want people to use their finger to select, which they can... but some times it is hard. Is there a way to make the down arrow piece wider? Terry
-
I have a gui with standard while loop $nMsg = GUIGetMsg() Switch $nMsg Case $Button1... I want when someone clicks a button that it does stuff, then returns to the gui fresh for another choice. But it seems like if someone clicks button1 then clicks button2 while button1 code is still running, when button1 is done, it has automatically stored that button2 was clicked and it starts doing button2 stuff. But I don't want it to automatically do button2 stuff. In case someone accidently hit button2 while button1 was running... Hope that makes sense. So is there a way to turn off the listening for button clicks until after button1 code is done processing? Thanks, Terry
-
It's been a couple years since I last built something with AutoIT, but I've been working with it on and off for 10 years or so. I need to build a quick app with GUI. What are people using now a days for form designing? Still Koda? Any of those other independent projects ever come to fruition? Looks like there's a modern apps UDF too? As part of this app, I need to have a place to make admin settings within the gui (I don't want an INI or reg keys) but I don't want the standard user to access these settings. What is the best way to do that? I'm thinking a new form with a password or something on it? Thanks, Terry
-
Yes you are correct very little code, because that's all there is.. just testing at this point to get an understanding of what was suggested to try to see if it will really work for me. The real website is a private website so you are correct you wont be able to try it yourself. however I'm trying to make my questions such that someone who has an understanding of my problem could still answer. I have read what I can and still have questions. What is different about my link (that you can see in the code) to the example link that does work? I can't be the first one with these sorts of links on a webpage that wants to download them? If I click on the link it works just fine and asks me where I want to save the file, not sure why I can't automated that. Thanks, Terry
-
Your example worked, but it did not work for one of my urls. I tried: ;$url = "http://download.mozilla.org/?product=firefox-4.0&os=win&lang=en-US" $url = "http://www.website.com/modules/common/downloaddocument.ashx?ObjectType=Topic&DocumentID=83d6491e-fd56-e011-b0e1-001cc496d8ee" ShellExecute(@ScriptDir & "\wget.exe", $url) Instead of the file I wanted I got a file called: default.aspx@ReturnUrl=%2Fmodules%2Fcommon%2Fdownloaddocument.ashx%3FObjectType=Topic&DocumentID=83d6491e-fd56-e011-b0e1-001cc496d8ee&ObjectType=Topic&DocumentID=83d6491e-fd56-e011-b0e1-001cc496d8ee Also I looked through the help but I'm not really seeing the command that I use to specify the directory to download to and how to specify a file name? Terry
-
Interesting. Do you have an examples? Have you used before? Do you know if it supports non-direct links? I'll download and give it a try. Thanks, Terry
-
There's a website that is secure, I log on with username and password. Then there's a bunch of links to documents. Some are direct links: http://www.example.com/file.wmv And some aren't: http://www.example.com/modules/common/downloaddocument.ashx?ObjectType=Topic&DocumentID=e09f5e39-2a56-e011-b0e1-001cc496d8ee In my code I am able to get the file names ($Filename) from the IE window and I'm able to get the URLs ($URL). Then I run the bit of code below: Local $hDownload = InetGet($URL, $LastFolder & "\" & $FileName, 1, 1) Do Sleep(250) Until InetGetInfo($hDownload, 2) Local $nBytes = InetGetInfo($hDownload, 0) InetClose($hDownload) All the direct files download ok. in the right spot with the right file names. None of the non-direct ones do. instead I only get 8K files with the correct file names. Is there some other command or code I could run to download the non-direct files? I searched the forum and found WinHttp.au3, but I'm unsure if that'll help me. The code also is a little challenging to figure out. For my situation. Any help would be great! Thanks, Terry
-
That was it!! But it is still weird that it says 0 links but then still shows me the text and address? Terry
-
I have Office 2010 on my system. My system is Windows 7 X64 would any of that matter? Terry
-
I'm trying to run a test to get the links from a word document. I've found several examples on how to create a new document, add a link then report on it, ... but haven't seen doing it with an existing document. So trying this code: #include <Word.au3> $oWordApp = _WordCreate("D:\temp\Content.doc") $oDocs = _WordDocGetCollection ($oWordApp, 0) $oLinks = _WordDocLinkGetCollection ($oDocs) MsgBox(0, "test", $oLinks & @CRLF & @extended & @CRLF & @error) ; Returns 0, 1, 3 $sMsg = "Link Count = " & @extended & @CRLF MsgBox(0, "test", $sMsg) ; Shows: "Link Count = 0" For $oLink In $oLinks $sMsg &= "TextToDisplay: " & $oLink.TextToDisplay & " Address: " & $oLink.Address & @CRLF Next ;>>> Get Error Here: "Variable must be of type object" MsgBox(0, "test", "4") MsgBox(64, "Links", $sMsg) The document for now is just a word document I created (.doc) and added a single link. Text = "Hi" and link="www.yahoo.com" But if you look at the code above you can see the error I'm seeing and the other msgbox'es I've put in. Can someone point out what I'm doing wrong? Thanks, Terry
-
How to select item in combo box on IE 9 webpage?
mattw112 replied to mattw112's topic in AutoIt General Help and Support
That should be better. -
There's a webpage I am on where you can select to show 20 items (default), 100 items, or "All" items. I've tried several different iterations of the following code: $oIE = _IECreate($Site) $opFrame = _IEGetObjByName ($oIE, "pgr_page_size") _IEFormElementOptionselect ($opFrame, "All", 1, "byText") I think I need to have a couple other commands in here though like: _IEFormGetObjByName _IEFormElementGetObjByName But when I look at the developer code I can't find a form name? Maybe I'm missing it. here's a screen capture of what I see. Any help? Thanks, Terry
-
Perfect! Thanks. The line number was from the compiled version which was like 8983 or some high number like that... Thanks for your help. Terry
-
I made the suggestions changes shown below and it creates the buttons, but when I press either of them I get an error: "Error: Array variable has incorrect number of subscripts or subscript dimension range exceeded" As far as I can tell it looks fine the way you sent it to me though? #include <WindowsConstants.au3> #include <SendMessage.au3> #include <GuiMenu.au3> #include <GuiListView.au3> #include <GuiButton.au3> #include <GuiConstants.au3> ; Windows User Messages Global Const $UM_ADDMESSAGE = $WM_USER + 0x100, $BS_PUSHBUTTON = 0x0 Global $hWndTarget, $sButtonPressed = "" Global $aCmdID_Button[2][2] = [["Uncheck All", 0x3000], ["Check All", 0x3001]] ; Insert Buttons into SUM _InsertButton() ; Gather information... $iPIDTarget = WinGetProcess($hWndTarget) $iThreadIdTarget = _WinAPI_GetWindowThreadProcessId($hWndTarget, $iPIDTarget) ; Install Filter(s) FileInstall(".\Files\Hook.dll", @SystemDir & "\Hook.dll", 0) $hDll_hook = DllOpen("hook.dll") ;helper dll DllCall($hDll_hook, "int", "InstallFilterDLL", "long", $WH_CALLWNDPROC, "long", $iThreadIdTarget, "hwnd", $hWndTarget) ; 0 = Ok DllCall($hDll_hook, "int", "InstallFilterDLL", "long", $WH_GETMESSAGE, "long", $iThreadIdTarget, "hwnd", $hWndTarget) ; 0 = Ok ; Register WM_COMMAND $hWndLocal = GUICreate("") ;Needed to receive Messages _SendMessage($hWndTarget, $UM_ADDMESSAGE, $WM_COMMAND, $hWndLocal) GUIRegisterMsg($WM_COMMAND, "_Filter") ; Keep running while target exists While WinExists($hWndTarget) If $sButtonPressed <> "" Then MsgBox(0, "TEST", "You clicked " & $sButtonPressed) $sButtonPressed = "" EndIf Sleep(10) WEnd ; Uninstall Filter DllCall($hDll_hook, "int", "UnInstallFilterDLL", "long", $iThreadIdTarget, "hwnd", $hWndTarget, "hwnd", $hWndLocal); 0 = ok DllClose($hDll_hook) Exit(0) ; Process Callback Func _Filter($hGUI, $iMsg, $wParam, $lParam) Switch $iMsg Case $WM_COMMAND $iCmdID = _WinAPI_LoWord($wParam) For $i = 0 To 2 If $aCmdID_Button[$i][1] = $iCmdID Then $sButtonPressed = $aCmdID_Button[$i][0] EndIf Next EndSwitch EndFunc ;==>_Filter Func _InsertButton() ; Look for SUM Window WinWait("Configuration Manager - Available Software Updates", "&Schedule Installation") $hWndTarget = WinGetHandle("Configuration Manager - Available Software Updates", "&Schedule Installation") ; Get current Button Positions $ButtonPos = ControlGetPos("Configuration Manager - Available Software Updates", "&Schedule Installation", "[CLASS:Button; INSTANCE:3]") $X = $ButtonPos[0] - 130 $Y = $ButtonPos[1] ; Create Button on Form Local $hButton For $i = 0 To UBound($aCmdID_Button) - 1 $hButton = _WinAPI_CreateWindowEx(0, "Button", $aCmdID_Button[$i][0], BitOR($BS_PUSHBUTTON, $WS_CHILD, $WS_VISIBLE), _ $X, $Y, 60, 24, $hWndTarget, $aCmdID_Button[$i][1]) _SendMessage($hButton, $__BUTTONCONSTANT_WM_SETFONT, _WinAPI_GetStockObject($__BUTTONCONSTANT_DEFAULT_GUI_FONT), True) $X += 65 Next EndFunc
-
So I took a look, very interesting. I copied your code in one of the examples and have tried to modify it to work with what I'm trying to do. It creates the buttons where I want them, but when I press the buttons nothing happens and I don't get a msgbox? #include <WindowsConstants.au3> #include <SendMessage.au3> #include <GuiMenu.au3> #include <GuiListView.au3> #include <GuiButton.au3> #include <GuiConstants.au3> ; Windows User Messages Global Const $UM_ADDMESSAGE = $WM_USER + 0x100, $BS_PUSHBUTTON = 0x0 Global $hWndTarget, $sButtonPressed = "" Global $aCmdID_Button[2][2] = [ _ ["Button 1", 0x3000], _ ["Button 2", 0x3001], _ ; Insert button into SUM _InsertButton() ; Gather information... $iPIDTarget = WinGetProcess($hWndTarget) $iThreadIdTarget = _WinAPI_GetWindowThreadProcessId($hWndTarget, $iPIDTarget) ; Install Filter(s) FileInstall(".\Files\Hook.dll", @SystemDir & "\Hook.dll", 0) $hDll_hook = DllOpen("hook.dll") ;helper dll DllCall($hDll_hook, "int", "InstallFilterDLL", "long", $WH_CALLWNDPROC, "long", $iThreadIdTarget, "hwnd", $hWndTarget) ; 0 = Ok DllCall($hDll_hook, "int", "InstallFilterDLL", "long", $WH_GETMESSAGE, "long", $iThreadIdTarget, "hwnd", $hWndTarget) ; 0 = Ok ; Register WM_COMMAND $hWndLocal = GUICreate("") ;Needed to receive Messages _SendMessage($hWndTarget, $UM_ADDMESSAGE, $WM_COMMAND, $hWndLocal) GUIRegisterMsg($WM_COMMAND, "_Filter") ; Keep running while target exists While WinExists($hWndTarget) If $sButtonPressed <> "" Then MsgBox(0, "TEST", "You clicked " & $sButtonPressed) $sButtonPressed = "" EndIf Sleep(10) WEnd ; Uninstall Filter DllCall($hDll_hook, "int", "UnInstallFilterDLL", "long", $iThreadIdTarget, "hwnd", $hWndTarget, "hwnd", $hWndLocal); 0 = ok DllClose($hDll_hook) Exit(0) ; Process Callback Func _Filter($hGUI, $iMsg, $wParam, $lParam) Switch $iMsg Case $WM_COMMAND $iCmdID = _WinAPI_LoWord($wParam) For $i = 0 To 2 If $aCmdID_Button[$i][1] = $iCmdID Then $sButtonPressed = $aCmdID_Button[$i][0] EndIf Next EndSwitch EndFunc ;==>_Filter Func _InsertButton() ; Look for SUM Window WinWait("Configuration Manager - Available Software Updates", "&Schedule Installation") $hWndTarget = WinGetHandle("Configuration Manager - Available Software Updates", "&Schedule Installation") ; Get current Button Positions $ButtonPos = ControlGetPos("Configuration Manager - Available Software Updates", "&Schedule Installation", "[CLASS:Button; INSTANCE:3]") $X = $ButtonPos[0] - 130 $Y = $ButtonPos[1] ; Create Button on Form $btnUnchecked = _GUICtrlButton_Create($hWndTarget, "Uncheck All", $X, $Y, 60, 24) $btnChecked = _GUICtrlButton_Create($hWndTarget, "Check All", $X + 65, $Y, 60, 24) EndFunc
-
I want to add a button to a Windows application that simply checks some boxes when pressed. I got the code working that checks the boxes. Now the buttons... I tried Anygui but couldn't get it working. But using _GUICtrlButton_Create I added the buttons I wanted. ok so now in my While loop the GUIGetMsg doesn't seem to be picking up the event of my button being pressed? I've put in some msgbox's after each GUIGetMsg and only get 0's. Event Mode is not enabled... I'm wondering if maybe because this isn't a AutoIt created GUI (just buttons) if my script can get Events back from those buttons being pressed? Or should it be able to? Thanks, Terry
-
So of course as soon as I hit post, the next test I did worked... arrgg Turned out all I changed was doing a ObjGet instead of a ObjCreate. Anyway seems to be working now. Thanks, Terry
-
So I posted a similar question a while back (year or so), but after working with you guys found out that what I was working on wasn't possible, but the question I had still is making me wonder. So the question is this, how do I edit a value in WMI? I've looked through the forum posts and see hundreds of posts on reading from WMI etc but not really too much on simply changing a value. I have this code: If $colMember.SiteCode <> "MOB" Then $colMember.SiteCode = "MOB" $colMember.Put_ Endif Now unlike my last post I have verified this Field is Read\Write The script always errors at the .put_ though? Is this not the correct syntax for this? Thanks, Terry
-
Well I submitted this like a week ago... Any ideas on being able to tell if the line is collapsed or not already? Thanks, Terry
-
Pretty clugy actually... just threw together stuff below. Works for what I'm trying to do except the being able to tell if it is already Collapsed or not. $Count = "0" ; Get the script name from the title bar, that will ensure get the current tab's script If WinExists("[CLASS:SciTEWindow]") Then $Title = WinGetTitle("[CLASS:SciTEWindow]") $pos = StringInStr($Title, ".au3") $Title = StringLeft($Title, $pos + 3) ; Seems like the window has to be activated for the ALTDOWN\UP, etc to work... WinActivate("[CLASS:SciTEWindow]") Else MsgBox(16, "Error", "No SciTE Window open") Exit(1) EndIf $file = FileOpen($Title, 0) While 1 $Count = $Count + 1 $line = FileReadLine($file) If @error = -1 Then ExitLoop If StringLeft($line, 4) = "Func" Then ; Go to line # ControlSend("[CLASS:SciTEWindow]", "", "Scintilla1", "^g") WinWait("Go To") WinSetState("Go To", "", @SW_HIDE) ControlSend("Go To", "", "Edit1", $Count) ControlClick("Go To", "", "Button1") Sleep(500) ; Send commands to collapse ; Assumes Func not collapsed. At some point would need to do a check to see if it already is and if not do so. ControlSend("[CLASS:SciTEWindow]", "", "Scintilla1", "{ALTDOWN}") ControlSend("[CLASS:SciTEWindow]", "", "Scintilla1", "vc") ControlSend("[CLASS:SciTEWindow]", "", "Scintilla1", "{ALTUP}") EndIf Wend FileClose($file) Exit(0) #cs ; Test if already collapsed #ce Func _Test1() ; This should be collapsed by the code EndFunc Func _Test2() ; This should be collapsed by the code EndFunc Terry
-
So I've almost got it working now... Only problem left is how do I tell if a line in the editor is folded already or not? Is there some control command I can use to get this? Terry PS - a couple other things I've worked around but would be good to know is: Is there a command to tell the editor window to go to a certain line number directly? Currently I'm just doing ctrl G. Seems like some of the controlsend's only work if the window is activated... anyway around that? Is there a way to get the text from the line where the cursor is at in the editor? Currently I'm just reading the .Au3 file figuring out what line number it is then going to the editor and going down to that line. Would be easier to just read the editor directly.
-
I'm sorry, before I posted I searched the forum on SciTe and didn't get much, but just tried searching on the control name and got tons of examples. including one for Jos that looks pretty good to start... I'll try more, but I think these examples will get me there. Terry
-
So anyone know how to interact with the control >>>> Control <<<< Class: Scintilla Instance: 1 ClassnameNN: Scintilla1 Name: Advanced (Class): [CLASS:Scintilla; INSTANCE:1] Thanks, Terry
-
Yes I know that's part of the problem. I want to be able to work on the functions one at a time, and want to be able to easily collapse all functions to begin with, because every time I build then it uncollapses regions, and the functions inside... Anyway just want to be able to interact with the code window in SCiTE and read one line at a time. If I find Func to begin with I'll Alt+V+C with collapses or uncollapses that particular line.... Thanks, Terry
-
Does anyone have any code or idea on how I would create a script that I could run that would go through the lines of code shown in the SciTe Editor window and if they start with "Func" then it collapses the line? Basically I can do the Alt+V+A to collapse or uncollapse everything, but really I just want the functions collapsed. Thanks, Terry PS - From looking at the AutoIT info tool the main window with the code just says: >>>> Control <<<< Class: Scintilla Instance: 1 ClassnameNN: Scintilla1 Name: Advanced (Class): [CLASS:Scintilla; INSTANCE:1] Not sure how to interact with that. Thanks, Terry