Leaderboard
Popular Content
Showing content with the highest reputation on 02/10/2024 in all areas
-
_GUICtrlStatusBar_Resize_Equidistant()
taurus905 and 2 others reacted to argumentum for a topic
..in the words of @Andreik: "nah, you do it". So I posted #include <GUIConstantsEx.au3> #include <GuiStatusBar.au3> #include <WindowsConstants.au3> Global $g_hStatus, $g_aParts Example() Func Example() ; Create GUI Local $hGUI = GUICreate("StatusBar Resize Equidistant (v" & @AutoItVersion & ")", 400, 300, -1, -1, $WS_OVERLAPPEDWINDOW) ; Set parts $g_hStatus = _GUICtrlStatusBar_Create($hGUI) Dim $g_aParts[3] ; = [75, 150, -1] ; it no longer matters _GUICtrlStatusBar_SetParts($g_hStatus, $g_aParts) _GUICtrlStatusBar_SetText($g_hStatus, "Part 0") _GUICtrlStatusBar_SetText($g_hStatus, "Part 1", 1) _GUICtrlStatusBar_SetText($g_hStatus, "Part 2", 2) _GUICtrlStatusBar_Resize_Equidistant($g_hStatus, $g_aParts, $hGUI) GUISetState(@SW_SHOW) GUIRegisterMsg($WM_SIZE, "WM_SIZE") ; Loop until the user exits. Do Until GUIGetMsg() = $GUI_EVENT_CLOSE GUIDelete() EndFunc ;==>Example ; Resize the status bar when GUI size changes Func WM_SIZE($hWnd, $iMsg, $wParam, $lParam) #forceref $hWnd, $iMsg, $wParam, $lParam _GUICtrlStatusBar_Resize_Equidistant($g_hStatus, $g_aParts, $hWnd) If @error Then _GUICtrlStatusBar_Resize($g_hStatus) Return $GUI_RUNDEFMSG EndFunc ;==>WM_SIZE Func _GUICtrlStatusBar_Resize_Equidistant($hStatus, ByRef $aParts, $hGUI) Local $aPos = WinGetPos($hGUI) If @error Then Return SetError(1, 0, 0) Local $iSize = Int(($aPos[2] - 24) / UBound($aParts)) Local $aTemp[UBound($aParts)] ; the "- 24" makes it look more even For $n = 0 To UBound($aParts) - 2 $aTemp[$n] = $iSize * ($n + 1) Next $aTemp[$n] = -1 $aParts = $aTemp ; in case of WinGetPos() error. _GUICtrlStatusBar_SetParts($g_hStatus, $aTemp) EndFunc ;==>_GUICtrlStatusBar_Resize_Equidistant Same as resize but proportional/equidistant.3 points -
DarkMode UDF for AutoIt's Win32GUIs
taurus905 and one other reacted to argumentum for a topic
Since I'm working on updating the UDFs, I made a demo: that is quite ugly code wise. Hence my participation on this thread. I like your UDF and would love to see it merged to the extent that is currently functional to the standard distribution for a next release. Would you like to make the changes to make it so ? am recruiting you 🤪 ( am not affiliated with MVPs or developers but am nonetheless bringing up ideas , and try my best to have more capable product for us all ) By the way: this demo is to showcase _WinAPI_DwmSetWindowAttribute() and since it has no examples in the help file, I made two of which this is one. Also the enumeration is based in WinXP or 7. It all needs to be updated to Win 11. Having examples help the users use the function and also, out of the attention it gets, it get's debugged and expanded2 points -
DarkMode UDF for AutoIt's Win32GUIs
UEZ reacted to NoNameCode for a topic
Hello everyone, today I would like to show you how far I have come with the implementation of DarkMode for AutoIT GUIs. Source: https://github.com/ysc3839/win32-darkmode About Win32 Darkmode: Since about 2020 there is a "hidden" / "undocumented" API for Win32 DarkMode. There is also already a program that has implemented this quite well. (Notepad++) Difficulties Unfortunately, the Windows devs are either too lazy or have been stupid with the implementation. So we have to apply all kinds of fixes (as we are already used to) to get the GUIs to actually run completely. Also there are some difficulties as all existing code that could be used is written in c++. I understand that, but only rudimentarily. So if there is someone here who can / would like to help me translate / implement some existing solutions. There are for example: The 'FixDarkScrollBar()' function which I would like to implement, but where I just can't get any further. Also with ChatGPT the code is difficult to 'override' and it doesn't work at all. GPT tells me that the implementation in AutoIT is quite impossible. And the full IatHook.h (https://github.com/ysc3839/win32-darkmode/blob/master/win32-darkmode/IatHook.h) Edit: Sloved witth v0.0.3 Todos / Challenges: * Redrawing of the Menu to Black * Getting the other controls into the right Theme for DarkMode * Setting Text Theme Colder of e.g. Checkboxes, ListViewHeader or Group Text * Getting Darkmode for Date Let me know what you think and where you might have suggestions for improvement or ideas. (Especially if you can help translate c++ into autoit :3) Kind Regards NoNameCode GUIDarkMode_V0.03 - OpenNcThemeData Hook.zip Changelog V.03 * Added HookOpenNcThemeData.dll => Coded by NoNameCode in C++ if someone want the Source pls DM * Added HookOpenNcThemeData_Debug.dll => Same as HookOpenNcThemeData.dll but Creates a OpenNcThemeData.txt with the opened Classes and if the Class got Replaced by Hook * Changed Darkmode_GUISample.au3 > More Data for GUICtrlCreateList and GUICtrlCreateEdit + #include <String.au3> > Added Routine to get AutoIt Install Path by Reg; or if not by @AutoItExe for PIC (logo4.gif) or AVI (SampleAVI.avi) * Changed GUIDarkMode.au3 > Added DllOpen for HookOpenNcThemeData.dll and Added OnAutoItExitRegister for DllClose function > Changed _GUICtrlSetDarkTheme -> Cleand Up Switch by CTRL Class bec. moste of them are not needed anymore through ScrollbarFix via HookOpenNcThemeData.dll Old Stuff:1 point -
DarkMode UDF for AutoIt's Win32GUIs
NoNameCode reacted to argumentum for a topic
@Werty's footnote, "Some guy's script + some other guy's script = my script!". Well, that's me too I only wish I could remember where I left the car keys. Or code I wrote. Or read C and go through Notepad++, but, I'm a hobbyist scripter with some memories of Borland pascal been better than MS C++. Why am I saying this., Yes, I can not do what you just did with the UDF. Is not in me, am old and naturally disorganized. The idea is to open the different standard ( build in the AutoIt distro ) UDFs and complete them / expand them, with the new enumerators in each file destined to hold them. Add/modify the existing ones so that users can have a proper wrapper for each function call. _WinAPI_DwmSetWindowAttribute_unr() is a good example of what I did but would not be proper for release as part of the product ( I call the AutoIt3 distribution "the product" ). So is not changing your UDF but find a proper way to incorporate these new ... stuff, into the pre-existing ones and naming everything in accordance to MSDN documentation, as everything should have a reference of where the coder pull this out of. And, keep everything backward compatible ( as much as possible ) . Very important.1 point -
DarkMode UDF for AutoIt's Win32GUIs
NoNameCode reacted to argumentum for a topic
DllCall('uxtheme.dll', 'long', 'SetWindowTheme', 'hwnd', $hWnd_ListviewHeadder, 'wstr', "DarkMode_ItemsView", 'wstr', Null) ; dark DllCall('uxtheme.dll', 'long', 'SetWindowTheme', 'hwnd', $hWnd_ListviewHeadder, 'wstr', "ItemsView", 'wstr', Null) ; light is not much and not perfect but, is good to know that we can finally paint the edge where there is no items. The rest to coloring of the header is available in the forum. Thanks for sharing. And do zip those files. Add a version or date to the filename to clearly see updates Edit: a dirty patch to show it's potential in your demo: ... ; ListView hinzufügen $idListView = GUICtrlCreateListView("Spalte 1|Spalte 2|Spalte 3", 180, 280, 200, 100) $hHeadder = _GUICtrlListView_GetHeader($idListview) _GUICtrlSetDarkTheme($hHeadder) DllCall('uxtheme.dll', 'long', 'SetWindowTheme', 'hwnd', $hHeadder, 'wstr', "DarkMode_ItemsView", 'wstr', Null) ; dark ...1 point -
Step by step Tutorial ControlClick with AU3info
rohmanabdur reacted to Kajoe for a topic
Dear forum members, I have made a clear step by step tutorial for ControlClick functions together with AU3info. I had struggled a lot with controlclick function and with help in forum I managed it to understand function ControlClick. Because it was so difficult I made this step by step guide. I made it to help others with problems in ControlClick and AU3info. Have fun with it. I would like to thank Jos especially for his great help. Without him I would never managed it to make script with ControClick. ControlClick Tutorial.pdf1 point -
That is obviously not an accurate representation of your cURL command line -- at least I hope it isn't. It doesn't even have a target API URL. So without an accurate representation (even if you have to redact the URL), how is anyone suppose to know if it is correct. Your initial example is setting the "Accept" header. Why aren't you setting the "Content-Type" header also. The "Content-Type" header, which should be "application/json", says that the request data should be interpreted as JSON. It may not be required, but it is still good practice to define the content type. Your Run(), at least as it is shown, does not require you to prepend @comspec. If you already have valid JSON in a file, then just use cURL's @ syntax to have it read in the file. (see example below) If you need more information about cURL parameters, you can find them in the online cURL documentation. You haven't provided a complete script. So, again, there's no way to know what other issues you may have in your script. The example below, sends a POST request to the postman echo server. The echo server sends back information about your request as it was received by the server (including the request headers) The "temp.json" file that is referenced contains your JSON dataset. As you can see in the echo server's response, the cURL command successfully sent the request. The "data" field shows the POST data that was received. The "JSON" field shows JSON because the Content-Type header was sent so it knew that the data was JSON. Also in the example's command line you will see a "--json" parameter. You can use that parameter if you are using cURL version 7.82.0 or newer. It's a shortcut that does 3 things: passes the json data or file, sets the "Content-Type" header to application/json, and sets the "Accept" header to application/json. You should be able to adapt the example to fit your needs. Example: #include <Constants.au3> Const $CURL_EXE = "c:\utils\curl\curl64.exe" ;Modify path as needed Const $JSON_FILE = "temp.json" ;Modify path as needed Const $API_URL = "https://postman-echo.com/post" ;Modify URL as needed example() Func example() Local $sCmdLine = "" Local $iPid = 0 ;Build command line $sCmdLine = StringFormat('"%s" -s --json @"%s" "%s"', $CURL_EXE, $JSON_FILE, $API_URL) ConsoleWrite("Cmd Line = " & $sCmdLine & @CRLF) ;Execute command line $iPid = Run($sCmdLine, "", @SW_HIDE, $STDERR_MERGED) If Not $iPid Then Exit MsgBox($MB_ICONERROR, "Run Error", "Check to make sure your command line is valid.") ;Wait for the process to close ProcessWaitClose($iPid) ;Display command output ConsoleWrite(@CRLF & "Response:" & @CRLF) ConsoleWrite(StdoutRead($iPid) & @CRLF) EndFunc Console output: Cmd Line = "c:\utils\curl\curl64.exe" -s --json @"temp.json" "https://postman-echo.com/post" Response: { "args": {}, "data": { "documentTypes": [ "=EMAIL=" ], "query": { "type": "AND", "constraints": [ { "type": "FIELD_COMPARISON", "field": "SENT_DATE", "operator": "RANGE", "range": { "min": "2023-03-01T00:00:00", "max": "2023-03-17T23:59:59" } }, { "type": "AND", "constraints": [ { "type": "FIELD_COMPARISON", "customField": "DOC_TYPE", "field": "CUSTOM_SORTABLE_STRING", "value": "=EMAIL=", "operator": "EQUAL_TO" }, { "type": "FIELD_COMPARISON", "customField": "CONTENT-TYPE", "field": "CUSTOM_SORTABLE_STRING", "value": "SM", "operator": "MATCHES" } ] } ] }, "queryOptions": { "source": "LEGACY", "type": "COUNT", "suppressQueryTranslationWarning": true }, "resultColumns": [] }, "files": {}, "form": {}, "headers": { "x-forwarded-proto": "https", "x-forwarded-port": "443", "host": "postman-echo.com", "x-amzn-trace-id": "Root=1-6422223a-2c910a151f0d3bd901a5f748", "content-length": "1170", "user-agent": "curl/8.0.1", "content-type": "application/json", "accept": "application/json" }, "json": { "documentTypes": [ "=EMAIL=" ], "query": { "type": "AND", "constraints": [ { "type": "FIELD_COMPARISON", "field": "SENT_DATE", "operator": "RANGE", "range": { "min": "2023-03-01T00:00:00", "max": "2023-03-17T23:59:59" } }, { "type": "AND", "constraints": [ { "type": "FIELD_COMPARISON", "customField": "DOC_TYPE", "field": "CUSTOM_SORTABLE_STRING", "value": "=EMAIL=", "operator": "EQUAL_TO" }, { "type": "FIELD_COMPARISON", "customField": "CONTENT-TYPE", "field": "CUSTOM_SORTABLE_STRING", "value": "SM", "operator": "MATCHES" } ] } ] }, "queryOptions": { "source": "LEGACY", "type": "COUNT", "suppressQueryTranslationWarning": true }, "resultColumns": [] }, "url": "https://postman-echo.com/post" }1 point
-
So I think it's time to publish this little tutorial I have made on using DllCall() and DllStructs. It's not near completion but I think it's a good start at least This tutorial is mostly aimed for people who have never used DllCall() before or have very limited knowledge about it. In the future I will update it with more advanced topics so more advanced users can make use of it too. Well here goes. Dealing_with_Dll.pdf Previous downloads: 31 Suggestions, language corrections and errors in the tutorial is of course welcome.1 point