LarsJ Posted April 19, 2020 Author Share Posted April 19, 2020 (edited) The range of messages is a Microsoft definition. I've done a lot of performance tests. Primarily in this example. If the same subclassing is performed with GUIRegisterMsg(), GUIRegisterMsg20() and SetWindowSubclass() then the message filtering speed will be this (fastest first): GUIRegisterMsg(), SetWindowSubclass() and GUIRegisterMsg20(). GUIRegisterMsg() is fastest because message filtering is done in internal compiled code. If you implement SetWindowSubclass() yourself, you can optimize the message filtering a bit and therefore SetWindowSubclass() is the second fastest. GUIRegisterMsg20() is slowest as the function is coded as a UDF and therefore cannot be easily optimized for the given situation. An important purpose of GUIRegisterMsg20() is that it can be used in situations where GUIRegisterMsg() cannot be used. And in these situations, it's of no use that the message filtering is a bit faster in GUIRegisterMsg(). However, message filtering is not so important in terms of the overall performance of all the subclassing code. The code in the message handling function itself is far more important. Eg. the code in the WM_NOTIFY() function shown in the Too much code section in first post. And that code is the same in all three methods. Thus, in the Too much code example, the code will fail in all three methods. Edited April 19, 2020 by LarsJ Controls, File Explorer, ROT objects, UI Automation, Windows Message MonitorCompiled code: Accessing AutoIt variables, DotNet.au3 UDF, Using C# and VB codeShell menus: The Context menu, The Favorites menu. Shell related: Control Panel, System Image ListsGraphics related: Rubik's Cube, OpenGL without external libraries, Navigating in an image, Non-rectangular selectionsListView controls: Colors and fonts, Multi-line header, Multi-line items, Checkboxes and icons, Incremental searchListView controls: Virtual ListViews, Editing cells, Data display functions Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now