Jump to content

Recommended Posts

Posted (edited)
5 hours ago, WildByDesign said:

For some reason I cannot seem to get the handle for the SysShadow class window here. It could be because it’s not created quite yet. Or possibly I might have to try one of the WinAPI window enumeration functions to get the handle.

Two problems here. The first problem is that  SysShadow windows don’t seem to have a parent and therefore run under the Desktop thread from what I can tell. But I found a way to get the handle and the first problem is solved.

The second problem is that they are created just after DTN_DROPDOWN which is why I was having trouble getting the handle. To solve the second problem, I need to create a timer to check every 5ms until the SysShadow handle becomes available after DTN_DROPDOWN is triggered. Then I can move it and kill the timer.

I am not good with timers yet though so I have to figure it out still.

23 minutes ago, bladem2003 said:

I have a new little problem for you. 😉

When you change the tab height, a white box appears above the up/down controls.

Thanks for reporting. I will get this fix in the next release. Thanks for script to reproduce the issue as well. That is helpful. :)

 

Edited by WildByDesign
Posted

GUIDarkTheme 2.4.3

  • Fixed issue with positioning of drop shadow (SysShadow class) of SysMonthCal32 control
  • Fixed issue with white showing on tab control when larger tab height is used
  • Fixed another occurrence where white would show on tab control

We now have a dark mode calendar (SysMonthCal32) that is about as perfect as we can make it. This covers the calendar drop down from a SysDateTimePick32 control. I still haven't colored a standalone SysMonthCal32 yet but I will do that next.

@bladem2003 This release should fix your issue with larger tab height. I tested without GUIDarkTheme UDF just to see how Windows handles the larger tab height and it seems to handle it the same now.

Posted (edited)

Please take a look on:

https://www.autoitscript.com/trac/autoit/ticket/4095

as you are creator of ths function I would like to ask you to give your opinion on that sugestion/feature request to the UDF.

Edited by mLipok

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

Spoiler

Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind. 

My contribution (my own projects): * Debenu Quick PDF Library - UDF * Debenu PDF Viewer SDK - UDF * Acrobat Reader - ActiveX Viewer * UDF for PDFCreator v1.x.x * XZip - UDF * AppCompatFlags UDF * CrowdinAPI UDF * _WinMergeCompare2Files() * _JavaExceptionAdd() * _IsBeta() * Writing DPI Awareness App - workaround * _AutoIt_RequiredVersion() * Chilkatsoft.au3 UDF * TeamViewer.au3 UDF * JavaManagement UDF * VIES over SOAP * WinSCP UDF * GHAPI UDF - modest begining - comunication with GitHub REST APIErrorLog.au3 UDF - A logging Library * Include Dependency Tree (Tool for analyzing script relations) * Show_Macro_Values.au3 *

 

My contribution to others projects or UDF based on  others projects: * _sql.au3 UDF  * POP3.au3 UDF *  RTF Printer - UDF * XML.au3 UDF * ADO.au3 UDF SMTP Mailer UDF * Dual Monitor resolution detection * * 2GUI on Dual Monitor System * _SciLexer.au3 UDF * SciTE - Lexer for console pane

Useful links: * Forum Rules * Forum etiquette *  Forum Information and FAQs * How to post code on the forum * AutoIt Online Documentation * AutoIt Online Beta Documentation * SciTE4AutoIt3 getting started * Convert text blocks to AutoIt code * Games made in Autoit * Programming related sites * Polish AutoIt Tutorial * DllCall Code Generator * 

Wiki: Expand your knowledge - AutoIt Wiki * Collection of User Defined Functions * How to use HelpFile * Good coding practices in AutoIt * 

OpenOffice/LibreOffice/XLS Related: WriterDemo.au3 * XLS/MDB from scratch with ADOX

IE Related:  * How to use IE.au3  UDF with  AutoIt v3.3.14.x * Why isn't Autoit able to click a Javascript Dialog? * Clicking javascript button with no ID * IE document >> save as MHT file * IETab Switcher (by LarsJ ) * HTML Entities * _IEquerySelectorAll() (by uncommon) * IE in TaskSchedulerIE Embedded Control Versioning (use IE9+ and HTML5 in a GUI) * PDF Related:How to get reference to PDF object embeded in IE * IE on Windows 11

I encourage you to read: * Global Vars * Best Coding Practices * Please explain code used in Help file for several File functions * OOP-like approach in AutoIt * UDF-Spec Questions *  EXAMPLE: How To Catch ConsoleWrite() output to a file or to CMD *

I also encourage you to check awesome @trancexx code:  * Create COM objects from modules without any demand on user to register anything. * Another COM object registering stuffOnHungApp handlerAvoid "AutoIt Error" message box in unknown errors  * HTML editor

winhttp.au3 related : * https://www.autoitscript.com/forum/topic/206771-winhttpau3-download-problem-youre-speaking-plain-http-to-an-ssl-enabled-server-port/

"Homo sum; humani nil a me alienum puto" - Publius Terentius Afer
"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, "The Art of Computer Programming"
:naughty:  :ranting:, be  :) and       \\//_.

Anticipating Errors :  "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty."

Signature last update: 2023-04-24

Posted
2 minutes ago, mLipok said:

as you are creator of ths function I would like to ask you to give your opinion on that sugestion/feature request to the UDF.

I appreciate that and I do strongly believe that the DarkMode API functions should absolutely be added to the standard UDFs.

Please keep in mind that the majority of them are undocumented by Microsoft. Even though the API has been used reliably for many, many years by big projects such as Notepad++ and others. But I don't know what the rules are (or not) when it comes to accepting undocumented API into standard UDF.

Note: The added API would likely be _WinAPI_* and not __DM_WinAPI_* since the "__DM" part is just added to separate the GUIDarkThemeUDF functions in case of clashes with other user created function names.

Also important to clarify, I did not create any of the _WinAPI_* dark mode functions. I'm not very good with DllCall API stuff. I believe they were initially created by @NoNameCode and @argumentum but I don't recall the full history of those functions. I should also mention that @UEZ has created additional dark mode API functions that were not part of the original set. His recent work has the most extensive dark mode API functions available right now in AutoIt. Check his most recent dark mode functions here nicely together in the DarkMode API #Region.

Posted (edited)

As long as you remember... please add standard header generated by SciTE (CTRL + ALT + H) to each Func __DM_WinAPI_ and fullfill the 
; Author ........: ????? information

You can keep all others information not changed (as SciTE generate them).

 

Edited by mLipok

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

Spoiler

Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind. 

My contribution (my own projects): * Debenu Quick PDF Library - UDF * Debenu PDF Viewer SDK - UDF * Acrobat Reader - ActiveX Viewer * UDF for PDFCreator v1.x.x * XZip - UDF * AppCompatFlags UDF * CrowdinAPI UDF * _WinMergeCompare2Files() * _JavaExceptionAdd() * _IsBeta() * Writing DPI Awareness App - workaround * _AutoIt_RequiredVersion() * Chilkatsoft.au3 UDF * TeamViewer.au3 UDF * JavaManagement UDF * VIES over SOAP * WinSCP UDF * GHAPI UDF - modest begining - comunication with GitHub REST APIErrorLog.au3 UDF - A logging Library * Include Dependency Tree (Tool for analyzing script relations) * Show_Macro_Values.au3 *

 

My contribution to others projects or UDF based on  others projects: * _sql.au3 UDF  * POP3.au3 UDF *  RTF Printer - UDF * XML.au3 UDF * ADO.au3 UDF SMTP Mailer UDF * Dual Monitor resolution detection * * 2GUI on Dual Monitor System * _SciLexer.au3 UDF * SciTE - Lexer for console pane

Useful links: * Forum Rules * Forum etiquette *  Forum Information and FAQs * How to post code on the forum * AutoIt Online Documentation * AutoIt Online Beta Documentation * SciTE4AutoIt3 getting started * Convert text blocks to AutoIt code * Games made in Autoit * Programming related sites * Polish AutoIt Tutorial * DllCall Code Generator * 

Wiki: Expand your knowledge - AutoIt Wiki * Collection of User Defined Functions * How to use HelpFile * Good coding practices in AutoIt * 

OpenOffice/LibreOffice/XLS Related: WriterDemo.au3 * XLS/MDB from scratch with ADOX

IE Related:  * How to use IE.au3  UDF with  AutoIt v3.3.14.x * Why isn't Autoit able to click a Javascript Dialog? * Clicking javascript button with no ID * IE document >> save as MHT file * IETab Switcher (by LarsJ ) * HTML Entities * _IEquerySelectorAll() (by uncommon) * IE in TaskSchedulerIE Embedded Control Versioning (use IE9+ and HTML5 in a GUI) * PDF Related:How to get reference to PDF object embeded in IE * IE on Windows 11

I encourage you to read: * Global Vars * Best Coding Practices * Please explain code used in Help file for several File functions * OOP-like approach in AutoIt * UDF-Spec Questions *  EXAMPLE: How To Catch ConsoleWrite() output to a file or to CMD *

I also encourage you to check awesome @trancexx code:  * Create COM objects from modules without any demand on user to register anything. * Another COM object registering stuffOnHungApp handlerAvoid "AutoIt Error" message box in unknown errors  * HTML editor

winhttp.au3 related : * https://www.autoitscript.com/forum/topic/206771-winhttpau3-download-problem-youre-speaking-plain-http-to-an-ssl-enabled-server-port/

"Homo sum; humani nil a me alienum puto" - Publius Terentius Afer
"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, "The Art of Computer Programming"
:naughty:  :ranting:, be  :) and       \\//_.

Anticipating Errors :  "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty."

Signature last update: 2023-04-24

Posted
3 hours ago, mLipok said:

As long as you remember... please add standard header generated by SciTE (CTRL + ALT + H) to each Func __DM_WinAPI_ and fullfill the 
; Author ........: ????? information

Just to clarify, do you want me to add Author to all 100 or so functions or just the dark mode (UxTheme.dll) specific functions?

I don’t use SciTE so I’m not sure if VSCode/VSCodium has the ability to auto-generate function headers.

I have Authors (credits) at the top of that file in the main/top header for that DarkAPI* add-on UDF. My intention there was just to limit hundreds of extra comment lines in the UDF and reduce overall file size.

Posted

Every day we're changing the UDF because every day we're discovering things. Every day we're having requests. It's too soon right now to think of this as to incorporate it into the standard distribution. Whenever this becomes stable because there is no changes, not because it's better or worse, then we remove the duplicate functions and incorporate it. But I believe that is some time away from now. My two cents. 

Follow the link to my code contribution ( and other things too ).
FAQ - Please Read Before Posting  image.gif.922e3a93535f431de08b31ee669cc446.gif
autoit_scripter_blue_userbar.png

Posted (edited)

Thanks to you both for answers.
Ok.

6 minutes ago, argumentum said:

then we remove the duplicate functions and incorporate it

do you mean for example:

__DM_WinAPI_GetDeviceCaps() which is currently in UDF as _WinAPI_GetDeviceCaps() and acts exactly the same way ?

or __DM_WinAPI_GetTextExtentPoint32() >> _WinAPI_GetTextExtentPoint32()

 

Edited by mLipok

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

Spoiler

Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind. 

My contribution (my own projects): * Debenu Quick PDF Library - UDF * Debenu PDF Viewer SDK - UDF * Acrobat Reader - ActiveX Viewer * UDF for PDFCreator v1.x.x * XZip - UDF * AppCompatFlags UDF * CrowdinAPI UDF * _WinMergeCompare2Files() * _JavaExceptionAdd() * _IsBeta() * Writing DPI Awareness App - workaround * _AutoIt_RequiredVersion() * Chilkatsoft.au3 UDF * TeamViewer.au3 UDF * JavaManagement UDF * VIES over SOAP * WinSCP UDF * GHAPI UDF - modest begining - comunication with GitHub REST APIErrorLog.au3 UDF - A logging Library * Include Dependency Tree (Tool for analyzing script relations) * Show_Macro_Values.au3 *

 

My contribution to others projects or UDF based on  others projects: * _sql.au3 UDF  * POP3.au3 UDF *  RTF Printer - UDF * XML.au3 UDF * ADO.au3 UDF SMTP Mailer UDF * Dual Monitor resolution detection * * 2GUI on Dual Monitor System * _SciLexer.au3 UDF * SciTE - Lexer for console pane

Useful links: * Forum Rules * Forum etiquette *  Forum Information and FAQs * How to post code on the forum * AutoIt Online Documentation * AutoIt Online Beta Documentation * SciTE4AutoIt3 getting started * Convert text blocks to AutoIt code * Games made in Autoit * Programming related sites * Polish AutoIt Tutorial * DllCall Code Generator * 

Wiki: Expand your knowledge - AutoIt Wiki * Collection of User Defined Functions * How to use HelpFile * Good coding practices in AutoIt * 

OpenOffice/LibreOffice/XLS Related: WriterDemo.au3 * XLS/MDB from scratch with ADOX

IE Related:  * How to use IE.au3  UDF with  AutoIt v3.3.14.x * Why isn't Autoit able to click a Javascript Dialog? * Clicking javascript button with no ID * IE document >> save as MHT file * IETab Switcher (by LarsJ ) * HTML Entities * _IEquerySelectorAll() (by uncommon) * IE in TaskSchedulerIE Embedded Control Versioning (use IE9+ and HTML5 in a GUI) * PDF Related:How to get reference to PDF object embeded in IE * IE on Windows 11

I encourage you to read: * Global Vars * Best Coding Practices * Please explain code used in Help file for several File functions * OOP-like approach in AutoIt * UDF-Spec Questions *  EXAMPLE: How To Catch ConsoleWrite() output to a file or to CMD *

I also encourage you to check awesome @trancexx code:  * Create COM objects from modules without any demand on user to register anything. * Another COM object registering stuffOnHungApp handlerAvoid "AutoIt Error" message box in unknown errors  * HTML editor

winhttp.au3 related : * https://www.autoitscript.com/forum/topic/206771-winhttpau3-download-problem-youre-speaking-plain-http-to-an-ssl-enabled-server-port/

"Homo sum; humani nil a me alienum puto" - Publius Terentius Afer
"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, "The Art of Computer Programming"
:naughty:  :ranting:, be  :) and       \\//_.

Anticipating Errors :  "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty."

Signature last update: 2023-04-24

Posted (edited)
36 minutes ago, argumentum said:

Most of them are verbatim the same function, just renamed to not to collide with the standard UDFs. 

This is correct, for sure.

To clarify some more, the only real change for these functions is to keep the loaded DLL handles in memory for performance purposes. That is the main intent. As opposed to have the DLLs open and close over and over again in busy subclass procedures.

Performance improvements are minimal, however, when we are thinking about the sheer amount of subclassing going on in this UDF, every small amount of performance gain adds up. A little bit here, a little bit there. Overall adds up and I have created many functions to perf test all of the functions that I use. Kind of like a dollar store. You get a few things, then a few more. Next thing you know it really adds up at the cash register. :)

Also with AutoIt being single threaded. We have to do whatever we can to stay as efficient as possible. Efficiency is something that I think about a lot. First, I get things to just work. Then I go over a few iterations of “How can I improve this?”. 

Edited by WildByDesign
Posted

Do you know what the cost of the open close dll is 4microseconds in my system

Quote

#include <WinAPISysWin.au3>

Global $__g_hUser32Dll = DllOpen("user32.dll")
Example()

Func Example()
    Local $nLoopMax = 1000
    Local $hTimer = TimerInit()
    For $i = 1 To $nLoopMax
        _WinAPI_GetDesktopWindow()
    Next
    Local $fTimer = TimerDiff($hTimer)
    $hTimer = TimerInit()
    For $i = 1 To $nLoopMax
        _WinAPI_GetDesktopWindow_()
    Next
    Local $fTimer_ = TimerDiff($hTimer)
    LOcal $fDiff = ($fTimer - $fTimer_) / $nLoopMax
    ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $fDiff = ' & $fDiff & @CRLF & '>Error code: ' & @error & '    Extended code: ' & @extended & ' (0x' & Hex(@extended) & ')' & @CRLF) ;### Debug Console
EndFunc   ;==>Example

Func _WinAPI_GetDesktopWindow_()
    Local $aCall = DllCall($__g_hUser32Dll, "hwnd", "GetDesktopWindow")
    If @error Then Return SetError(@error, @extended, 0)

    Return $aCall[0]
EndFunc   ;==>_WinAPI_GetDesktopWindow_

so I think the optimisation is not really needed

Posted
2 hours ago, jpm said:

so I think the optimisation is not really needed

This is a nice perf test. It was about 3 microseconds here so that is reassuring. Thank you for sharing. :)

I just did a test here locally by removing all of the custom DLL loaded __DM-related WinAPI functions and used all from standard UDFs unmodified to get a "real-world" feel for it. Everything worked really well. I did not notice any flicker or any issues.

So I think next release will switch back to all standard UDF libraries. This way, it will also benefit from future updates/fixes in those standard UDF libraries.

Posted
2 hours ago, jpm said:

so I think the optimisation is not really needed

#include <WinAPISysWin.au3>

;~ Global $__g_hUser32Dll = "user32.dll"                        ; @@ Debug(20) : $fDiff = 3.6814 - 0.00016
Global $__g_hUser32Dll = DllOpen(@SystemDir & "\user32.dll")    ; @@ Debug(20) : $fDiff = 1.3211 - 0.002404
Example()

Func Example()
    Local $nLoopMax = 1000
    Local $hTimer = TimerInit()
    For $i = 1 To $nLoopMax
        _WinAPI_GetDesktopWindow()
    Next
    Local $fTimer = TimerDiff($hTimer)
    $hTimer = TimerInit()
    For $i = 1 To $nLoopMax
        _WinAPI_GetDesktopWindow_()
    Next
    Local $fTimer_ = TimerDiff($hTimer)
    LOcal $fDiff = Round(($fTimer - $fTimer_) / $nLoopMax, 6)
    ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $fDiff = ' & $fTimer_ & ' - ' & $fDiff & @CRLF & '>Error code: ' & @error & '    Extended code: ' & @extended & ' (0x' & Hex(@extended) & ')' & @CRLF) ;### Debug Console
EndFunc   ;==>Example

Func _WinAPI_GetDesktopWindow_()
    Local $aCall = DllCall($__g_hUser32Dll, "hwnd", "GetDesktopWindow")
    If @error Then Return SetError(@error, @extended, 0)

    Return $aCall[0]
EndFunc   ;==>_WinAPI_GetDesktopWindow_

...it is much slower. Not OMG! slower, but it is.

Does it deserve attention ?
That depends on the security point of view ( were a "dll" is in the same folder, the "downloads folder" likely, waiting for a program to load it ) and how slow is the PC.
...so, change every UDF better ( that is a lot of work ), probably not.

Should try it in the demo script and feel the difference.
But if is going with the standard UDFs, what it feels like or not, won't matter.

P.S.: I guess I wrote all this not to sway one way or another but to clarify the trade offs.

Follow the link to my code contribution ( and other things too ).
FAQ - Please Read Before Posting  image.gif.922e3a93535f431de08b31ee669cc446.gif
autoit_scripter_blue_userbar.png

Posted (edited)
38 minutes ago, argumentum said:

That depends on the security point of view ( were a "dll" is in the same folder, the "downloads folder" likely, waiting for a program to load it ) and how slow is the PC.
...so, change every UDF better ( that is a lot of work ), probably not.

Should try it in the demo script and feel the difference.
But if is going with the standard UDFs, what it feels like or not, won't matter.

P.S.: I guess I wrote all this not to sway one way or another but to clarify the trade offs.

This is actually a pretty fascinating perspective. So this, I assume, related to how Windows does is DLLSearchOrder or whatever they call it where it searches local Dir first, then System dir?

Very, very neat. You've got me thinking more now. :)

Perf, perf, perf!!! 😁

Edited by WildByDesign
Posted

This is so weird, the emoji thingies break the forum. It is impossible to press the Enter key after an emoji to make another line. Hmm... even editing the previous post, I cannot press Enter after that last smiling emoji. Anyway... back to more important things. 

Posted
On 5/15/2026 at 11:06 PM, argumentum said:
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include "GUIDarkTheme.au3"

#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 300, 200, -1, -1)
GUICtrlCreateLabel("", 0, 120, 300, 200 - 120); , $SS_GRAYRECT)
GUICtrlSetBkColor(-1, 0x202020)
GUICtrlSetState(-1, $GUI_DISABLE)
GUICtrlCreateLabel("Hello there !", 40, 40)
$id_Bttn_Ok = GUICtrlCreateButton("&OK", 150, 150, 75, 21)
_GUIDarkTheme_ApplyDark($Form1)
GUISetBkColor(0x363636)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE, $id_Bttn_Ok
            GUIDelete()
            Exit

    EndSwitch
WEnd

..hope it helps

Thank you, you're amazing!
I tried it and the results were as I expected.

Posted

GUIDarkTheme 2.5.0

  • Added dark mode support for standalone month calendar (SysMonthCal32 class) control
  • Added initial dark mode support for toolbars (ToolbarWindow32 class)
    • No support for Rebar controls yet
  • Switched all __DM_WinAPI_ functions back to original _WinAPI_ standard libraries
    • Removed all loaded DLL handles
  • Added basic function header with Author to all functions
    • More function header details to add later
Posted
10 minutes ago, jpm said:

GUIDarkAPI.au3 require just

Thank you, I will fix this. :)

I don't think we need to include SendMessage.au3 though because it is already included by including WinAPISysWin.au3.

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...