Leaderboard
Popular Content
Showing content with the highest reputation on 12/10/2020 in all areas
-
Version 6.1.3.1
3,488 downloads
This file is the source code for zPlayer, which is a stand-alone, simple, intuitive and easy-to-use, yet fully functional media player. I made this to suit my purpose and you can tweak it to your taste. zPlayer is powered by winmm.dll which is an integral part of Windows. This player has the following features: - No 3rd party dependencies. This player is made with Windows components and standard AutoIt UDFs only - Play back all formats of digital media files as far as proper codecs are installed in the computer - Video window is independent of other windows. Minimal GUI for music - Can load files, folders or an audio CD for playback - Playlists are automatically generated in sorted and shuffled orders and saved in the folder - Playlist is hidden by default, availbable when desired - Context menus available: Play this file, File properties, Search internet, Go to this folder, Remove from playlist - A double-click on any item plays that item - Search strings in the playlist - Forward, backward, pause, change folder - A-B repeat, current file repeat and multiple-file repeat functions - Increase/decrease/mute program sound volume. Synchronized with Windows Volume Mixer - Save play-back environment when terminating a session and resume that environment in the next session - 'Resume playback' option for a file left off in the middle of playback. Audio fade-in when playback is resumed - Hotkeys available for most of the functions - Very small footprint: very low CPU and memory usage The script is set to run or compile in x64 mode. You can change this setting by commenting out #AutoIt3Wrapper_UseX64=Y. zPlayer.exe, attached hereto, was compiled in x64 mode and is not flagged by Windows Defender as malicious. If you compile the script to an x86 file, the resulting zPlayer.exe will most probably be falsely flagged by Windows Defender as malicious. If you find an error, please download the latest version as most probably the error may have been corrected already. Otherwise I would appreciate it very much if you could kindly let me know. The download section includes zPlayer-NoUI.au3. This is an abbreviated version of zPlayer, which is a music player controlled by hotkeys only, without a GUI. Note: zPlayer is the name I used when I introduced the early version of this player in my blog in 2009 and has nothing to do with the mobile media player of the same name which started marketing in 2015.1 point -
I needed a function to automate programs at work that can't be fully automated via Autoits built in functions. For example a virtual machine running on your physical machine, meaning you would need to run an extra script within the virtual machine (if it is even running Windows) in order to automate everything. I came across OpenCV which allows matching/finding a picture in another picture. This would also allow searching for a button/text on the screen in order to press the exact position. Fortunately @mylise already translated all the required OpenCV functions to Autoit, I just had to remove all unnecessary functions to make the script as small as possible. The problem: Using this method, you will never be able to fully automate everything dynamically, as it will only work on the machine with same resolution/dpi settings, same theme etc.. This is only a last resort for programs that can't be automated using the built in Autoit functions. Features: Find a given picture on the entire screen (all monitors) or a certain area on the screen and execute mouse clicks on this position. Adjust the threshold so that the picture doesn't have to match 100%. Debugging options like logging and marking the screen where the picture was found etc. Includes a Snapshot-Tool that creates snapshots of a certain area(buttons, text etc.) on the screen and generates the code that is required for the matching. It can also be used to get the coordinates to a marked area on the screen in order to check only on a certain area for the match picture. Example: Note: The example will probably not work on your computer, depending on the display resolution and dpi settings, as the picture has to match the exact same size on the screen. Please use the included Snapshot-Tool to generate new match pictures and code very easily. #AutoIt3Wrapper_UseX64=n ; In order for the x86 DLLs to work #include "OpenCV-Match_UDF.au3" _OpenCV_Startup();loads opencv DLLs _OpenCV_EnableLogging(True,True,True) ;Logs matches, errors in a log file and autoit console output. ;Please note that these examples might not work as the match pictures have to be found with the exact same size on your screen. ;Example 1 ShellExecute("http://www.tv.com/");Open Website tv.com $Match1 = _MatchPicture(@ScriptDir&"\Match\1.png", 0.70,False,10,500);Try to find the match picture on the screen. Number of tries: 10, Sleep between each try: 500ms. If Not @error Then _MarkMatch($Match1) ;Debugging: Draws a rect on the screen/coordinates of the match to show the user where the match was found Sleep(100) _ClickMouse($Match1, "left",1) ;Calculates the center of the match and clicks the left mouse once on click position EndIf Sleep(1000) ;Example 2, matching on a specific area of the screen ShellExecute("notepad.exe");open nodepad WinWait("[CLASS:Notepad]","",5) WinMove("[CLASS:Notepad]","",0,0,500,500) Local $sCoords[4] = [0, 0, 500,500] $Match2 = _MatchPicture(@ScriptDir&"\Match\2.png", 0.80,$sCoords,3,500) If Not @error Then _MarkMatch($Match2) Sleep(100) _ClickMouse($Match2, "left", 1) EndIf _OpenCV_Shutdown();Closes DLLs So basically, all you need to do is provide a path to the match picture and the function will return you the coordinates (x1,y1,x2,y2) of where the picture has been found on the screen. With these, you can either calculate an exact position for the mouse click or use the "_ClickMouse" function which will execute a mouse click on the center of the coordinates where the picture was found. Credits: @mylise for the OpenCV UDF Download: Includes the required .DLL files of OpenCV. You can also manually download them on the website of OpenCV (Version 3.x doesn't include these anymore, you need to download 2.x). OpenCV_Match.zip1 point
-
[Solved] WM_CONTEXTMENU
Nine reacted to pixelsearch for a topic
My mind was so filled with the script that I forgot the 'like' button So, negating $bContextDisplay in WM_CONTEXTMENU was a good thing. I wonder why I modified the other line you mentioned. I'll let you know... in case I ever remember the reason !1 point -
[Solved] WM_CONTEXTMENU
pixelsearch reacted to Nine for a topic
That seems to be working fine. As I said there shouldn't be any form of Sleep (even a small loop within the GUI loop can be calculated as a sleep). So by removing the sleep and creating a pseudo-loop outside the Switch, I think I got the result you were looking for : #include <GUIConstantsEx.au3> #include <MsgBoxConstants.au3> #include <WindowsConstants.au3> Global $bContextDisplay = False $hGUI = GUICreate("Test #3 - Right-click (short then long) inside GUI", 500, 200, _ -1, -1, -1, $WS_EX_TOPMOST) Local $idContext_Menu = GUICtrlCreateContextMenu() Local $idContext_Save = GUICtrlCreateMenuItem("Save", $idContext_Menu) GUISetState(@SW_SHOW, $hGUI) GUIRegisterMsg($WM_CONTEXTMENU, "WM_CONTEXTMENU") Local $hTimer, $aPos, $fDiff While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop Case $GUI_EVENT_SECONDARYDOWN ConsoleWrite("secondary" & @CRLF) $bContextDisplay = True $hTimer = TimerInit() Case $GUI_EVENT_SECONDARYUP $bContextDisplay = False Case $idContext_Save ConsoleWrite("Code for Save Image" & @CRLF) EndSwitch If $bContextDisplay Then $aPos = GUIGetCursorInfo($hGUI) If Not IsArray($aPos) Then $bContextDisplay = False ContinueLoop EndIf If $aPos[3] = 1 Then $fDiff = TimerDiff($hTimer) ConsoleWrite("timer diff " & $fDiff & @CRLF) If $fDiff > 250 Then ; Cancel crop $bContextDisplay = False ConsoleWrite("Code for Cancel Crop" & @CRLF) EndIf EndIf EndIf WEnd GUIDelete($hGUI) ;================================================= Func WM_CONTEXTMENU($hwnd, $iMsg, $wParam, $lParam) #forceref $hwnd, $iMsg, $wParam, $lParam Local Static $iCounter = 0 $iCounter += 1 ConsoleWrite("WM_CONTEXTMENU #" & $iCounter & @CRLF) If Not $bContextDisplay Then Return 0 ; prevents the Context menu to appear Return $GUI_RUNDEFMSG EndFunc ;==>WM_CONTEXTMENU1 point -
@MRAJ You continue to provide only minimal details in your responses. You can't expect us to work harder than you to try to solve your problem. Therefore, I am unwilling to help you further until you can show that you've researched the issue and tried some of the recommended solutions.1 point
-
A little clarification. When the flag $iForward is true (1), which is the default value, it searches forward. To make it search backward the flag should be set to false (0).1 point
-
How to delete empty key in the file?
ahmetpi reacted to JockoDundee for a topic
I stand corrected, its absolutely possible. Thanks.1 point -
To answer the OP's question, this could work $txt = StringRegExpReplace(FileRead("example.ini"), '(?m)^[^=]+=\h*$\R?', "") Msgbox(0,"", $txt)1 point
-
Example() Func Example() ; Create a constant variable in Local scope of the filepath that will be read/written to. Local Const $sFilePath = "Test.ini" ; Create an INI section structure as an array. The zeroth element is how many items are in the array, in this case 3. Local $aSection[4][2] = [[3, ""], ["Test", "AutoIt"], ["Test", @AutoItVersion], ["Test", @OSVersion]] ; Write the array to the section labelled 'General'. IniWriteSection($sFilePath, "General", $aSection) EndFunc ;==>Example1 point
-
Read in the section with IniReadSection. Modify the resulting array to remove the desired entries. Use IniWriteSection to output the modified array, thus overwriting the prior section1 point
-
#include <GUIConstantsEx.au3> #include <EditConstants.au3> Local $hGUI = GUICreate("No Button GUI", 600, 400) Local $input1 = GUICtrlCreateInput("1", 8, 8, -1, -1, BitOR($ES_RIGHT, $ES_NUMBER)) Local $input2 = GUICtrlCreateInput("1", 8, 32, -1, -1, BitOR($ES_RIGHT, $ES_NUMBER)) Local $input3 = GUICtrlCreateInput("0", 8, 56, -1, -1, BitOR($ES_RIGHT, $ES_NUMBER)) ; Display the GUI. GUISetState(@SW_SHOW, $hGUI) ; Loop until the user exits. While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE GUIDelete($hGUI) ExitLoop Case ($input2 Or $input1) GUICtrlSetData($input3, GUICtrlRead($input1) + GUICtrlRead($input2)) EndSwitch WEnd1 point
-
Opening a web page using default browser
krasnoshtan reacted to w0uter for a topic
$o_URL = ObjCreate("Shell.Application") $o_URL.Open($s_URL) http://www.autoitscript.com/fileman/users/jpm/AutoIt3-gui/1 point