Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 01/27/2020 in all areas

  1. In this post I take the opportunity to show the awesome capabilities of AutoIt and its libraries. My open source project Peace is a long running AutoIt based app located on SourceForge. It provides users with a system-wide equalizer and effects machine. It's an interface using the power of Equalizer APO, an audio processing object software. Peace has been download over 2,600,000 times by various kind of users. Amongst others it gives them possibilities like these: Hearing impaired - Amplify the gain of frequencies which are impaired. Home Theatre - Create Equalizer presets for watching movies and listening to music. Music lovers & audiophiles - Create presets for listening to music on their high quality speakers and headphones. Gamers - Enhance frequencies to get an edge over other gamers. Headphones - Improve the sound quality of cheap headphones and get the max out of expensive ones. Bass lovers - Boost low frequencies for extra bass. Voice - Make a microphone sound better and improve the voice, for instance for YouTube usage. Low audio - Boost low audio of an input source to a comfortable level. This list covers the main needs of the Peace user. Many people have contacted me over the years asking for new features and telling me how they use Peace for their (sometimes specific) needs. I was able to use AutoIt and its libraries for all of their needs. So what are the main features of Peace? Equalize your computer audio by using up to 31 sliders. Support of equalizing 9 speakers : left/right, center, subwoofer, left/right rear, left/right side. Per slider a filter can be chosen such as peak, low/high pass, shelving. The graph windows shows your equalization so you see exactly what you're doing. Apply an effect such as crossfeed simple/Jan Meier/Chu Moy, stereo balance, bass/treble, upmix/downmix, channel routing. Save presets (called configurations) and activate by mouse click, hotkey, desktop shortcut or Peace system tray. Select a target device to equalize, microphone as input can also be equalized. Automate: you can let Peace automatically activate presets on a switch to another device and another process. Peace is available in these languages: English, Czech, Deutsch, Français, Italiano, Nederlands, Pусский, Українська So who am I? I'm a Dutch programmer who happens the stumble upon AutoIt 5 years ago and created a small Equalizer interface app of less than 400 program lines with it. Nowadays Peace has grown to more than 18,000 lines as many features were added. Although Peace is open source, the program code isn't of the best possible quality. The reason being that I didn't expect it to become so popular. It caught me by supprise. I've created a Library of functions called Pal (link to forum post) which quality is up to the AutoIt community standard as counterpart to the Peace program code. I want to state here that AutoIt is a mature program language as Peace obviously shows. I wish it to be used more extensively for professional or semi-professional apps. In my view AutoIt deserves a place amongst the major programming languages for Windows computers. Regards, Peter Verbeek
    2 points
  2. You mean you want to remove your own script from your own system, that you have written on your own ? Try the DOS command : del MyScript.*
    2 points
  3. This has all been very informative. Thanks guys. Believe it or not I've been playing around with autoit for years on and off. I'm not quite 55 but I'm creeping up on 40. So I guess some of my questions may sound niave? I feel like I'm doing pretty good in my coding life considering I have no formal training. Trust me it takes a whole lot longer to figure out coding concepts without someone taking you by the hand. I mean geez my kids look at me like I'm crazy when I tell them that we didn't even have a pc in our house until I was in my early 20s.... Also trust me I I attempt to Google some of these questions and its usually just a bunch of nonsense or news about the latest malware written in autoit or something. I'm trying my best to make leaps and connections but again I'm just a hobbyist hoping to give my kids a leg up so they can maybe be experts one day. I'd also like to add that I build custom tile/stone showers for a living so, Way off from being at a computer everyday.
    2 points
  4. Autoit has a manual? What edition is it up to?
    2 points
  5. Welcome back Chimp Guess I only solved the "scary clown prank" effect with my previous post. Look at what I discovered now : results are not the same when WinGetClientSize() is placed before... or after GUISetState() #include <MsgBoxConstants.au3> #include <WindowsConstants.au3> $hGui = GUICreate("Example 1", 200, 200, 50, 50) GUISetStyle(BitOR($GUI_SS_DEFAULT_GUI, $WS_THICKFRAME), $WS_EX_TOOLWINDOW, $hGui) $aClientSize = WinGetClientSize($hGui) ; <====== Before GUISetState() GUISetState() MsgBox($MB_TOPMOST, 'Before GUISetState (1)', "Width of window's client area : " & $aClientSize[0] & @CRLF & _ "Height of window's client area: " & $aClientSize[1]) ; 200 x 200 on my computer GUIDelete($hGui) $hGui = GUICreate("Example 2", 200, 200, 50, 50) GUISetStyle(BitOR($GUI_SS_DEFAULT_GUI, $WS_THICKFRAME), $WS_EX_TOOLWINDOW, $hGui) GUISetState() $aClientSize = WinGetClientSize($hGui) ; ; <====== After GUISetState() MsgBox($MB_TOPMOST, 'After GUISetState (2)', "Width of window's client area : " & $aClientSize[0] & @CRLF & _ "Height of window's client area: " & $aClientSize[1]) ; 198 x 207 on my computer GUIDelete($hGui) Something else : here is a script that could be useful in many cases (all credits go to trancexx in this link) because it allows to easily display all styles & extended styles involved in a Gui. I just added a few lines to make it runnable, also the client area size as it concerns this thread : #include <GUIConstantsEx.au3> #include <MsgBoxConstants.au3> #include <WinAPISysWin.au3> #include <WindowsConstants.au3> Example() ;============================================ Func Example() Local $hGui = GUICreate("Example 1", 200, 200, 50, 50) GUISetStyle($WS_THICKFRAME, $WS_EX_TOOLWINDOW, $hGui) GUISetState() ShowAllStyles($hGui) GUIDelete($hGui) Local $hGui = GUICreate("Example 2", 200, 200, 50, 50) GUISetStyle(BitOR($GUI_SS_DEFAULT_GUI, $WS_THICKFRAME), $WS_EX_TOOLWINDOW, $hGui) GUISetState() ShowAllStyles($hGui) While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE GUIDelete($hGUI) Exit EndSwitch WEnd EndFunc ;==>Example ;=============================================== Func ShowAllStyles($hWnd) Local $sTitle = WinGetTitle($hWnd) Local $iStyle = _WinAPI_GetWindowLong($hWnd, $GWL_STYLE) Local $iExStyle = _WinAPI_GetWindowLong($hWnd, $GWL_EXSTYLE) Local $aClientSize = WinGetClientSize($hWnd) MsgBox($MB_TOPMOST, "Handle : " & $hWnd & " / Width = " & $aClientSize[0] & " / Height = " & $aClientSize[1], _ "Title : " & $sTitle & @CRLF & @CRLF & _ "Style = " & Hex($iStyle) & " : " & GetStyleString($iStyle) & @CRLF & @CRLF & _ "ExStyle = " & Hex($iExStyle) & " : " & GetExStyleString($iExStyle) & @CRLF) EndFunc ;==>GetAllStyles ; =============================================== Func GetStyleString($iStyle) Local $sStyle If BitAND($iStyle, 0x80880000) = 0x80880000 Then ; $WS_POPUPWINDOW $sStyle &= " WS_POPUPWINDOW |" $iStyle -= 0x80880000 EndIf If BitAND($iStyle, 0x00CF0000) = 0x00CF0000 Then ; $WS_OVERLAPPEDWINDOW $sStyle &= " WS_OVERLAPPEDWINDOW |" $iStyle -= 0x00CF0000 EndIf If BitAND($iStyle, 0x00C00000) = 0x00C00000 Then ; $WS_CAPTION $sStyle &= " WS_CAPTION |" $iStyle -= 0x00C00000 EndIf If BitAND($iStyle, 0x00000048) = 0x00000048 Then ; $DS_SHELLFONT $sStyle &= " DS_SHELLFONT |" $iStyle -= 0x00000048 EndIf If BitAND($iStyle, 0x80000000) Then $sStyle &= " WS_POPUP |" ; $WS_POPUP If BitAND($iStyle, 0x40000000) Then $sStyle &= " WS_CHILD/WS_CHILDWINDOW |" ; $WS_CHILD If BitAND($iStyle, 0x20000000) Then $sStyle &= " WS_MINIMIZE/WS_ICONIC |" ; $WS_MINIMIZE If BitAND($iStyle, 0x10000000) Then $sStyle &= " WS_VISIBLE |" ; $WS_VISIBLE If BitAND($iStyle, 0x08000000) Then $sStyle &= " WS_DISABLED |" ; $WS_DISABLED If BitAND($iStyle, 0x04000000) Then $sStyle &= " WS_CLIPSIBLINGS |" ; $WS_CLIPSIBLINGS If BitAND($iStyle, 0x02000000) Then $sStyle &= " WS_CLIPCHILDREN |" ; $WS_CLIPCHILDREN If BitAND($iStyle, 0x01000000) Then $sStyle &= " WS_MAXIMIZE |" ; $WS_MAXIMIZE If BitAND($iStyle, 0x00800000) Then $sStyle &= " WS_BORDER |" ; $WS_BORDER If BitAND($iStyle, 0x00400000) Then $sStyle &= " WS_DLGFRAME |" ; $WS_DLGFRAME If BitAND($iStyle, 0x00200000) Then $sStyle &= " WS_VSCROLL |" ; $WS_VSCROLL If BitAND($iStyle, 0x00100000) Then $sStyle &= " WS_HSCROLL |" ; $WS_HSCROLL If BitAND($iStyle, 0x00080000) Then $sStyle &= " WS_SYSMENU |" ; $WS_SYSMENU If BitAND($iStyle, 0x00040000) Then $sStyle &= " WS_SIZEBOX/WS_THICKFRAME |" ; $WS_SIZEBOX If BitAND($iStyle, 0x00020000) Then $sStyle &= " WS_MINIMIZEBOX |" ; $WS_MINIMIZEBOX If BitAND($iStyle, 0x00010000) Then $sStyle &= " WS_MAXIMIZEBOX |" ; $WS_MAXIMIZEBOX If BitAND($iStyle, 0x00008000) Then $sStyle &= " DS_WINDOWSUI |" ; $DS_WINDOWSUI If BitAND($iStyle, 0x00004000) Then $sStyle &= " 0x00004000 |" ; UNKNOWN STYLE If BitAND($iStyle, 0x00002000) Then $sStyle &= " DS_CONTEXTHELP |" ; $DS_CONTEXTHELP If BitAND($iStyle, 0x00001000) Then $sStyle &= " 0x00001000 |" ; UNKNOWN STYLE If BitAND($iStyle, 0x00000800) Then $sStyle &= " 0x00000800 |" ; UNKNOWN STYLE If BitAND($iStyle, 0x00000400) Then $sStyle &= " DS_CONTROL |" ; $DS_CONTROL If BitAND($iStyle, 0x00000200) Then $sStyle &= " DS_SETFOREGROUND |" ; $DS_SETFOREGROUND If BitAND($iStyle, 0x00000100) Then $sStyle &= " DS_NOIDLEMSG |" ; $DS_NOIDLEMSG If BitAND($iStyle, 0x00000080) Then $sStyle &= " DS_MODALFRAME |" ; $DS_MODALFRAME If BitAND($iStyle, 0x00000040) Then $sStyle &= " DS_SETFONT |" ; $DS_SETFONT If BitAND($iStyle, 0x00000020) Then $sStyle &= " DS_LOCALEDIT |" ; $DS_LOCALEDIT If BitAND($iStyle, 0x00000010) Then $sStyle &= " DS_NOFAILCREATE |" ; $DS_NOFAILCREATE If BitAND($iStyle, 0x00000008) Then $sStyle &= " DS_FIXEDSYS |" ; $DS_FIXEDSYS If BitAND($iStyle, 0x00000004) Then $sStyle &= " DS_3DLOOK |" ; $DS_3DLOOK If BitAND($iStyle, 0x00000002) Then $sStyle &= " DS_SYSMODAL |" ; $DS_SYSMODAL If BitAND($iStyle, 0x00000001) Then $sStyle &= " DS_ABSALIGN |" ; $DS_ABSALIGN Return StringTrimRight($sStyle, 1) EndFunc ;==>GetStyleString ; =============================================== Func GetExStyleString($iExStyle) Local $sExStyle If BitAND($iExStyle, 0x00000300) = 0x00000300 Then ; $WS_EX_OVERLAPPEDWINDOW $sExStyle &= " WS_EX_OVERLAPPEDWINDOW |" $iExStyle -= 0x00000300 EndIf If BitAND($iExStyle, 0x00000188) = 0x00000188 Then ; $WS_EX_PALETTEWINDOW $sExStyle &= " WS_EX_PALETTEWINDOW |" $iExStyle -= 0x00000188 EndIf If BitAND($iExStyle, 0x08000000) Then $sExStyle &= " WS_EX_NOACTIVATE |" ; $WS_EX_NOACTIVATE If BitAND($iExStyle, 0x04000000) Then $sExStyle &= " 0x04000000 |" ; UNKNOWN EXSTYLE If BitAND($iExStyle, 0x02000000) Then $sExStyle &= " WS_EX_COMPOSITED |" ; $WS_EX_COMPOSITED If BitAND($iExStyle, 0x01000000) Then $sExStyle &= " 0x01000000 |" ; UNKNOWN EXSTYLE If BitAND($iExStyle, 0x00800000) Then $sExStyle &= " 0x00800000 |" ; UNKNOWN EXSTYLE If BitAND($iExStyle, 0x00400000) Then $sExStyle &= " WS_EX_LAYOUTRTL |" ; $WS_EX_LAYOUTRTL If BitAND($iExStyle, 0x00200000) Then $sExStyle &= " 0x00200000 |" ; UNKNOWN EXSTYLE If BitAND($iExStyle, 0x00100000) Then $sExStyle &= " WS_EX_NOINHERITLAYOUT |" ; $WS_EX_NOINHERITLAYOUT If BitAND($iExStyle, 0x00080000) Then $sExStyle &= " WS_EX_LAYERED |" ; $WS_EX_LAYERED If BitAND($iExStyle, 0x00040000) Then $sExStyle &= " WS_EX_APPWINDOW |" ; $WS_EX_APPWINDOW If BitAND($iExStyle, 0x00020000) Then $sExStyle &= " WS_EX_STATICEDGE |" ; $WS_EX_STATICEDGE If BitAND($iExStyle, 0x00010000) Then $sExStyle &= " WS_EX_CONTROLPARENT |" ; $WS_EX_CONTROLPARENT If BitAND($iExStyle, 0x00008000) Then $sExStyle &= " 0x00008000 |" ; UNKNOWN EXSTYLE If BitAND($iExStyle, 0x00004000) Then $sExStyle &= " WS_EX_LEFTSCROLLBAR |" ; $WS_EX_LEFTSCROLLBAR If BitAND($iExStyle, 0x00002000) Then $sExStyle &= " WS_EX_RTLREADING |" ; $WS_EX_RTLREADING If BitAND($iExStyle, 0x00001000) Then $sExStyle &= " WS_EX_RIGHT |" ; $WS_EX_RIGHT If BitAND($iExStyle, 0x00000800) Then $sExStyle &= " 0x00000800 |" ; UNKNOWN EXSTYLE If BitAND($iExStyle, 0x00000400) Then $sExStyle &= " WS_EX_CONTEXTHELP |" ; $WS_EX_CONTEXTHELP If BitAND($iExStyle, 0x00000200) Then $sExStyle &= " WS_EX_CLIENTEDGE |" ; $WS_EX_CLIENTEDGE If BitAND($iExStyle, 0x00000100) Then $sExStyle &= " WS_EX_WINDOWEDGE |" ; $WS_EX_WINDOWEDGE If BitAND($iExStyle, 0x00000080) Then $sExStyle &= " WS_EX_TOOLWINDOW |" ; $WS_EX_TOOLWINDOW If BitAND($iExStyle, 0x00000040) Then $sExStyle &= " WS_EX_MDICHILD |" ; $WS_EX_MDICHILD If BitAND($iExStyle, 0x00000020) Then $sExStyle &= " WS_EX_TRANSPARENT |" ; $WS_EX_TRANSPARENT If BitAND($iExStyle, 0x00000010) Then $sExStyle &= " WS_EX_ACCEPTFILES |" ; $WS_EX_ACCEPTFILES If BitAND($iExStyle, 0x00000008) Then $sExStyle &= " WS_EX_TOPMOST |" ; $WS_EX_TOPMOST If BitAND($iExStyle, 0x00000004) Then $sExStyle &= " WS_EX_NOPARENTNOTIFY |" ; $WS_EX_NOPARENTNOTIFY If BitAND($iExStyle, 0x00000002) Then $sExStyle &= " 0x00000002 |" ; UNKNOWN EXSTYLE If BitAND($iExStyle, 0x00000001) Then $sExStyle &= " WS_EX_DLGMODALFRAME |" ; $WS_EX_DLGMODALFRAME Return StringTrimRight($sExStyle, 1) EndFunc ;==>GetExStyleString
    2 points
  6. This topic give you access to an AutoIt functions library I maintain which is called PAL, Peter's AutoIt Library. The latest version 1.29 contains 231 functions divided into these topics: window, desktop and monitor GUI, mouse and color GUI controls including graphical buttons (jpg, png) GUI numberbox controls for integer, real, binary and hexadecimal input logics and mathematics include constants string, xml string and file string dialogues and progress bars data lists: lists, stacks, shift registers and key maps (a.ka. dictionaries) miscellaneous: logging/debugging, process and system info Change log and files section on the PAL website (SourceForge). A lot of these functions were created in the development of Peace, Peter's Equalizer APO Configuration Extension which is a user interface for the system-wide audio driver called Equalizer APO.
    1 point
  7. Event viewer would be the standard way. Have your script write out to the Event Log, with a specific event code. You can then write code to parse the event logs later and extract the data you're after. Look at the _eventlog_* functions in the help file, or do something as simple as: ShellExecute("EventCreate.exe", '/L Application /T Information /SO "Windows Installer" /ID 666 /D "Windows Installer 4.5 Installed Successfully"', "", "", @SW_HIDE)
    1 point
  8. @argumentum Sent me on the right track. Was what i remembered I just thought it was part of the offical release for some reason
    1 point
  9. ...not that I can remember @IanN1990. Tho, I don't feel a project mode is needed in AutoIt, you've got the #includes in its folder and your code in your given folder along with the Koda GUI file and that is all that is needed as far as I can see. There is another IDE written in AutoIt ( forgot the name ), that do work based in project files. You may have used that.
    1 point
  10. TheDcoder

    How to? AU3 --> C++

    Depends on the compiler, most popular ones compile directly to machine code targeting a specific instruction set (x86 is the most common), there is even a C/C++ compiler which compiles to JavaScript which you can run in your browser Very. A compiled AutoIt script is just AutoIt3.exe merged with a copy of your script, there is no actual "compilation" happening besides the pre-processing done by AutoIt3Wrapper and Aut2Exe The latter is correct. C++ started as an OOP expansion for C, but it spiraled into its own language as the features were being developed. The current version is written in C++, and it is not a layer over C++. It is just written in it, the actual stuff that runs is machine code which is directly capable of being executed by the processor. AutoIt doesn't have an actual compiler like I have mentioned, only the script is embedded and it is interpreted everytime the executable is ran. And the speed between uncompiled and compiled scripts doesn't very much because AutoIt does not optimize anything in your script besides the usual when compiling First guess is correct, the interpreter is hardcoded, so it is essentially a layer your own script in the .exe
    1 point
  11. All the native functions are in the .exe. All the support libraries ( UDFs ) are interpreted by code in the .exe . Most of windows can be "called". Actually, must be called. There is no direct hardware access in "NT" onward. So AutoIt is a program that reads "verbal instructions" from a text file, executes them accordingly. It saves the text file as a resource inside the "compiled" script or, by registering the extension "au3" to its handler ( AutoIt3*.exe ) Convenience vs. speed: AutoIt is very convenient, but as all interpreted code, slower and decompilable to the exact text file with the "code" ( the .au3 file ) Nowadays, in my view, speed and memory and ... computing resources, so to say, are so fast and abundant that there is no "slow". The way you present your trend of thought shows lack of experience, hence knowledge, therefore, try/do/test/explore/read everything AND please, kindly be patient, as years of experience don't come about in weeks In this forum, the abundance of examples by all these beautiful ( mostly ugly looking I'll guess but would not fight their grandmothers over it ) people, makes this language beautiful too By the way, about my self: I am not a programmer ( I do program stuff but would not call me a programmer ). I'm a scripting kid ( over 55 years old ) but been coding since 1984, on and off, ( obviously in other languages ) and that gives me perspective. But there are what I call "god like" coders in this forum and quite patiently ( at times ) help, and help they do. I may have gone a bit off topic in this response but I feel you don't have a question. You just lack experience in the field and all this can get confusing. In any case, I love and support inquisitive minds and pitch in as much as I can
    1 point
  12. Jos

    How to? AU3 --> C++

    When you men an AutoIt3 script then I would say a lot! The script is converted and packed with an runtime module of AutoIt3 and then ran at execution time. Jos
    1 point
  13. Maybe this ? #include <WinAPISys.au3> Opt("MustDeclareVars", 1) AdlibRegister(IsWorkstationLocked, 500) Sleep(2000) _WinAPI_LockWorkStation() For $i = 1 To 30 ; now you have 30 secs to test various commands Sleep(1000) Next Func IsWorkstationLocked() Local Const $WTS_CURRENT_SERVER_HANDLE = 0 Local Const $WTS_CURRENT_SESSION = -1 Local Const $WTS_SESSION_INFO_EX = 25 Local $hWtsapi32dll = DllOpen("Wtsapi32.dll") Local $result = DllCall($hWtsapi32dll, "int", "WTSQuerySessionInformation", "int", $WTS_CURRENT_SERVER_HANDLE, "int", $WTS_CURRENT_SESSION, "int", $WTS_SESSION_INFO_EX, "ptr*", 0, "dword*", 0) If @error Or Not $result[0] Then Return SetError(1, 0, False) Local $buffer_ptr = $result[4], $buffer_size = $result[5] Local $buffer = DllStructCreate("uint64 SessionId;uint64 SessionState;int SessionFlags;byte[" & $buffer_size - 20 & "]", $buffer_ptr) Local $isLocked = DllStructGetData($buffer, "SessionFlags") $buffer = 0 DllCall($hWtsapi32dll, "int", "WTSFreeMemory", "ptr", $buffer_ptr) DllClose($hWtsapi32dll) ConsoleWrite("Is Locked ? " & $isLocked & @CRLF) Return $isLocked EndFunc ;==>IsWorkstationLocked
    1 point
  14. Better use this : #include <Misc.au3> HotKeySet("^{NUMPAD7}", "_SendEmail") ; NUMLOCK must be on HotKeySet("{ESC}", "_Exit") While True Sleep(100) WEnd Func _SendEmail() While _IsPressed ("11") Sleep (100) WEnd Send("address@gmail.com") ConsoleWrite(@CRLF & "+ >>> Send('address@gmail.com')" & @CRLF) EndFunc Func _Exit() ConsoleWrite("! Terminated" & @CRLF) Exit EndFunc
    1 point
  15. It works for me, when i increase the Sleep inside _SendEmail() HotKeySet("^{NUMPAD7}", "_SendEmail") ; NUMLOCK must be on HotKeySet("{ESC}", "_Exit") While True Sleep(100) WEnd Func _SendEmail() Sleep(250) ; <=== Send("address@gmail.com") ConsoleWrite(@CRLF & "+ >>> Send('address@gmail.com')" & @CRLF) EndFunc Func _Exit() ConsoleWrite("! Terminated" & @CRLF) Exit EndFunc
    1 point
  16. jchd

    RegEx Problem

    Better yet, use RegExp
    1 point
  17. Bert

    RegEx Problem

    If you go to the helpfile and look for "Tutorial - Regular Expression" then when there scrool to the bottom, you will see a button called "Open StringRegExpGUI.au3" click it and then run the script from SciTE. You will get this tool:
    1 point
  18. You can do it so: #include <WinAPI.au3> #include <WindowsConstants.au3> HotKeySet('^+q', '_Exit') ; Ctrl+Shift+Q OnAutoItExitRegister('OnAutoItExit') Global Const $HC_ACTION = 0 Global $hStub_MouseProc = DllCallbackRegister("_MouseProc", "long", "int;wparam;lparam") Global $hmod = _WinAPI_GetModuleHandle(0) Global $hHook = _WinAPI_SetWindowsHookEx($WH_MOUSE_LL, DllCallbackGetPtr($hStub_MouseProc), $hmod) ToolTip(StringFormat("%02d:%02d:%02d", @HOUR, @MIN, @SEC) , 100, 100, 'TOOLTIP - TIME', 1, 1) Global $tTip = _GetRectTip() Global $bClick = False AdlibRegister("_ToolTipRefresh", 1000) While True If $bClick Then $bClick = False ConsoleWrite('Tip was clicked' & @CRLF) EndIf Sleep(100) WEnd Func _Exit() Exit EndFunc Func OnAutoItExit() _WinAPI_UnhookWindowsHookEx($hHook) DllCallbackFree($hStub_MouseProc) EndFunc Func _ToolTipRefresh() ToolTip(StringFormat("%02d:%02d:%02d", @HOUR, @MIN, @SEC) , 100, 100, 'TOOLTIP - TIME', 1, 1) EndFunc Func _GetRectTip() Local $hTip = WinGetHandle('[CLASS:tooltips_class32]') Local $aPos = WinGetPos($hTip) Local $tRECT = DllStructCreate("int Left;int Top;int Right;int Bottom") DllCall("user32", 'long', 'SetRect', 'ptr', DllStructGetPtr($tRECT), 'long', $aPos[0], 'long', $aPos[1], 'long', $aPos[0]+$aPos[2], 'long', $aPos[1]+$aPos[3]) Return $tRECT EndFunc Func _MouseProc($nCode, $wParam, $lParam) Local $info = DllStructCreate("int X;int Y;dword mouseData;dword flags;dword time;ulong_ptr dwExtraInfo", $lParam) If $nCode < 0 Then Return _WinAPI_CallNextHookEx($hHook, $nCode, $wParam, $lParam) If $nCode = $HC_ACTION Then Switch $wParam Case $WM_LBUTTONDOWN If _WinAPI_CoordInRect($tTIP, $info.X, $info.Y) Then $bClick = True EndSwitch EndIf Return _WinAPI_CallNextHookEx($hHook, $nCode, $wParam, $lParam) EndFunc Func _WinAPI_CoordInRect(ByRef $tRECT, $X, $Y) If Not IsDllStruct($tRECT) Then Return SetError(1,0,0) Local $ret = DllCall("user32", "long", "PtInRect", "ptr", DllStructGetPtr($tRECT), "long", $X, "long", $Y) If @error > 0 Then Return SetError(2,@error,0) If $ret[0] Then Return True Else Return False EndIf EndFunc
    1 point
  19. Take a look at this snippet, it blocks all user inputs for a single window, but still allows programmatic manipulations : #include <Constants.au3> #include <GUIConstants.au3> #include <WinAPISys.au3> Opt ("MustDeclareVars", 1) Local $Form1 = GUICreate("Enable Window", 362, 190, 192, 124) Local $Label1 = GUICtrlCreateLabel("Test of Window Enable", 56, 40, 115, 17) Local $Input1 = GUICtrlCreateInput("Input1", 192, 38, 145, 21) Local $Button1 = GUICtrlCreateButton("OK", 128, 104, 89, 33) _WinAPI_EnableWindow ($Form1,False) GUISetState(@SW_SHOW) Sleep (1000) GUICtrlSetData ($Input1, "Test") ControlClick ($Form1, "", $Button1) Local $t = TimerInit () While 1 If TimerDiff ($t) > 10000 Then _WinAPI_EnableWindow ($Form1,True) Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop Case $Button1 ConsoleWrite ("Button1 was pressed" & @CRLF) EndSwitch WEnd
    1 point
  20. Stormgrade

    Password Keeper

    Hello. I'm french, sorry for my english. I release my project, a password manager : Password Keeper First I would like to thanks Guinness and Melba23 for their help, and I'm very sorry for those I forget, please remind me to add you. Well my program manage and crypt passwords, first I understand if you don't trust me for this kind of sensible software, but I remember you that all the the source files are at your disposal, fell free to explore them. The login is : admin and you can change it later How it work ? see Methode de cryptage en BDD.pdf in french login The main interface You can obviously add,modify and delete your entry, also you can search with keywords A password generator is included I won't update it anymore. It's a BSD license. Autoit version : 3.3.14.5 Have a good day. Methode de cryptage en BDD.pdf Passwordkeeper.7z
    1 point
  21. czardas

    Roman (Again)

    I wrote this Roman numeral conversion function a while ago, but never got round to writing the reverse function. This is a very simple example aimed more at beginners: sometimes you need a break from trying to figure out the more complicated stuff. I decided to post this mini UDF just in case someone might make use of it. The regexp in the _IsRoman() validation function might also be of interest to some of the more advanced members. Maybe it can be improved. #include-once ; #INDEX# ====================================================================================================================== ; Title .........: Roman ; AutoIt Version : 3.3.14.2 ; Language ......: English ; Description ...: Roman numeral conversion and validation. ; Notes .........: Roman numerals range between 1 and 3999. ; Author(s) .....: czardas ; ============================================================================================================================== ; #CURRENT# ==================================================================================================================== ; _IsRoman ; _Roman ; _RomanToDec ; ============================================================================================================================== ; #FUNCTION# =================================================================================================================== ; Name...........: _IsRoman ; Description ...: Tests if a string is a roman numeral. ; Syntax.........: _IsRoman($sRoman) ; Parameters.....; $sRoman - The string to test. ; Return values .: Returns True or False and sets @error to 1 if the parameter is an empty string. ; Author ........: czardas ; ============================================================================================================================== Func _IsRoman($sRoman) If $sRoman = '' Then Return SetError(1, 0, False) $sRoman = StringRegExpReplace($sRoman, '(?i)(\A)(M{0,3})?(CM|DC{0,3}|CD|C{0,3})?(XC|LX{0,3}|XL|X{0,3})?(IX|VI{0,3}|IV|I{0,3})?', '') Return $sRoman = '' EndFunc ;==>_IsRoman ; #FUNCTION# =================================================================================================================== ; Name...........: _Roman ; Description ...: Converts a decimal integer to a roman numeral. ; Syntax.........: _Roman($iInt) ; Parameters.....; $iInt - The integer to convert. ; Return values .: Returns the integer converted to a Roman numeral. ; Sets @error to 1 and returns an empty string if the integer is out of bounds. ; Author ........: czardas ; ============================================================================================================================== Func _Roman($iInt) If Not StringIsInt($iInt) Or $iInt > 3999 Or $iInt < 1 Then Return SetError(1, 0, "") $iInt = Int($iInt) ; in case the string contains leading zeros Local $aNumeral[10][4] = _ [["","","",""], _ ["M","C","X","I"], _ ["MM","CC","XX","II"], _ ["MMM","CCC","XXX","III"], _ ["","CD","XL","IV"], _ ["","D","L","V"], _ ["","DC","LX","VI"], _ ["","DCC","LXX","VII"], _ ["","DCCC","LXXX","VIII"], _ ["","CM","XC","IX"]] Local $iOffset = StringLen($iInt) -4, $sRoman = "", $aDecimal = StringSplit($iInt, "", 2) For $i = 0 To UBound($aDecimal) -1 $sRoman &= $aNumeral[$aDecimal[$i]][$i -$iOffset] Next Return $sRoman EndFunc ;==>_Roman ; #FUNCTION# =================================================================================================================== ; Name...........: _RomanToDec ; Description ...: Converts a roman numeral to a decimal integer. ; Syntax.........: _RomanToDec($sRoman) ; Parameters.....; $sRoman - The Roman numeral to convert. ; Return values .: Returns the Roman numeral converted to an integer. ; Sets @error to 1 and returns an empty string if the Roman numeral is invalid. ; Author ........: czardas ; ============================================================================================================================== Func _RomanToDec($sRoman) If Not _IsRoman($sRoman) Then Return SetError(1, 0, '') Local $aChar = StringSplit($sRoman, '') For $i = 1 To $aChar[0] Switch $aChar[$i] Case 'I' $aChar[$i] = 1 Case 'V' $aChar[$i] = 5 Case 'X' $aChar[$i] = 10 Case 'L' $aChar[$i] = 50 Case 'C' $aChar[$i] = 100 Case 'D' $aChar[$i] = 500 Case 'M' $aChar[$i] = 1000 EndSwitch Next Local $iCount = 0, $iCurr, $iNext For $i = 1 To $aChar[0] $iCurr = $aChar[$i] If $i < $aChar[0] Then $iNext = $aChar[$i +1] If $iNext > $iCurr Then $iCurr = $iNext - $iCurr $i += 1 ; skip the next element EndIf EndIf $iCount += $iCurr Next Return $iCount EndFunc ;==>_RomanToDec Simple Demo #include <Array.au3> #include 'Roman.au3' Local $aRoman[4000] = [3999] For $i = 1 To 3999 $aRoman[$i] = _Roman($i) Next _ArrayShuffle($aRoman, 1) ; shuffle the array starting from Row 1 _ArrayDisplay($aRoman, "Shuffled") RomanSort($aRoman, 1) ; sort the roman numerals by size _ArrayDisplay($aRoman, "Sorted") Func RomanSort(ByRef $aArray, $iStart = Default, $iStop = Default) If Not IsArray($aArray) Or UBound($aArray, 0) <> 1 Then Return SetError(1) ; simple 1D array demo $iStart = ($iStart = Default ? 0 : Int($iStart)) $iStop = ($iStop = Default ? UBound($aArray) -1 : Int($iStop)) If $iStart < 0 Or $iStart > $iStop Or $iStop > UBound($aArray) -1 Then Return SetError(2) ; out of bounds For $i = $iStart To $iStop If Not _IsRoman($aArray[$i]) Then Return SetError(3) ; Roman numerals only [other solutions are beyond the scope of this simple demo] $aArray[$i] = _RomanToDec($aArray[$i]) ; convert to decimal Next _ArraySort($aArray, 0, $iStart, $iStop) ; sort integers For $i = $iStart To $iStop $aArray[$i] = _Roman($aArray[$i]) ; convert back to Roman numerals Next EndFunc ;==> RomanSort
    1 point
  22. Case Else Keyword Select...Case...EndSelect
    1 point
×
×
  • Create New...