Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 12/26/2016 in all areas

  1. I think you must kill the child process : Case $idStop $aPingProcess = _WinAPI_EnumChildProcess ( $iPid ) If Not @error Then ProcessClose($aPingProcess[1][0])
    2 points
  2. (This example uses a "flash" animation and therefore needs the "flash player" to work. Since "flash player" is discontinued and no longer present on many systems, this script may not work. I have therefore prepared a new script which does not use flash, but is based only on javascript. You can find it in this new post: www.autoitscript.com/forum/topic/206853-aquarium) If you set within a window, a given color as transparent, every area of that window painted with that color, act as an hole through wich you can see what's behind, and click on what's behind as well. What's funny is that if you embed a browser control within that window, the "transparent" color works even within the browser! This allow some interesting effects by simply opening any of the many javascript animations, or css effects or whatever within a browser control embedded into a GUI: Here, for example, is a simple effect of fishes swimming around on the screen. For lazyness I have embedded an ready made swf flash by a link to the web, but is of course possible embed any web page with javascripts css or whatever..... Have fun #include <WinAPI.au3> #include <WindowsConstants.au3> #include <Misc.au3> ; for _IsPressed (23 END key) Local $hDLL = DllOpen("user32.dll"), $oIE = ObjCreate("Shell.Explorer.2") Local $hBackground = GUICreate("", @DesktopWidth, @DesktopHeight, 0, 0, $WS_POPUPWINDOW, $WS_EX_LAYERED + $WS_EX_TOPMOST) Local $AlphaKey = 0xF0F7FF ; everything with color $AlphaKey within this window will be transparent ; even if within an embedded browser control!..... _WinAPI_SetLayeredWindowAttributes($hBackground, $AlphaKey, 0, $LWA_COLORKEY) GUISetState(@SW_SHOW, $hBackground) $hIE = GUICtrlCreateObj($oIE, 0, 0, @DesktopWidth, @DesktopHeight) ; <- embedd $oIE in the AutoIt GUI GUISetBkColor($AlphaKey, $hBackground) ; $AlphaKey $hBackground transparent $oIE.navigate('http://cdn.abowman.com/widgets/fish/fish.swf') ; $oIE.navigate('http://cdn.abowman.com/widgets/spider/spider.swf') ; a spider goes around on the screen .... ; !! to use the spider.swf, you need to set $AlphaKey = 0xffffff on line 7 "! While True If _IsPressed("23", $hDLL) Then ExitLoop ; END key was pressed Sleep(250) WEnd $oIE = "" $hDLL = "" GUIDelete($hBackground)
    1 point
  3. From AutoIt help file>GUICreate function>Remarks:- "The size specified is the size of the client area of the window. The border and title bar will make the window slightly larger than specified. Using menu controls will also change the windows height." WinGetPos() returns the outside dimensions of a window. WinGetClientSize() will return the window's client area, as specified in the GUICreate() function.
    1 point
  4. here is the code for specific size as in: anything between 1000 and 1330 width x 650 and 720 height $Proc = Run("C:\Program Files (x86)\Mozilla Firefox\firefox.exe") _Random() Func _Random() WinWait('[CLASS:MozillaWindowClass]') Local $aPos = WinGetPos('[CLASS:MozillaWindowClass]') Local $Handle = WinGetHandle('[CLASS:MozillaWindowClass]') Local $x = Random(1000, 1360, @DesktopWidth) Local $y = Random(650, 720, @DesktopHeight) ConsoleWrite('$x - '& $x &' $y - '&$y&@CRLF) Sleep(3000) WinMove($Handle, '', $aPos[0], $aPos[1], $x, $y) EndFunc
    1 point
  5. Im curious about what you mean with random size, do you really mean random? as in: anything between 0 and total width, and 0 and total height? This works for me, as i think you described it $Proc = Run("C:\Program Files (x86)\Mozilla Firefox\firefox.exe") _Random() Func _Random() WinWait('[CLASS:MozillaWindowClass]') Local $aPos = WinGetPos('[CLASS:MozillaWindowClass]') Local $Handle = WinGetHandle('[CLASS:MozillaWindowClass]') Local $x = Random(0, @DesktopWidth) Local $y = Random(0, @DesktopHeight) ConsoleWrite('$x - '& $x &' $y - '&$y&@CRLF) Sleep(3000) WinMove($Handle, '', $aPos[0], $aPos[1], $x, $y) EndFunc
    1 point
  6. You need to get the handle of the FF window. To do that, you can use _FFWindowGetHandle() -- #include <ff.au3> _FFStart() $ffhwnd = _FFWindowGetHandle() WinMove($ffhwnd, "", 0, 0, 400, 400)
    1 point
  7. Every time I thought I needed a better understanding of au3check, I really needed a better understanding AutoIt. It's still an odd dynamic, I would almost call it territorial if I didn't already know it was crotchety senior citizens
    1 point
  8. jguinch

    IniWrite gets ignored

    Try to specify the full path of the ini file : IniWrite(@ScriptDir & "\settings.ini", "General", "PathToConfig", $newPath)
    1 point
  9. ok ok... i've found .. end of the monologue.. thanks. Json_Put($Obj,'["POPO"]["NUM_CONTRAT"]','valeurtoto') Json_Put($Obj,'["POPO"][bplbb][rzrrzr]','valeurtoto') Json_Put($Obj,'["POPO"]["0000000045646"][rzrrtttzr]','valeurtoto') Json_Put($Obj, ".bar[0]", "bar") Json_Put($Obj, ".test[1].foo.bar[2].foo.bar", "Test") ; dot notation EDIT: Use of Quote & double quote important example: $akeys = Json_ObjGetKeys($JsoEqpt) Json_Get($JsoEqpt, '["' & $akeys[0] & '"]["tagInge"]') => OK Key between Double quotes: ' [ " ' & $akeys Json_Get($JsoEqpt, '["' & $akeys[0] & "']['tagInge']") => Not OK, key between simple quotes " [ ' " & $akeys I must indicate that my keys are Numbers only overwise i think it's ok with string key!
    1 point
  10. AndreyS, When you specify styles when creating a control you overwrite the default styles set by AutoIt. For a picture control, the default style is $SS_NOTIFY, so by only specifying another style you remove that style and so will not get notification of a click. By re-adding the style, the script works as you require: $idPic = GUICtrlCreatePic("M:\Program\AutoIt3\Examples\GUI\mslogo.jpg", 50, 50, 200, 50, BitOr($SS_SUNKEN, $SS_NOTIFY)) The Setting Styles tutorial in the Wiki explains in more detail. M23
    1 point
  11. BitOR($COMPRESSION_FORMAT_XPRESS_HUFF, $COMPRESSION_ENGINE_MAXIMUM);@error - 10, @extended - C00000E8 why is it problem?
    1 point
  12. Can you show us the code you tried that didn't work? Also, have you considered using WinMove to set the window's size once FF has loaded?
    1 point
  13. trancexx

    Flash-matic

    was asked the other day. That first post hides a great idea an code. Unfortunately it's not AutoIt. It's something that was never done in this language and almost impossible to be done before AutoItObject, you need AutoItObject. Remember that, you need AutoItObject. Hahaha... After some googling two links crystallized, stackoverflow's and Delphy Flash thing. Read both to compare it to AutoIt's version. My conclusion is that AutoIt is as good as any language when it comes to object manipulation. Even easier to work with. Shockwave object was used before in AutoIt scripts, there isn't much to say about that. The main issue that was resolved here is how to load swf from memory, variable. If someone would inspect Flash typelib with some available tool (hey, , how interesting), he/she could see that IShockwaveFlash is IDispatch based interface with few available methods for loading files. But there is none to load either memory or stream. So, Idispatch can load only files from disk (yours or somebody elses), nothing more. On the other hand linked articles suggest that IUnknown can load stream. This is where conventional AutoIt is lost and where AutoItObject takes control. Described in steps, it would be: Create Shockwave objectExpand it to IUnknown levelCreate Stream object on (out of) SWF data Ask Shockwave object for PersistStreamInit objectCall InitNew method of PersistStreamInit object to initialize itUse Load method to load Stream of SWF dataCreate Shockwave object control in Autoit GUIInteresting thing is that you don't need to have Flash installed on system where this could be run. All your app would need in that case is Flash dll. Accessible Flash10m.ocx for example. Another interesting thing is that you can embed files in both scripts (as in this example) and executables as resources and run it from there. I have added little input control, you'll figure out what's it for. By using AutoItObject you get Ward's base64 decoder for free. I used that to shrink the size of the embedded file. Script (don't miss): SWF.au3 Everybody loves Duck Sauce, is this amazing or is this amazing?
    1 point
  14. Khumprp, I had similar issues as you, after trying titles and classes, I found the simplest way was to simply kill the process. ProcessClose("firefox.exe") This sometimes generates a restore tab when FF is started up again. If you want to start FF without a restore tab then in FF 1) type about:config in website bar and click ok 2) in Filter type in crash 3) double click browser.sessionstore.resume_from_crash till it says false under value
    1 point
  15. There's a number of windows that show up for that class when I have Firefox open. You need to find the right one of course. You *could* use a title search to find '- Mozilla Firefox' in the name, but if you have a document open with that name then you'd be screwed (unless you checked the process too). Here's one way to go through the window list and find the right Firefox window to close (it looks for a window without the WS_POPUP flag.): #include <WinAPI.au3> #include <Constants.au3> #include <WindowsConstants.au3> Local $hFireFoxWin=0,$aWinList=WinList("[REGEXPCLASS:Mozilla(UI)?WindowClass]") For $i=1 To $aWinList[0][0] If BitAND(_WinAPI_GetWindowLong($aWinList[$i][1],$GWL_STYLE),$WS_POPUP)=0 Then $hFireFoxWin=$aWinList[$i][1] ExitLoop EndIf Next If $hFireFoxWin Then WinClose($hFireFoxWin) *edit: Meh, easiest way: $hFirefoxWin=WinGetHandle("[REGEXPTITLE: - Mozilla Firefox$;REGEXPCLASS:Mozilla(UI)?WindowClass]") WinClose($hFirefoxWin)
    1 point
×
×
  • Create New...