Jump to content

Leaderboard

Popular Content

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

  1. I can TCP/IP in AutoIt, hence, make a HTTP deamon. Now, how can I HTTPS to use SSL !?? Well, Apache has this "mod_proxy.so" module that can let me have SSL and what not is in Apache. All that is needed is to tell Apache what I wanna do by editing httpd.conf . # Implements a proxy/gateway for Apache. # 1. Open /Applications/XAMPP/etc/httpd.conf # 2. Enable the following Modules by removing the # at the front of the line. # - LoadModule rewrite_module modules/mod_rewrite.so # - LoadModule proxy_module modules/mod_proxy.so # - LoadModule proxy_http_module modules/mod_proxy_http.so # # 3. Copy and Paste below to the bottom of httpd.conf # <IfModule mod_proxy.c> ProxyRequests On <Proxy *> Order deny,allow Allow from all </Proxy> ProxyVia Off ProxyPreserveHost Off ProxyPass /home/ http://127.0.0.1:84/home/ ProxyPassReverse /home/ http://127.0.0.1:84/home/ SetEnv proxy-nokeepalive 1 # ..since we are not using "keep-alive", we are using "close" </IfModule> ...et voila I'm using XAMPP ( https://www.apachefriends.org/download.html ) and this is my solution to avoid coding in PHP, as I feel more comfortable coding in AutoIt. A "muli-thread or concurrency" can be done by forking the socket ( https://www.autoitscript.com/forum/topic/199177-fork-udf-ish/ ) but responses are under 20 ms., so I feel fine with a single thread. I modified an example ( attached below ), so can try out the concept. PS: I am not an Apache guru. I just discovered this and it opens a world of possibilities. In my case, I'm thinking of an API to query SQLite PS2: I'm not gonna make Poll but do click like if you do 201673-json-http-post-serverlistener.au3
    3 points
  2. Version 6.1.3.1

    3,493 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
  3. The GUI looks like shown in the picture: It contains a main menu, a treeview in left pane that lists UI Automation elements, a listview in right pane that displays detail information for the selected element, and a splitterbar to adjust the width of the two panes. Detect element The "Detect element" main menu is used to detect elements under the mouse with function keys F1 - F4. See How to topics number 2. Left pane The left pane is a treeview that initially lists open programs and windows. Generally, the left pane shows UI Automation elements represented as treeview items. Right pane The right pane is a listview that displays detail information for the selected treeview element. The information is grouped into different types of information. Only the relevant information for each type is displayed. Invalid elements When a window is closed the elements in UIASpy becomes invalid. But the elements are not deleted in UIASpy and can still be handled and selected in the treeview. Detail information for an element that was calculated before the window was closed can still be seen in the listview. In this way it's possible for UIASpy to show information for eg. a context menu that is closed as soon as it loses focus. Listview features Listview features Help system With completion of the Help system, a lot of information has been moved from this post and other posts into the Help system. Sample code creation Sample code creation is implemented through the UI element Detail info listview page and through the Sample code main menu. Sample code creates code snippets based on data in one or more selected rows in the Detail info listview page or based on the clicked Sample code menu item. UI Automation code is largely based on COM interface objects and thus on the function ObjCreateInterface(), which is one of the advanced functions in AutoIt. The main purpose of Sample code functionality is to eliminate the complexity of ObjCreateInterface(). Sample code creation either through the Detail info listview page or through the Sample code main menu can create all the interface objects required in UI Automation code. Another purpose is of course to make it easier and faster to implement code for simple automation tasks. Through Sample code creation, you can more or less create all code in a simple automation task: Create UI Automation initial code Create condition and find application window Create condition and find control in window Get information about windows and controls Create pattern objects to perform actions Get information related to pattern objects Perform actions with pattern object methods Add a Sleep() statement if necessary Note that the UI element used in sample code is named after the selected element in the treeview. Also note that both the Sample code menu items and the sections in the Detail info listview page are placed in approximately the order they are used in a simple automation task. Sample code creation through Detail info listview page Sample code creation through Sample code main menu Supported applications Most browsers including Google Chrome To be able to spy on web content in Google Chrome it's necessary to enable accessibility by entering chrome://accessibility/ in the address bar of a new tab item, and then check the five check boxes that are located in a column in upper left corner down along the left edge. Then the accessibility tab can be closed again. It's a global setting that applies to all open and new tabs until Chrome is closed. Without accessibility enabled you are only able to investigate the outer elements of Chrome but not web content. Internet Explorer Microsoft Edge Mozilla Firefox Most Microsoft applications and applications developed with Microsoft software including Classic Windows applications based on the standard control library Modern Universal Windows Platform apps like the Windows 10 Calculator Programs implemented through .NET Framework eg. Windows Forms applications Most applications provided by major development companies Automation issues Automation issues How to topics If UI Automation or the UIASpy tool is new to you, then you should read the How to topics. Examples Examples that demonstrates the features of UIASpy: Automating Notepad. Very detailed example. Automating Notepad - Windows XP Examples about Sample code creation: Automating Notepad with Sample code - step by step Automating Notepad with Sample code - all at once Chrome - Clicking an extension. Compact summary example. Click Save As... issue in Notepad examples: Using Expand() instead of Invoke() Updates Windows 8, Windows 8.1 and Windows 10 updates Threads UI Automation UDFs contains all include files. In Using UI Automation Code in AutoIt you can find and download examples and read information about using UIA code. UI Automation Events is about implementing event handlers and includes GUIs to detect events. IUIAutomation MS framework automate chrome, FF, IE, .... created by junkew August 2013 is the first AutoIt thread on UIA code. Zip-file The zip contains source files for UIASpy GUI. Note that UI Automation UDFs must be installed in the Includes folder. You need AutoIt 3.3.12 or later. Tested on Windows XP, Windows 7 and Windows 10. Comments are welcome. Let me know if there are any issues. UIASpy.7z
    1 point
  4. It appears that it's not listed on the default file types that are read from the config file. On line 39: Global $fileTypes = IniRead(@ScriptDir & "\zPlayer.ini", "Player", "File Types", "mp3 wma asf ogg flac ape")
    1 point
  5. You need to add your global variables to the top of your script, $cmt isn't created until after the GUI so is never set.
    1 point
  6. StringRegExpReplace(ClipGet(), '[\x{0000}\x{FEFF}\x{200B}-\x{200D}]', "") \x{0000} NULL \x{FEFF} ZERO WIDTH NO-BREAK SPACE \x{200B} ZERO WIDTH SPACE \x{200C} ZERO WIDTH NON-JOINER \x{200D} ZERO WIDTH JOINER
    1 point
  7. Do you expect anyone to answer your question ? What program are you talking about ? Looks very suspicious...
    1 point
  8. I have modified the example above accordingly.
    1 point
  9. I would go with something like this : #include <Constants.au3> #include <GDIPlus.au3> _GDIPlus_Startup () $hBitmap = _GDIPlus_BitmapCreateFromFile ("Image.jpg") $hBitMapResized = _GDIPlus_ImageResize ($hBitmap, 20, 20) $tBitmapData = _GDIPlus_BitmapLockBits ($hBitMapResized, 0, 0, 20, 20, $GDIP_ILMREAD, $GDIP_PXF32ARGB) $iScan0 = DllStructGetData($tBitmapData, "Scan0") $tPixel = DllStructCreate("int[400];", $iScan0) Local $iMean = 0, $iStdDev = 0, $r, $g, $b For $i = 1 to 400 Split (DllStructGetData ($tPixel, 1, $i), $r, $g, $b) $iMean += $r+$g+$b Next $iMean /= 1200 For $i = 1 to 400 Split (DllStructGetData ($tPixel, 1, $i), $r, $g, $b) $iStdDev += ($r-$iMean)^2 $iStdDev += ($g-$iMean)^2 $iStdDev += ($b-$iMean)^2 Next $iStdDev = Sqrt($iStdDev/1200) MsgBox ($MB_SYSTEMMODAL,"",$iMean & "/" & $iStdDev) _GDIPlus_BitmapUnlockBits($hBitMapResized, $tBitmapData) _GDIPlus_BitmapDispose($hBitmap) _GDIPlus_BitmapDispose($hBitMapResized) _GDIPlus_Shutdown () Func Split ($c, ByRef $r, ByRef $g, ByRef $b) $r = bitshift(bitand ($c,0xff0000),16) $g = bitshift(bitand ($c,0xff00),8) $b = bitand ($c,0xff) EndFunc Where the mean should be low for darker image and Standard Deviation also low for darker. I'm applying it for each component RGB, because global color doesn't say much. Also going with a single (or a few) value, you will loose the StdDev significance. I don't think anyone will argue that the lower is the mean (closer to 0), it implies that the image is quite dark. But even with a somewhat low mean, if you got a high StdDev, it implies that there is high contrast. I would assume there is some brightness although part of the image is black. So StdDev must be low as well. Of course this is untested, and you will have to adjust the threshold of those indicator to fit your requirements. Hope that make sense.
    1 point
  10. Try: _IECreate("file:///C:/autoit_teste.html")
    1 point
  11. First of all : "There is nothing wrong with the work-around suggested by @Chimp !" The question that pops into my mind (and Chimp's mind certainly as well) is : Which program or process generates this loginfo.ini ? Is it possible, that you (or someone in your environment) create this file and only use the ini-format because you know it best ? I find it hard to imagine, that a professional software would create such a malformed .ini. We may be able to offer a better solution, if we know the genesis of this file .
    1 point
  12. Just to clarify: What makes CodeCrypter different from other encryptors is not the algorithm (Ward's machine-coded AES at the moment, but watch the thread...), but that the decryption key is not stored anywhere, but instead extracted at runtime from the user environment, using a function, macro, UDF, dll call, or whatever else you can think of (password query, hardware ID, server response, @year&@mon (=automatic expiry), or a combination of several encryption keys). So the code will always be decrypted, but produces utter garbage unless whatever your function/macro/etc returns from its current environment exactly matches whatever was used at the time of encryption (you can specify this explicitly; it doesn't have to be the machine you happen to be encrypting on). The basic scenario is an office computer running a CodeCrypted script with admin privileges to receive system-info (for the decryption key) that an ordinary user cannot access on that machine. If an employee then copies that code and takes it home for personal use or for selling on to third parties, it won't work anywhere else (even with admin privileges elsewhere), because the retrieved environment specs will always be different. So the strength of the encryption algo is unimportant. The only weakness is physical access to the sanctioned machine/work environment; if a thief steals the workstation itself and takes it apart to retrieve the motherboard serial number (if that's what was used), or a hacker blackmails the sysadmin with what happened with the goat at the Xmas office party last year, all is lost. The point is (as @jchd pointed out) to raise the bar so the h/cracking effort is no longer worth the reward.
    1 point
  13. LarsJ

    Windows Message Monitor

    In a Windows GUI like an AutoIt GUI, functionality and user actions are largely controlled through Windows messages. Therefore, it's interesting to monitor Windows messages. That's the purpose of this example. How does it work? This is a simple example (Examples\1) Native controls\GUICtrlCreateButton.au3): #include <GUIConstantsEx.au3> #include "..\..\Includes\WinMsgMon_Button.au3" ; <<<<<<<<<<<<<<<<<<<< WinMsgMon_InitMsgs( "..\..\Includes" ) ; <<<<<<<<<<<<<<<<<<<< Example() Func Example() ; Create a GUI with various controls. Local $hGUI = GUICreate("Example", 300, 200) WinMsgMon_GetMsgs( $hGUI, "$hGUI" ) ; <<<<<<<<<<<<<<<<<<<< ; Create button controls. Local $idMsgBox = GUICtrlCreateButton("Open MsgBox", 120, 170, 85, 25) WinMsgMon_GetMsgs( $idMsgBox, "$idMsgBox" ) ; <<<<<<<<<<<<<<<<<<<< Local $idClose = GUICtrlCreateButton("Close", 210, 170, 85, 25) WinMsgMon_GetMsgs( $idClose, "$idClose" ) ; <<<<<<<<<<<<<<<<<<<< ; Display the GUI. GUISetState(@SW_SHOW, $hGUI) ; Loop until the user exits. While 1 Switch GUIGetMsg() Case $idMsgBox WinMsgMon_UserMsg( $idMsgBox, $WM_USER0, _ ; <<<<<<<<<<<<<<<<<<<< "Before MsgBox" ) MsgBox( 0, "Title", "One second timeout", 1 ) WinMsgMon_UserMsg( $idMsgBox, $WM_USER1, _ ; <<<<<<<<<<<<<<<<<<<< "After MsgBox" ) Case $GUI_EVENT_CLOSE, $idClose WinMsgMon_UserMsg( $idClose, $WM_USER0, _ ; <<<<<<<<<<<<<<<<<<<< "Before ExitLoop" ) ExitLoop EndSwitch WEnd ; Delete GUI and all controls. GUIDelete($hGUI) WinMsgMon_ViewMsgs( Example ) ; <<<<<<<<<<<<<<<<<<<< EndFunc ;==>Example Include UDF In this example WinMsgMon UDF is included as WinMsgMon_Button.au3 and not just WinMsgMon.au3. Because this is a button example, WinMsgMon_Button.au3 is included to be able to get detail information about button messages. WinMsgMon_InitMsgs() WinMsgMon_InitMsgs() is called immediately after inclusion of the UDF. The function sets up the path used to find text files with message information. In addition to the path, WinMsgMon_InitMsgs() can take an optional $iFlags parameter as input. See WinMsgMon.au3 and Rerun in Toolbar buttons section for more information. WinMsgMon_GetMsgs() WinMsgMon_GetMsgs() is the central function that collects messages. It takes two parameters: A window or control and optionally the name of the window or control. In the example above the function is called three times to be able to collect messages sent to the main GUI and two buttons. While messages are collected and stored, info is simultaneously written to SciTE console. The specified window or control names are used in console output and in WinMsgMon GUI. If no names are specified, the names Window1, Button1 and Button2 are used instead. WinMsgMon_UserMsg() WinMsgMon_UserMsg() sends user messages to the two buttons. 16 user messages are defined: $WM_USER0 - $WM_USERF. In the example $WM_USER0 and $WM_USER1 are send to $idMsgBox button before and after the MsgBox is opened and closed. And $WM_USER0 is send to $idClose button immediately before ExitLoop. This way it's easy to recognize the button clicks among the messages. WinMsgMon_ViewMsgs() WinMsgMon_ViewMsgs() is the central function that displays the messages in WinMsgMon GUI. In the example WinMsgMon_ViewMsgs() is called with Example function as parameter. The function parameter is optional and is used in relation to the Rerun button to be able to run Example once more. See Rerun in Toolbar buttons section. WinMsgMon_ViewMsgs() is called as the last line in Example() function. It does not necessarily have to be the last line. But it must definitely be after GUIDelete(). WinMsgMon_ViewMsgs() may well be called before a final long term calculation or file update. In simple situations you may have sufficient information in SciTE console output. In such cases you can omit the WinMsgMon_ViewMsgs() function. GUI window This is a small part of the messages generated by the example above as shown in WinMsgMon GUI: First column in main listview is message number. Note that the message number in first and second row is 220 and 225. This is because some messages eg. WM_MOUSEMOVE are unchecked in WM_MESSAGEs toolbar listview and therefore not displayed in main listview. Second column shows the window or control that receives the message. Name of idMsgBox button, of interest here, is written on a wheat colored background. Message column shows WM_MESSAGEs and control messages. Some messages are particularly interesting. They are written on a colored background. Notification column displays notifications contained in WM_NOTIFY and WM_COMMAND messages. The info columns shows information provided along with the messages. Console output The same messages as shown in SciTE console (long lines shortened): [ 220] idMsgBox WM_PAINT [ 221] idMsgBox WM_NCHITTEST [ 222] idMsgBox WM_SETCURSOR [ 223] hGUI WM_SETCURSOR [ 224] idMsgBox WM_MOUSEMOVE [ 225] hGUI WM_NOTIFY BCN_HOTITEMCHANGE From = idMsgBox HICF_ENTERING [ 226] idMsgBox WM_PAINT [ 227] idMsgBox WM_ERASEBKGND [ 228] hGUI WM_ERASEBKGND [ 229] hGUI WM_CTLCOLORDLG [ 230] hGUI WM_PRINTCLIENT [ 231] hGUI WM_CTLCOLORBTN [ 232] hGUI WM_NOTIFY NM_CUSTOMDRAW From = idMsgBox CDDS_PREERASE [ 233] hGUI WM_NOTIFY NM_CUSTOMDRAW From = idMsgBox CDDS_PREPAINT [ 234] idMsgBox WM_GETTEXTLENGTH [ 235] idMsgBox WM_GETTEXT [ 236] idMsgBox WM_USER1 [ 237] idMsgBox WM_PAINT Toolbar listviews The five toolbar buttons before the first separator opens five listviews. The buttons are hot-track enabled with the technique used in this example. Wins/Ctrls In Wins/Ctrls listview you check the window or control where from you want to see messages. Here messages from all windows and controls are shown: Because some messages eg. WM_MOUSEMOVE are unchecked only 742 of 1315 messages are shown. Click the checkmark or select the row and press Space key to show all messages. When a row is checked, main listview is updated instantly. Unchecked messages in other toolbar listviews are reset. See Set in Toolbar buttons section for an easy way to uncheck messages. Click the color cell or select the row and press Enter key to set background color. The combo control is implemented with the technique demonstrated in this example. The background color for all windows and controls (first row) cannot be set. Note that only single selection is enabled in this toolbar listview. In the other four listviews multiple selections are enabled. To close a toolbar listview click in main listview, click the toolbar button, move mouse pointer above titlebar or press Esc. WM_MESSAGEs In WM_MESSAGEs listview you uncheck messages that you don't want to see. WM_MOUSEMOVE and WM_NCHITTEST messages are already unchecked. WM_NOTIFY messages are written on an aquamarine background: To uncheck or set background color for all WM_NC-messages select the six rows and press Space or Enter key. When a message is un- or in-checked nothing happens until the listview is closed. Then the Refresh button is enabled. Before you click the Refresh button you can un- or in-check messages in other listviews. Click Refresh button to update main listview. When a color is set main listview is updated instantly. Control Msgs The Control Msgs listview is used to manage control messages: WM_0xC09B is an application defined and unregistered message and is shown as the message code. The two user messages are written on a tomato red background. WM_NOTIFYs and WM_COMMANDs WM_NOTIFYs and WM_COMMANDs listviews are used to manage notifications contained in WM_NOTIFY and WM_COMMAND messages. Toolbar listviews 2 - 5 Messages and notifications in toolbar listviews 2 - 5 are grouped by checked/unchecked items. Unchecked items in bottom of listviews. Update 2018-08-15. A Search can be initiated by double-clicking a message or notification in toolbar listviews 2 - 5. Update 2018-08-04. Toolbar buttons Click Refresh to update main listview after messages and notifications are un- or in-checked in toolbar listviews. Click Rerun to run the script and perform message collection once more. A submenu shows up with "Rerun script", "Write messages to console" and "Detail message information" items. The two last items are the same options as can be set through flag values in WinMsgMon_InitMsgs(). In the example in top of post WinMsgMon_ViewMsgs() takes Example as an input parameter. This is the function that will be executed when you click "Rerun script". The function parameter is optional. If not specified, Rerun button is disabled. The Search group is used to search for messages and notifications. When you click the Search button the Search listview shows up. Double click or press Enter key on an item in the listview to start a search. A search for WM_USER1 messages looks this way in main listview: Use Reset button to reset a search. A search can also be initiated by double-clicking a message or notification in toolbar listviews 2 - 5. Update 2018-08-04. Copy button copies text in selected rows to clipboard. Set button applies settings defined in WinMsgMon.ini. See below. A submenu shows up with Uncheck and Colors items. Click Uncheck to uncheck messages defined in ini-file. Colors are already set through GUI creation. Reset shows a submenu with Uncheck, Colors and Search items. Click an item to reset the feature. Use Set button to apply the feature again. Code info A few notes about the code in relation to toolbar listviews and buttons. All listviews are virtual listviews. Through message collection, indexes are created to display data in main listview and to perform searches. Several set of indexes are created. A set for all windows and controls at once. And a set for each single window and control. When a row in Wins/Ctrls toolbar listview (the leftmost listview) is checked, messages are displayed in main listview through one of these precalculated indexes. That's the reason why it's possible to display the messages in the same moment as the row is checked. Search indexes are created for each single message and notification in the Search listview. A set for all windows and controls at once. And a set for each single window and control. That's a lot of search indexes. In the example above, there are around 100 - 150 search indexes. Calculation of indexes is performed through dictionary objects. When you perform a search the matching rows in main listview are instantly drawn with the yellow background color through a precalculated search index. Next and Prev buttons also takes advantage of the indexes. As soon as a message or notification is unchecked in toolbar listviews 2 - 5 none of these precalculated indexes can be used any more. When you click Refresh a new index is calculated to be able to display the messages in main listview. When you start a search a new index is calculated to be able to display matching messages with the yellow background color, and to be able to use Next and Prev buttons. Up to 10,000 messages, performance should not be a problem. So far, no more messages have been tested. Arrays are dimensioned to a maximum of 100,000 messages. The number of windows and controls in leftmost toolbar listview is limited to 20. When you check an item in leftmost toolbar listview all unchecked messages and notifications are reset and the precalculated indexes can be used again. Functions Most functions have already been described through review of the example in top of post. There are only a few left: WinMsgMon_LoadMsgs() When the message flow from an application is monitored, usually only messages for a single control and main GUI is monitored at a time. However, there will nevertheless often be messages from eg. buttons that are very common controls. If button messages are not registered with WinMsgMon_GetMsgs( $idButton ), messages will appear with the code instead of the name. It's actually the notifications that will appear with the code instead of the name. Use WinMsgMon_LoadMsgs() to load notification names this way: #include "..\..\Includes\WinMsgMon.au3" WinMsgMon_InitMsgs( "..\..\Includes" ) WinMsgMon_LoadMsgs( "BCN_Notifications.txt" ) ; Button control notifications WinMsgMon_LoadMsgs( "EN_Notifications.txt" ) ; Edit control notifications WinMsgMon_RemMsgs() WinMsgMon_RemMsgs() removes all message monitors registered with WinMsgMon_GetMsgs(). WinMsgMon_RemMsgs() is called as the first command in WinMsgMon_ViewMsgs(). It's only necessary to call WinMsgMon_RemMsgs() if WinMsgMon_ViewMsg() isn't called. Ie. if the messages are written to SciTE console only. And only if code is executed after GUIDelete(). Detail info Detail info is information in columns named Info 1 - 4 in WinMsgMon GUI. This is information that can be extracted through wParam and lParam parameters in a message handler function. Detail info for WM_NOTIFY and WM_COMMAND messages is always extracted. Detail info for other window and control messages is depending on specific message handlers (script files). In this version only a few message handlers are implemented and only for a limited number of messages. To be able to collect detail info the message handler must be included in the script. In the example in top of post WinMsgMon_Button.au3 is included instead of WinMsgMon.au3 to be able to collect detail info for buttons. WinMsgMon.ini Includes\WinMsgMon.ini is included in the zip-file. If a copy of this file is placed in the same folder as the running script, the copy will be used instead. You can edit the copy to your own needs. An empty file disables all settings in Includes\WinMsgMon.ini. Includes\WinMsgMon.ini: [Apply Settings] Uncheck=True Colors=True [WM_MESSAGEs Uncheck] WM_ERASEBKGND=1 WM_IME_NOTIFY=1 WM_MOUSEMOVE=1 WM_MOVE=1 WM_MOVING=1 WM_NCHITTEST=1 WM_NCMOUSEMOVE=1 WM_PAINT=1 WM_PRINTCLIENT=1 WM_SETCURSOR=1 WM_TIMER=1 WM_WINDOWPOSCHANGED=1 WM_WINDOWPOSCHANGING=1 [WM_MESSAGEs Colors] WM_NOTIFY=Aquamarine WM_COMMAND=Aquamarine WM_KEYDOWN=Bisque WM_KEYUP=Bisque WM_CHAR=Bisque WM_DEADCHAR=Bisque WM_SYSKEYDOWN=Bisque WM_SYSKEYUP=Bisque WM_SYSCHAR=Bisque WM_SYSDEADCHAR=Bisque WM_LBUTTONDOWN=Khaki WM_LBUTTONUP=Khaki WM_LBUTTONDBLCLK=Khaki WM_RBUTTONDOWN=Khaki WM_RBUTTONUP=Khaki WM_RBUTTONDBLCLK=Khaki WM_MBUTTONDOWN=Khaki WM_MBUTTONUP=Khaki WM_MBUTTONDBLCLK=Khaki WM_MOUSEWHEEL=Khaki WM_XBUTTONDOWN=Khaki WM_XBUTTONUP=Khaki WM_XBUTTONDBLCLK=Khaki WM_CONTEXTMENU=LightPink WM_INITMENU=LightPink WM_INITMENUPOPUP=LightPink WM_MENUSELECT=LightPink WM_MENUCHAR=LightPink WM_MENURBUTTONUP=LightPink WM_MENUGETOBJECT=LightPink WM_UNINITMENUPOPUP=LightPink WM_MENUCOMMAND=LightPink WM_ENTERMENULOOP=LightPink WM_EXITMENULOOP=LightPink WM_NEXTMENU=LightPink [Control Messages Uncheck] [Control Messages Colors] WM_USER0=Tomato WM_USER1=Tomato WM_USER2=Tomato WM_USER3=Tomato WM_USER4=Tomato WM_USER5=Tomato WM_USER6=Tomato WM_USER7=Tomato WM_USER8=Tomato WM_USER9=Tomato WM_USERA=Tomato WM_USERB=Tomato WM_USERC=Tomato WM_USERD=Tomato WM_USERE=Tomato WM_USERF=Tomato [WM_NOTIFY Notifications Uncheck] [WM_NOTIFY Notifications Colors] [WM_COMMAND Notifications Uncheck] [WM_COMMAND Notifications Colors] "Uncheck=True" in "Apply Settings" section in WinMsgMon.ini means that unchecked messages are removed from main listview through GUI creation. As soon as an item in Wins/Ctrls toolbar listview (leftmost) is checked the removed messages are redisplayed. Click Set | Uncheck to remove the messages again. "Colors=True" in "Apply Settings" section means that colors are set through GUI creation. Examples Examples\ 1) Native controls - GUICtrlCreate<Control> examples supplied with message monitor code 2) UDF controls - _GUICtrl<Control>_Create examples (not included above) supplied with message monitor code 3) Miscellaneous Combo\ - ComboBox example including the corresponding Edit and ListBox controls. ListView\ - Four ListView examples with a standard ListView, a custom drawn ListView, a virtual ListView and a virtual and custom drawn ListView. Window\ - An example that shows how mouse clicks generates AutoIt messages ($GUI_EVENT_MESSAGEs). Two examples regarding blocked and paused GUIs. Includes Includes\ WinMsgMon.au3 - Main include file, collects messages WinMsgMon_Button.au3 - Button controls, detail information WinMsgMon_ComboBoxEx.au3 - ComboBoxEx controls, detail information WinMsgMon_ListBox.au3 - ListBox controls, detail information WinMsgMon_ListView.au3 - ListView controls, detail information WinMsgMon.ini - ini-file, colors and unchecked messages Internal\ - Internal files, implements the GUI Messages\ - Message info files CTRL_Information.txt - Info file for AutoIt window and 23 controls WM_Messages.txt - Common Windows messages CCM_Messages.txt - Common control messages <???>_Messages.txt - Messages for specific controls WM_NOTIFY\ NM_Notifications.txt - Common Windows notifications <???>_Notifications.txt - WM_NOTIFY notifications for specific controls WM_COMMAND\ <???>_Notifications.txt - WM_COMMAND notifications for specific controls 7z-file The 7z contains source code and message data. You need AutoIt 3.3.12 or later. Tested on Windows 7 and Windows 10. Comments are welcome. Let me know if there are any issues. WinMsgMon.7z
    1 point
  14. The example reads the current width of the vertical scrollbar, increases the width with 5 pixels, and restores the original width. It seems like the height of the horizontal scroll bar is changed accordingly. I have not investigated this in detail. #include <WinAPI.au3> #include <WinAPIsysinfoConstants.au3> Global Const $tagNONCLIENTMETRICS = "uint cbSize;" & _ "int iBorderWidth;" & _ "int iScrollWidth;" & _ "int iScrollHeight;" & _ "int iCaptionWidth;" & _ "int iCaptionHeight;" & _ "byte lfCaptionFont[92];" & _ "int iSmCaptionWidth;" & _ "int iSmCaptionHeight;" & _ "byte lfSmCaptionFont[92];" & _ "int iMenuWidth;" & _ "int iMenuHeight;" & _ "byte lfMenuFont[92];" & _ "byte lfStatusFont[92];" & _ "byte lfMessageFont[92]" ;"int iPaddedBorderWidth" Global Const $tagLOGFONTW = "STRUCT;" & _ "int Height;" & _ "int Width;" & _ "int Escapement;" & _ "int Orientation;" & _ "int Weight;" & _ "byte Italic;" & _ "byte Underline;" & _ "byte Strikeout;" & _ "byte CharSet;" & _ "byte OutPrecision;" & _ "byte ClipPrecision;" & _ "byte Quality;" & _ "byte PitchAndFamily;" & _ "wchar FaceName[32];" & _ "ENDSTRUCT" Opt( "MustDeclareVars", 1 ) Example() Func Example() ; Fill NONCLIENTMETRICS structure with current values Local $tNONCLIENTMETRICS = DllStructCreate( $tagNONCLIENTMETRICS ) DllStructSetData( $tNONCLIENTMETRICS, "cbSize", DllStructGetSize( $tNONCLIENTMETRICS ) ) _WinAPI_SystemParametersInfo( $SPI_GETNONCLIENTMETRICS, DllStructGetSize( $tNONCLIENTMETRICS ), DllStructGetPtr( $tNONCLIENTMETRICS ) ) ; Get the width of the vertical scroll bar Local $iScrollWidth = DllStructGetData( $tNONCLIENTMETRICS, "iScrollWidth" ) ConsoleWrite( "iScrollWidth = " & $iScrollWidth & @CRLF ) MsgBox( 0, "Width of vertical scroll bar", "$iScrollWidth = " & $iScrollWidth ) ;Local $lfCaptionFont = DllStructCreate( $tagLOGFONTW, DllStructGetPtr( $tNONCLIENTMETRICS, "lfCaptionFont" )) ; Increase width of scroll bar with 5 pixels DllStructSetData( $tNONCLIENTMETRICS, "iScrollWidth", $iScrollWidth + 5 ) _WinAPI_SystemParametersInfo( $SPI_SETNONCLIENTMETRICS, DllStructGetSize( $tNONCLIENTMETRICS ), DllStructGetPtr( $tNONCLIENTMETRICS ), $SPIF_SENDCHANGE ) ; Get new width of vertical scroll bar _WinAPI_SystemParametersInfo( $SPI_GETNONCLIENTMETRICS, DllStructGetSize( $tNONCLIENTMETRICS ), DllStructGetPtr( $tNONCLIENTMETRICS ) ) Local $iScrollWidthNew = DllStructGetData( $tNONCLIENTMETRICS, "iScrollWidth" ) ConsoleWrite( "iScrollWidthNew = " & $iScrollWidthNew & @CRLF ) MsgBox( 0, "New width of vertical scroll bar", "$iScrollWidthNew = $iScrollWidth + 5 = " & $iScrollWidthNew & _ @CRLF & @CRLF & "You can verify the width in a window with a scroll bar" ) ; Restore original width of scroll bar DllStructSetData( $tNONCLIENTMETRICS, "iScrollWidth", $iScrollWidth ) _WinAPI_SystemParametersInfo( $SPI_SETNONCLIENTMETRICS, DllStructGetSize( $tNONCLIENTMETRICS ), DllStructGetPtr( $tNONCLIENTMETRICS ), $SPIF_SENDCHANGE ) ; Get original width of scroll bar _WinAPI_SystemParametersInfo( $SPI_GETNONCLIENTMETRICS, DllStructGetSize( $tNONCLIENTMETRICS ), DllStructGetPtr( $tNONCLIENTMETRICS ) ) $iScrollWidth = DllStructGetData( $tNONCLIENTMETRICS, "iScrollWidth" ) ConsoleWrite( "iScrollWidth = " & $iScrollWidth & @CRLF ) MsgBox( 0, "Original width of scroll bar", "$iScrollWidth = " & $iScrollWidth ) EndFunc
    1 point
×
×
  • Create New...