Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 06/13/2013 in all areas

  1. Yashied

    WinAPIEx UDF

    LAST VERSION - 3.8 03-Jul-12 This library contains the WinAPI functions are not included for unknown reasons to the native AutoIt WinAPI library. I use this UDF in nearly all of my programs, and decided to share it with the AutoIt community. I agree that over time some of these functions will be part of the native AutoIt library, but still... The library includes some undocumented, but useful functions (eg _WinAPI_GetFontResourceInfo()). The library also contains all the necessary constants to work with the appropriate functions. Most functions from this UDF intended for experienced users, but beginners will find the same lot of useful information for yourself. I will be to periodically add new functions to the library. The archive contains WinAPIEx library, and as usual an excellent examples from me. Some examples I took from this forum and to simplify them for better understanding. For those who use SciTE (full version) I have prepared the au3.userudfs.properties and au3.user.calltips.api files to highlight functions from this UDF in your scripts. Just copy this files to ...SciTEProperties and ...SciTEAPI, respectively. I hope this UDF will be useful for many as for me. I look forward to any feedback and suggestions. Maybe somebody wants to add new WinAPI functions? Credits Available functions Files to download WinAPIEx UDF v3.8 for AutoIt 3.3.6.1 Previous downloads: 27953 WinAPIEx UDF v3.8 for AutoIt 3.3.8.x Previous downloads: 14850
    2 points
  2. Mobius

    AutoCamo - 98.18b

    Last updated 9/10/21 * Image may not represent current product Features Simple Integrated countermeasures against file and memory analysis based decompilers. Add basic types of resources into the interpreter or other types as raw data. Define multiple programs to execute pre and post build. Create and include pe version information. User defined patches that can be implemented globally on the interpreter and compiler or selectively. Handles its own basic macro's as well as environment variables in most fields for easier path finding. Drag and drop configs (script bound or separate) to the input edit box or to the icon to load them. Configuration settings can be copied to the clipboard or saved as config files or Au3 scripts. Settings can now be saved directly to an AutoIt3 script. Subsystem independant, can act as a gui or console tool. And much more. See next post for update information. A3C_97.16b.7z A3C_98_18_b.zip
    1 point
  3. I know TimerInit / TimerDiff works for many people over many years without problems, but I have a case where these functions fail. I know also to handle the return value of TimerInit as a handle and not directly to work on it (except with TimerDiff). But this value is nothing else than the return value of Win32-Api call to QueryPerformanceCounter(...). It seems the Timer functions assume the internal counter as 64Bit. But in my case the value will wrap around after reaching the maximum of an unsigned 32Bit value. This may lead to negative TimerDiff return values. e.g.: take TimerInit short time before the overflow and do TimerDiff after the overflow, then TimerDiff returns negative values. This happens on a Windows XP 32Bit SP3 running on a Hyper-V machine (based on a AMD-Phenom processor). The question is: Why do I get this negative values? I wrote my own TimerInit/TimerDiff function in C++ using the windows API functions. I also see the 32bit overflow ( in my case every 20min) and the calculation is based on integer math only. This compensates the overflow. With my integer only implementation I always get the correct difference (where AutoIt will fail). I guess it has something to do with the internal implementation, because the AutoIT functions seems to work with double values, so maybe the internal functions casts the counter values to double and the calculation is based on double operations? My test code should show the details. There is also a try to solve the problem with AutoIT code using the API function directly. I know this would only work for 32bit values, but in case of 64bit values it take a very long time to get wrong... And yes, it may not happen on every machine, maybe only on Hyper-V hosted XPs.... $fp = FileOpen("timer_test.txt",1) $F = DllCall("Kernel32.dll", "Int", "QueryPerformanceFrequency", "int64*", "") $maxint = 4294967296 Do Local $TimeNow = TimerInit() $S = DllCall("Kernel32.dll", "Int", "QueryPerformanceCounter", "int64*", "") Sleep(1000) Local $TimeDiff = TimerDiff($TimeNow) $E = DllCall("Kernel32.dll", "Int", "QueryPerformanceCounter", "int64*", "") Local $diff = $E[1]-$S[1] ; Correct overflow If $E[1] < $S[1] Then $diff += $maxint ; Because there is no real integer operation in AutoIT, add the 32bit max int to correct value! FileWriteLine( $fp, @CRLF & "Time diff using QPC:" & @CRLF & "Start: " & $S[1] & " End: " & $E[1] & " " & " Diff: " & $diff & " " & "Freq.: " & $F[1] & @CRLF & "(E-S)/F= " & $diff/$F[1] & " sec" & @CRLF) FileWriteLine( $fp, "Using AutoIT - Init: " & $TimeNow & " Diff (ms): " & $TimeDiff ) Until $TimeDiff < 0 ; may not stop if your system is using 64bit timer values.... My output looks like that: : : Time diff using QPC: Start: 4284216198 End: 4287790942 Diff: 3574744 Freq.: 3579545 (E-S)/F= 0.998658768083653 sec Using AutoIT - Init: 4284216041 Diff (ms): 998.626082365217 Time diff using QPC: Start: 4287795275 End: 4291474056 Diff: 3678781 Freq.: 3579545 (E-S)/F= 1.02772307653626 sec Using AutoIT - Init: 4287795136 Diff (ms): 1027.56132413477 Time diff using QPC: Start: 4291479430 End: 82755 Diff: 3570621 Freq.: 3579545 (E-S)/F= 0.997506945715168 sec Using AutoIT - Init: 4291479108 Diff (ms): -1198866.52297988 THX in advance!
    1 point
  4. Maybe you give the WinApiEX function with the fabulous name _WinAPI_ShellOpenFolderAndSelectItems() a try too?
    1 point
  5. ssnake, Scroll down in this page and you will see all the possibilites for GUIs. Controls are slight different as you can see here. M23
    1 point
  6. helpfile: Window Titles and Text (Advanced) or, got to wingethandle, and there is a link to the above wingethandle
    1 point
  7. Hi, Really? Local $hWnd = WinGetHandle("[TITLE:Entrada do documento;CLASS:SAP_FRONTEND_SESSION]") ConsoleWrite($hWnd & @CrLf) Br, FireFox.
    1 point
  8. Hi Firefox, >It's not correct to pass a constant variable by reference. 2 remarks wrt that: A) Why do you say this is not correct. If you are familiar with C, i expect const byref to be equivalent of passing a writable pointer to a const entity (see eg http://en.wikipedia.org/wiki/Const-correctness) . There is nothing fundamentally incorrect with the language construct. B ) While it is of course always possible that the autoit language does not support this concept, I do not think that is the case here, because it did not generate get the same error for function 1 which has exactly the same prototype. You only get this error when you pass through a const byref argument to a another function call, as TheGeneral pointed out in his original code example. So this seems to indicate an au3check bug, not a language limitation (the code also runs fine, as remarked in a previous post, it is just au3check that complains). >I don't see the point at all to use the const keyword in your function parameters. There are plenty of reasons to do that, such as: - It helps to clarify the user of the function what the function will do with the arguments he provides to it. Eg if the user of a function has large amount of data that he/she does not want to have changed which he needs to pass as an argument, and the function has a byref, then the only thing the user can do is first make a copy of that data en then passing the copy, because the function is allowed to change the data. This completely destroys the performance gains of a byref of course. However, if the function has a const byref type, then the user can safely pass his orignal data to the function knowing that it will not be changed. So in a way, in a lot of cases of byref I think is almost useless to not speficy const byref, the only case where a plain byref is usefull is when the function is meant to fill in the data in the argument you provide. - prevent bugs in which the function accidentially change the contents - perfomance optimisations the compiler can do when he knows the data is constant, ... (I probably missed a few, google it, there are plenty of in depth discussions regarding this topic).
    1 point
  9. ah. I didn't see the line because it's half truncated. If you want to receive the resp of the command use the TCPRecv function. $sResp = TCPRecv($socket, 1024) If $sResp <> "" Then ConsoleWrite($sResp & @CrLf) EndIf Br, FireFox.
    1 point
  10. AaronOoi, Have you read the Managing Multiple GUIs tutorial in the Wiki? If not I would do so now. Come back if you still have problems. M23
    1 point
  11. The only documentation for it that I know of is in the Using AutoIt > Running Scripts part of the help file. It doesn't go in to very much detail. It's at the bottom of the page under "AutoIt specific command Line Switches". Both Beep() and FileOpenDialog() worked fine for me using AutoIt3ExecuteLine. Strange that it didn't for you. $sTempau3 = 'FileOpenDialog(''' & $sTitle & ''', '''', '''')' Run(@AutoItExe & ' /AutoIt3ExecuteLine "' & $sTempau3 & '"') $sTempau3 = 'Beep()' Run(@AutoItExe & ' /AutoIt3ExecuteLine "' & $sTempau3 & '"')
    1 point
  12. http://mapcarta.com/20673618 *Cough* Seems fairly normal to me.
    1 point
  13. Better yet, don't use a temp file at all by getting the winwait and controlfocus in the same singe line. $sTitle = 'This is my file open title' $sTempau3 = "If WinWaitActive('" & $sTitle & "', '', 10) And ControlFocus('" & $sTitle & "', '', '[CLASS:DirectUIHWND; INSTANCE:2]') Then ConsoleWrite('')" Run(@AutoItExe & ' /AutoIt3ExecuteLine "' & $sTempau3 & '"') FileOpenDialog($sTitle,'','')
    1 point
  14. If you are trying to avoid writing your own fileopendialog, then you could write a temp file to do the work for you. $sTitle = 'This is my file open title' $sTempau3 = "WinWaitActive('" & $sTitle & "', '', 10)" & @CRLF $sTempau3 &= "ControlFocus('" & $sTitle & "', '', '[CLASS:DirectUIHWND; INSTANCE:2]')" $hFile = FileOpen(@TempDir & '\tempau3.au3', 2) FileWrite($hFile, $sTempau3) FileClose($hFile) Run(@AutoItExe & ' /AutoIt3ExecuteScript "' & @TempDir & '\tempau3.au3"') FileOpenDialog($sTitle,'','')
    1 point
  15. I presume you've tried the Window Info Tool, and used Window Title, Class, etc? And Tabs etc if need be?
    1 point
  16. Melba23

    New MVPs

    In case anyone had not noticed, I am happy to announce that we have three new MVPs: PhoenixXL, FireFox and kylomas. I am sure you will all join in with my hearty congratulations to them all. M23
    1 point
  17. @Mechaflash thanks for the clarification, very cool way to do it! Since my trigger word is not in the third position, I will modify your loop to look in the correct spot. The quality of people who roam this forum are second to none! -Mike
    1 point
  18. Jos

    How to use IsPressed?

    Show off
    1 point
×
×
  • Create New...