Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 02/12/2014 in all areas

  1. Hi If You have some function that is long and continuous, and you want to run it in a seperate way from your script, so it will not block it, then you can do this: 1) Take it out of your script, and put it in a seperate code file, 2) Run that code file seperately, for example via Run(@AutoItExe&" "&$Script_FullPath) This will make the code run in a seperate Process, and so it will run in parallel to your main script, not blocking it. My question is: Is it possible to do this more simply, without needing to move the function to a seperate code file? Maybe some Function in AutoIt exists, that gets 1 parameter which is a FunctionName, and then runs that function seperately? Thank you Zohar
    1 point
  2. Obviously you'll need to change the parameters of the search as you do the subsequent searches. Search in stripes, if it finds a pixel in one place, start your next search from the first search's results and so on and so on. Start searching at 0,0, pixel found at 0,10, second search starts at 0,11.
    1 point
  3. It probably would have taken you less time to try it yourself than to post the question...
    1 point
  4. You need to do 4 searches.
    1 point
  5. http://www.autoitscript.com/autoit3/files/archive/autoit/ Pick whichever previous version of AutoIt you'd like.
    1 point
  6. When I make interface descriptions I use header files (in this case oleacc.h) from Windows SDK to figure out the v-table order, and I use MSDN documentation to figure out the parameters (in this case IDispatch and IAccessible). This is the relevant part of oleacc.h: /* C style interface */ typedef struct IAccessibleVtbl { BEGIN_INTERFACE HRESULT ( STDMETHODCALLTYPE *QueryInterface )( __RPC__in IAccessible * This, /* [in] */ __RPC__in REFIID riid, /* [annotation][iid_is][out] */ __RPC__deref_out void **ppvObject); ULONG ( STDMETHODCALLTYPE *AddRef )( __RPC__in IAccessible * This); ULONG ( STDMETHODCALLTYPE *Release )( __RPC__in IAccessible * This); HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( __RPC__in IAccessible * This, /* [out] */ __RPC__out UINT *pctinfo); HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( __RPC__in IAccessible * This, /* [in] */ UINT iTInfo, /* [in] */ LCID lcid, /* [out] */ __RPC__deref_out_opt ITypeInfo **ppTInfo); HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( __RPC__in IAccessible * This, /* [in] */ __RPC__in REFIID riid, /* [size_is][in] */ __RPC__in_ecount_full(cNames) LPOLESTR *rgszNames, /* [range][in] */ __RPC__in_range(0,16384) UINT cNames, /* [in] */ LCID lcid, /* [size_is][out] */ __RPC__out_ecount_full(cNames) DISPID *rgDispId); /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( IAccessible * This, /* [in] */ DISPID dispIdMember, /* [in] */ REFIID riid, /* [in] */ LCID lcid, /* [in] */ WORD wFlags, /* [out][in] */ DISPPARAMS *pDispParams, /* [out] */ VARIANT *pVarResult, /* [out] */ EXCEPINFO *pExcepInfo, /* [out] */ UINT *puArgErr); /* [id][propget][hidden] */ HRESULT ( STDMETHODCALLTYPE *get_accParent )( __RPC__in IAccessible * This, /* [retval][out] */ __RPC__deref_out_opt IDispatch **ppdispParent); /* [id][propget][hidden] */ HRESULT ( STDMETHODCALLTYPE *get_accChildCount )( __RPC__in IAccessible * This, /* [retval][out] */ __RPC__out long *pcountChildren); /* [id][propget][hidden] */ HRESULT ( STDMETHODCALLTYPE *get_accChild )( __RPC__in IAccessible * This, /* [in] */ VARIANT varChild, /* [retval][out] */ __RPC__deref_out_opt IDispatch **ppdispChild); /* [id][propget][hidden] */ HRESULT ( STDMETHODCALLTYPE *get_accName )( __RPC__in IAccessible * This, /* [optional][in] */ VARIANT varChild, /* [retval][out] */ __RPC__deref_out_opt BSTR *pszName); /* [id][propget][hidden] */ HRESULT ( STDMETHODCALLTYPE *get_accValue )( __RPC__in IAccessible * This, /* [optional][in] */ VARIANT varChild, /* [retval][out] */ __RPC__deref_out_opt BSTR *pszValue); /* [id][propget][hidden] */ HRESULT ( STDMETHODCALLTYPE *get_accDescription )( __RPC__in IAccessible * This, /* [optional][in] */ VARIANT varChild, /* [retval][out] */ __RPC__deref_out_opt BSTR *pszDescription); /* [id][propget][hidden] */ HRESULT ( STDMETHODCALLTYPE *get_accRole )( __RPC__in IAccessible * This, /* [optional][in] */ VARIANT varChild, /* [retval][out] */ __RPC__out VARIANT *pvarRole); /* [id][propget][hidden] */ HRESULT ( STDMETHODCALLTYPE *get_accState )( __RPC__in IAccessible * This, /* [optional][in] */ VARIANT varChild, /* [retval][out] */ __RPC__out VARIANT *pvarState); /* [id][propget][hidden] */ HRESULT ( STDMETHODCALLTYPE *get_accHelp )( __RPC__in IAccessible * This, /* [optional][in] */ VARIANT varChild, /* [retval][out] */ __RPC__deref_out_opt BSTR *pszHelp); /* [id][propget][hidden] */ HRESULT ( STDMETHODCALLTYPE *get_accHelpTopic )( __RPC__in IAccessible * This, /* [out] */ __RPC__deref_out_opt BSTR *pszHelpFile, /* [optional][in] */ VARIANT varChild, /* [retval][out] */ __RPC__out long *pidTopic); /* [id][propget][hidden] */ HRESULT ( STDMETHODCALLTYPE *get_accKeyboardShortcut )( __RPC__in IAccessible * This, /* [optional][in] */ VARIANT varChild, /* [retval][out] */ __RPC__deref_out_opt BSTR *pszKeyboardShortcut); /* [id][propget][hidden] */ HRESULT ( STDMETHODCALLTYPE *get_accFocus )( __RPC__in IAccessible * This, /* [retval][out] */ __RPC__out VARIANT *pvarChild); /* [id][propget][hidden] */ HRESULT ( STDMETHODCALLTYPE *get_accSelection )( __RPC__in IAccessible * This, /* [retval][out] */ __RPC__out VARIANT *pvarChildren); /* [id][propget][hidden] */ HRESULT ( STDMETHODCALLTYPE *get_accDefaultAction )( __RPC__in IAccessible * This, /* [optional][in] */ VARIANT varChild, /* [retval][out] */ __RPC__deref_out_opt BSTR *pszDefaultAction); /* [id][hidden] */ HRESULT ( STDMETHODCALLTYPE *accSelect )( __RPC__in IAccessible * This, /* [in] */ long flagsSelect, /* [optional][in] */ VARIANT varChild); /* [id][hidden] */ HRESULT ( STDMETHODCALLTYPE *accLocation )( __RPC__in IAccessible * This, /* [out] */ __RPC__out long *pxLeft, /* [out] */ __RPC__out long *pyTop, /* [out] */ __RPC__out long *pcxWidth, /* [out] */ __RPC__out long *pcyHeight, /* [optional][in] */ VARIANT varChild); /* [id][hidden] */ HRESULT ( STDMETHODCALLTYPE *accNavigate )( __RPC__in IAccessible * This, /* [in] */ long navDir, /* [optional][in] */ VARIANT varStart, /* [retval][out] */ __RPC__out VARIANT *pvarEndUpAt); /* [id][hidden] */ HRESULT ( STDMETHODCALLTYPE *accHitTest )( __RPC__in IAccessible * This, /* [in] */ long xLeft, /* [in] */ long yTop, /* [retval][out] */ __RPC__out VARIANT *pvarChild); /* [id][hidden] */ HRESULT ( STDMETHODCALLTYPE *accDoDefaultAction )( __RPC__in IAccessible * This, /* [optional][in] */ VARIANT varChild); /* [id][propput][hidden] */ HRESULT ( STDMETHODCALLTYPE *put_accName )( __RPC__in IAccessible * This, /* [optional][in] */ VARIANT varChild, /* [in] */ __RPC__in BSTR szName); /* [id][propput][hidden] */ HRESULT ( STDMETHODCALLTYPE *put_accValue )( __RPC__in IAccessible * This, /* [optional][in] */ VARIANT varChild, /* [in] */ __RPC__in BSTR szValue); END_INTERFACE } IAccessibleVtbl; The first 3 methods belongs to IUnknown, next 4 to IDispatch and the last 21 to IAccessible. ObjCreateInterface adds automatically the 3 IUnknown methods. It does not add IDispatch methods. This means that the interface description string must contain 25 methods with the order as shown in the header file. You should use the MicroSoft header files. Then there is nothing to be in doubts about. If you look at the documentation for get_accParent (the link above), you'll see that it takes one parameter, it's an output parameter, and it's a pointer to a pointer to an IDispatch interface. What we have to specify is the first pointer. It's an output parameter so the specifikation must be: ptr* I have not gone through all 21 methods in IAccessible. Only the ones I've used. Some of the parameters seems to be wrong. Method names. The method names in the description string are only used in AutoIt. These names doesn't matter as long as they are different and valid AutoIt function names. For IAccessible you can use the names junkew1 to junkew21. This would work perfectly alright. But it's difficult to find documentation for junkew1. It seems easier to use the same names as are used in the documentation and in the header file. AutoItObject. You should only use AutoItObject, if you need to create your own objects. For UI Automation you should not use AutoItObject. ObjCreateInterface is much better and much faster. Because you create objects all the time speed is important. With FindAll and an IUIAutomationElementArray you can easily need to create hundreds of objects in a loop. However, you can use the same description string for ObjCreateInterface and AutoItObject. And you don't need the list descriptions. Not even for AutoItObject. You should delete the lists.
    1 point
  7. I sure would like to see it. I Actually tried doing a custom filedialog like that myself once, but I got lazy somewhere after I got file/folder rendering done But Slym said no so lets not go more off topic here. Post in Examples Scripts or in a PM?
    1 point
  8. That looks awesome! Which graphical lib are you using? SDL? GDI?
    1 point
  9. Try this: ConsoleWrite(Hex(ReverseBits(0x40), 8) & @LF) ConsoleWrite(Hex(ReverseBits(0x20), 8) & @LF) Func ReverseBits($n) ;coded by UEZ 2014 Local $iBits Switch Ceiling(Log($n + 1) / Log(2)) Case 0 To 8 $iBits = 8 Case 9 To 16 $iBits = 16 Case 17 To 32 $iBits = 32 Case Else $iBits = 64 EndSwitch Local $iCount = 0, $i, $j = 0 For $i = $iBits - 1 To 1 Step - 2 $iCount += BitAND(BitShift($n, $i), 2 ^ $j) $j +=1 Next For $i = 1 To $iBits - 1 Step 2 $iCount += BitAND(BitShift($n, -$i), 2 ^ $j) $j +=1 Next Return $iCount EndFunc Edit: code works only for unsigned integer numbers! Br, UEZ
    1 point
  10. jchd

    Regex in Autoit?

    Not your fault: this one sneakily escaped from the comma thread.
    1 point
  11. I'll do you one better, I'll give you 7 examples! They're all located in the help file under RegWrite.
    1 point
×
×
  • Create New...