
BAM5
Active Members-
Posts
88 -
Joined
-
Last visited
Everything posted by BAM5
-
Resizing Window Causes Whited Out Controls
BAM5 replied to BAM5's topic in AutoIt General Help and Support
That did it! (Sort of, see below) Thank you so much PhoenixXL I searched all over but to no avail not having a clue what to search for. You've made my day. Jon: Yeah, I tried that but it didn't work, maybe it would have if I passed it the right combination of flags. Thank you both for your help. Although I would like furthur input. When I add that style, I didn't notice at first, but the IE object starts to flicker really bad when I move the cursor over it, possibly due to heavy rendering process of the frame not being able to draw fast enough? Is there a way for me to tell it to draw over the old image instead of setting all the pixels to background color and then drawing over that? -
So I'm making this gui with an embedded IE object. It all goes well until I add some functionality, one in particular and it's a big one, the window will be in the same place and same size as you left it when you last exited the program. No big deal until I found that when I resize the window programmatically the controls below the IE Object seemingly disappear. Look a little closer and I find that they're not invisible, just white. I messed around and found out that it has something to do with having the style $WS_CLIPCHILDREN on the gui. I take it off and the controls show up no problem, but then the whole IE object freezes so that's definitely not the solution I'm looking for. I've tried searching the forums, the internet, and the help file, but I can't find the answer to this evil problem. One thing I noticed was that if I resized the window just the slightest with the mouse all the controls would reappear, or if I hovered on them they parts of the control would reappear piece by piece. So I tried using some window redraw / repaint functions, I've tried several different winmove functions, and I even went so far as to try to emulate resizing the window through the mouse by using the _SendMessage function to send the individual WM_ENTERSIZEMOVE, WM_SIZING, WM_SIZE, and WM_EXITSIZEMOVE messages to the window, but to no avail. However if I set a certain size of window with the WM_SIZE message that wasn't the window size it would show up in the window with a bunch of whitespace because it wasn't taking up the whole window, but that isn't germane and I digress. If anyone knows any rerendering messages I could send the the window please post them here! I'm willing to try anything at the moment. I assume there's a message I'm missing in the resizing emulation since it isn't coming out right. Oh, another thing that would be helpful is if someone knew how to monitor all the messages going to my gui, instead of just specific individual messages defined by the GUIRegisterMsg function. Below is a far shortened example of my code along with the screen shot of it with a few citations. #include <IE.au3> #include <Array.au3> #include <WinAPI.au3> #include <Constants.au3> #include <ButtonConstants.au3> #include <ComboConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> $name = @UserName $opts = " |Me ("&$name&")" $oIE = _IECreateEmbedded() $Main = GUICreate("Example of Frustration", 795, 610, 192, 124, BitOR($GUI_SS_DEFAULT_GUI,$WS_SIZEBOX,$WS_THICKFRAME,$WS_CLIPCHILDREN)) $ObjectIE = GUICtrlCreateObj($oIE, 8, 8, 777, 561) GUICtrlSetResizing(-1, $GUI_DOCKTOP+$GUI_DOCKRIGHT+$GUI_DOCKBOTTOM+$GUI_DOCKLEFT) GUICtrlCreateLabel("Follow", 8, 580, 34, 17, $WS_CLIPSIBLINGS) GUICtrlSetResizing(-1, $GUI_DOCKLEFT+$GUI_DOCKBOTTOM+$GUI_DOCKWIDTH+$GUI_DOCKHEIGHT) $ComboFollow = GUICtrlCreateCombo("", 48, 578, 145, 25, BitOR($CBS_DROPDOWNLIST,$CBS_AUTOHSCROLL,$WS_CLIPSIBLINGS)) $default = " " GUICtrlSetData(-1, $opts, $default) GUICtrlSetResizing(-1, $GUI_DOCKLEFT+$GUI_DOCKBOTTOM+$GUI_DOCKWIDTH+$GUI_DOCKHEIGHT) $SliderOpacity = GUICtrlCreateSlider(280, 576, 150, 25) GUICtrlSetLimit(-1, 255, 55) GUICtrlSetData(-1, 255) GUICtrlSetResizing(-1, $GUI_DOCKLEFT+$GUI_DOCKBOTTOM+$GUI_DOCKWIDTH+$GUI_DOCKHEIGHT) $ButtonFullscreen = GUICtrlCreateButton("Faux Fullscreen", 680, 576, 107, 25, $WS_CLIPSIBLINGS) GUICtrlSetResizing(-1, $GUI_DOCKRIGHT+$GUI_DOCKBOTTOM+$GUI_DOCKWIDTH+$GUI_DOCKHEIGHT) _IENavigate($oIE, "http://google.com") GUISetState(@SW_SHOW) _WinAPI_MoveWindow($Main, 100, 100, 450, 350) While 1 If GUIGetMsg() = $GUI_EVENT_CLOSE Then Exit WEnd Thanks for your time! -Brian
-
Placing an application window over a game (full screen)?
BAM5 replied to dtudin01's topic in AutoIt General Help and Support
Good afternoon, Not sure if this was ever resolved, but if so would you be able to post the solution? Or possibly someone new could look at this and see what they come up with. I'm currently trying to overlay a map on DayZ so as not to have to switch back and forth between the game window and the map. Thanks, -Brian -
Amazing library! Especially when you couple it with your ColorChooser Library! This is exactly what I'm looking for, thanks for sharing your hard work.
-
To get all the text within the console buffer you'd need to set the following variables like so: Local $iLeft = 0 Local $iTop = 0 Local $iRight = DllStructGetData( $pConsoleScreenBufferInfo, 1) -1 Local $iBottom = DllStructGetData( $pConsoleScreenBufferInfo, 2) -1 Anything that scrolls up past that is gone. dwSizeX and dwSizeY unmodified won't work because those are the max width/height, not the max value for each x/y coordinate. It's like an array, you have 5 elements in an array, but to access the 5th element you use the index 4. Also, the $coordBufferCoord variable must be equal to 0, it wouldn't make sense any other way. It took me hours to find that error from the code I coppied. (I really should've read your last post >_< ) Anyway, not sure if you've figured that out yet, thought I'd help you out since this code will do nicely for a project of mine
-
Windows Update Agent Async classes (COM)
BAM5 replied to BAM5's topic in AutoIt General Help and Support
I found a few things that might make this work, but have been unable to make it work myself, perhaps a few of you gents may have better luck with it than I have since I'm not the most experienced with this sort of programming. I stumbled upon a library called AutoItObject which allows the creation of COM objects and classes in autoit but I've been unable thus far to use it as an object that gets called by the beginsearch method. http://autoitobject.origo.ethz.ch/ Some other possibly relevant topics: Here's some of the code I've written: ;========================================================================================== ; _WUA_Search([$query]) ; ; Remarks: Searches through updates for the current computer that match the given ; search criteria. ; Parameters: $query(Optional) - Search Criteria that will filter out the updates.' ; $finished(Optional) - A string containing the function name to call when ; the search is finished. If omited then the search will ; be procedural. Function should have 1 parameter which ; will be the search result. ; Returns: An object reference to a search result Object. ;========================================================================================== Func _WUA_Search($query = "IsInstalled=0", $finished = false) If $WUA == -1 Then $WUA = ObjCreate("Microsoft.Update.Session") EndIf Local $searcher = $WUA.CreateupdateSearcher() If $finished Then ;~ Local $searchCallback = _AutoItObject_Create() ;~ if not _AutoItObject_AddMethod($searchCallback, "Invoke", ) then MsgBox(0, "Error!", "Didn't add method") Local $searchCallback = _AutoItObject_Class() $searchCallback.Create() $searchCallback.AddMethod("Invoke", "_WUA_SearchFinish") $searcher.BeginSearch($query, $searchCallback.Object, _WUA_SearchStateClass($searchCallback, $finished)) if @error Then MsgBox(0, "Error", "Error starting an async search") Else Return $searcher.Search($query) EndIf EndFunc Func _WUA_SearchFinish($searchJob, $callbackArgs) MsgBox(0, "Done!", "Search Complete!") $searcherState = $searchJob.AsyncState Call($searcherState.Finished, $searcherState.Searcher.FinishSearch($searchJob)) EndFunc Func _WUA_SearchStateClass($searcher, $finish) Local $oClassObject = _AutoItObject_Class() $oClassObject.Create() $oClassObject.AddProperty("Searcher", $ELSCOPE_PUBLIC, $searcher) $oClassObject.AddProperty("Finished", $ELSCOPE_PUBLIC, $finish) Return $oClassObject.Object EndFunc -
Windows Update Agent Async classes (COM)
BAM5 replied to BAM5's topic in AutoIt General Help and Support
Anyone? Anyone at all? -
I am attempting to make an auto windows updater to automate a process we do over and over here at my job. I'm using the Microsoft.Update.Session COM object to search, download, and install updates. As you can guess downloading and installing possibly hundreds of updates could take a while and my problem is that what I have working right now is synchronous to my script so it pauses which could seem like it's freezing. So I look at how to do it in an asynchronous fashion, which appears to be possible, but there's one small catch. It wants me to pass it an object that has a method called invoke which then gets passed the progress information. etc etc. So my problem is that I need to be able to create an object that has a method called invoke in autoit and I have no idea how I'd go about doing that. Is there some sort of com object that is dynamic that I can set a custom method on? Here's the MSDN reference to the function that takes the "progress event" object. http://msdn.microsoft.com/en-us/library/aa386132%28v=VS.85%29.aspx Script so far: #include <Array.au3> Dim $arr[1][2] $test = ObjCreate("Microsoft.Update.Session") $test2 = $test.CreateUpdateSearcher() $result = $test2.Search("(IsInstalled=0 and Type='Driver' and IsHidden=0) or (IsInstalled=0 and CategoryIDs contains 'E6CF1350-C01B-414D-A61F-263D14D133B4' and IsHidden=0) or (IsInstalled=0 and CategoryIDs contains '0FA1201D-4330-4FA8-8AE9-B877473B6441' and IsHidden=0)") ConsoleWrite("Updates: " & $result.Updates.Count & @CRLF) For $i = 0 To $result.Updates.Count-1 $update = $result.Updates.Item($i) ConsoleWrite(($i + 1) & "> " & $update.Title & @CRLF) $i = UBound($arr) ReDim $arr[$i+1][2] $arr[$i][0] = $update.Title $arr[$i][1] = $update.DownloadPriority Next _ArraySort($arr) _ArrayDisplay($arr) Any ideas are greatly appreciated.
-
<3 I thought it was something like that, but I'm not that experienced in windows programming, just autoit.
-
I'll write one up right now. #include <GUIConstantsEx.au3> #include <GuiStatusBar.au3> #include <WindowsConstants.au3> ;~ Opt("GUIOnEventMode", 1) Dim $parts[1] = [-1] $main = GUICreate("Statusbar clicking", 377, 80, 192, 124) GUISetOnEvent($GUI_EVENT_CLOSE, "close") $status = _GUICtrlStatusBar_Create($main) _GUICtrlStatusBar_SetMinHeight($status, 27) _GUICtrlStatusBar_SetParts($status, $parts) $_button = GUICtrlCreateButton("This CAN'T trigger anything", 0, 0, 150, 22) ;~ GUICtrlSetOnEvent(-1, "click") $_hndl = GUICtrlGetHandle($_button) _GUICtrlStatusBar_EmbedControl($status, 0, $_hndl, 3) GUISetState(@SW_SHOW) While 1 Sleep(10) Switch GUIGetMsg() Case $_button MsgBox(0, "Awesome", "This works"); doesn't actually work :( Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd Func close() Exit EndFunc Func click() MsgBox(0, "Awesome", "This works"); doesn't actually work :( EndFunc I included both methods, GUIGetMsg and Events.
-
Alright, the previous didn't work for controls in the status bar, but did work for when you clicked the statusbar itself. So I could still use some help here!
-
Found it after doing a google search of the forums. 2nd post in this topic: http://www.autoitscript.com/forum/index.php?showtopic=63451
-
I could really use some help with this.
-
I've looked through the forums and the help file, but I can't figure out why the button or pic objects that work out of the status bar in the gui don't work while in the status bar. Neither events nor GUIGetMsg works. Could someone explain what's happening here?
-
Disecting Set-Cookie header with StringRegExp (half-solved)
BAM5 replied to BAM5's topic in AutoIt General Help and Support
After messing around a bit I figured out this pattern: ([^=]+)=([^;]+); (?:(path)=(\S+)\s?)?(secure|HttpOnly)?\s?(secure|HttpOnly)?\s? It isn't exactly what I was looking for, but it works. -
Disecting Set-Cookie header with StringRegExp (half-solved)
BAM5 replied to BAM5's topic in AutoIt General Help and Support
Ah, namexxx=yyy expires=ttt and path=zzz are all required for cookies, but there are other values that can be added in optionally as well (such as domain and max-age), so unfortunately, your sre will not work for me. A modification of the second pattern I posted almost works, except for when the httponly flag is up and secure isn't, it'll cause an blank element in the array. Modification: ([^=]+)=([^;]+); (?:(path)=(\S+)\s?)?(?:(secure)\s?|(HttpOnly)\s?){0,2} -
I'm attempting to take the string a server returns in the Set-Cookie header and break it up into its bits and pieces and have come pretty close with this. Set-Cookie string looks like this: "Name=value; expires=Thu, 02-Sep-2010 16:44:12 GMT; path=/ Name=value; expires=Thu, 02-Sep-2010 16:44:12 GMT; path=/ secure Name2=Value2; expires=Wed, 02-Sep-2010 16:44:12 GMT; path=/ HttpOnly name3=value3; expires=Thu, 02-Sep-2010 16:44:12 GMT; path=/ secure HttpOnly" ([^=]+)=([^;]+); (?:(path)=(\S+)\s?)? This will work for all cookies without the HttpOnly and secure flag. ([^=]+)=([^;]+); (?:(path)=(\S+)\s?)?(?:(secure)?\s?|(HttpOnly)?\s?){0,2} Is what I came up with for the flags, but for some reason it doesn't work. Could some sre master out there point out the error of my ways? Thanks BAM5
-
Check out the JSON udf I've recently added. There's also been another one posted but I don't know if that one works well. Link is in my sig.
-
Ok, so when you press the Start button it goes into a loop which it never exits. Meaning your bot will not respond to anything else you tell it to do, it'll just endlessly do that loop. So instead do this #include <GUIConstants.au3> #include <TabConstants.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #include <UpdownConstants.au3> #include <EditConstants.au3> #include <ButtonConstants.au3> #include <ComboConstants.au3> ;- Get image Inetget("http://gamer.siammaster.com/images/dekaron-logo.gif", @TempDir & "\dekaron-logo.gif",0,0) ;- Done $BotGui = GUICreate("Dekaron Spambot v1", 400,400,300,250, $WS_POPUP,BitOR($WS_EX_TOPMOST,$WS_EX_TOOLWINDOW)) WinActivate("Dekaron") WinWaitActive ("Dekaron") GUISetBkColor(0x140000) GUISetFont(11,400,0,"Constantia",$BotGui) $GUI_Pic_Map = GUICtrlCreatePic(@TempDir & "\dekaron-logo.gif", 0, 0, 400, 150,0) Winsettrans("dekaron Spambot v1","",180) GUICtrlCreateLabel("Dekaron Spam Bot v1",110,150,200,25) GUICtrlSetColor(-1,0xFF0000) GUICtrlSetFont(-1,14,500, 0,"Constantia") GUICtrlCreateGroup("",0,60,200,10) GUICtrlSetColor(-1,0xFF0000) GUISetState(@SW_SHOW) $Button1 = GUICtrlCreateButton("Start Bot", 50,350,60,20) $Button2 = GUICtrlCreateButton("Pause Bot", 120,350,60,20) $Button3 = GUICtrlCreateButton("Exit Bot", 220,350,60,20) $DoStuff = False While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button1 _Start() Case $Button2 _Pause() Case $Button3 _Ende() EndSwitch If $DoStuff Then ControlSend ( "Dekaron", "", "", "1") sleep(1000) EndIf WEnd Func _Start() $DoStuff = True EndFunc Func _Pause() $DoStuff = False EndFunc Func _Ende() MsgBox(0, "© by Black", "Dekaron Spambot v1", 10000) Exit EndFunc But this also means that the bot will take longer to respond to clicks etc. when $DoStuff is true (When the bot is on). But at least it will respond.
-
No it wouldn't. It would make your picture non clickable. The pic might be stealing the focus.
-
I believe you have to disable the picture with GuiSetStateGuiCtrlSetState(-1, $GUI_DISABLE). I did indeed mean GuiCtrlSetState Jos.
-
Link AutoIT with another language?
BAM5 replied to Minikori's topic in AutoIt General Help and Support
Quickest way I can think of is to allocate some memory and tag it with a specific unique value, the have autoit search through the memory and replace the values. Don't know how it'll work, don't know how to script it, but I'm pretty sure it can be done. -
(Yet another)StringRegExp(SRE) Topic
BAM5 replied to BAM5's topic in AutoIt General Help and Support
Ok, now there's more. I want to get the path of the url after the domain so I have this: (?:https*://|\A)([\w.]+)(/.+)\?{0,1} It works, but I don't want the question mark to be captured, which it will when there is one. Thanks for all your help so far! Edit: O hey, thanks SmOke_N, I'll look at that when I get home, I have to get to class now. -
(Yet another)StringRegExp(SRE) Topic
BAM5 replied to BAM5's topic in AutoIt General Help and Support
All things HTTP, not FTP -
(Yet another)StringRegExp(SRE) Topic
BAM5 replied to BAM5's topic in AutoIt General Help and Support
I've adapted this off of your previous posts '(?:https*://|\A)([\w.]+)' And it works perfectly, thanks! Edit:Revised again