├── .github └── workflows │ └── build.yml ├── ACLViewer.au3 ├── LICENSE ├── README.md ├── app.ico ├── checked.ico ├── icons ├── file.ico ├── filesel.ico ├── folder.ico ├── foldersel.ico ├── harddrive.ico ├── harddrivesel.ico └── removable.ico ├── include ├── GUIDarkMode_v0.02mod.au3 ├── GUIFrame.au3 ├── Permissions-Unicode.au3 └── TreeListExplorer.au3 └── unchecked.ico /.github/workflows/build.yml: -------------------------------------------------------------------------------- 1 | name: Build Binaries 2 | run-name: Build version ${{ inputs.version }} 3 | on: 4 | workflow_dispatch: 5 | inputs: 6 | version: 7 | description: The version of the library 8 | required: true 9 | default: 0.1.0 10 | type: string 11 | release: 12 | description: Create a release 13 | required: true 14 | default: false 15 | type: boolean 16 | permissions: 17 | contents: write 18 | actions: write 19 | checks: write 20 | jobs: 21 | build: 22 | runs-on: windows-latest 23 | steps: 24 | - uses: actions/checkout@v4 25 | - name: Cache tools 26 | uses: actions/cache@v4 27 | id: cache 28 | with: 29 | path: | 30 | autoit-v3-setup.exe 31 | SciTE4AutoIt3.exe 32 | C:\Program Files (x86)\AutoIt3\SciTE\Au3Stripper 33 | key: v3 34 | - name: Download tools 35 | if: steps.cache.outputs.cache-hit != 'true' 36 | run: | 37 | curl -sSfL https://www.autoitscript.com/cgi-bin/getfile.pl?autoit3/autoit-v3-setup.exe -o autoit-v3-setup.exe ` 38 | -sSfL https://www.autoitscript.com/cgi-bin/getfile.pl?../autoit3/scite/download/SciTE4AutoIt3.exe -o SciTE4AutoIt3.exe ` 39 | -sSfLO https://www.autoitscript.com/autoit3/scite/download/Au3Stripper.zip 40 | Expand-Archive Au3Stripper.zip "${env:ProgramFiles(x86)}\AutoIt3\SciTE\Au3Stripper" 41 | - name: Install tools 42 | run: | 43 | Start-Process autoit-v3-setup.exe -ArgumentList /S -NoNewWindow -Wait 44 | Start-Process SciTE4AutoIt3.exe -ArgumentList /S -NoNewWindow -Wait 45 | - name: Compile 46 | run: | 47 | Start-Process "${env:ProgramFiles(x86)}\AutoIt3\AutoIt3.exe" "`"${env:ProgramFiles(x86)}\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.au3`" /NoStatus /prod /in ACLViewer.au3" -NoNewWindow -Wait 48 | - uses: actions/upload-artifact@v4 49 | with: 50 | name: executable-files 51 | path: | 52 | ACLViewer*.exe 53 | if-no-files-found: error 54 | - name: Zip package 55 | run: 7z a ACLViewer.zip ACLViewer*.exe 56 | - name: Rename archive with tag 57 | shell: pwsh 58 | run: | 59 | Copy-Item ACLViewer.zip -Destination ACLViewer-${{ inputs.version }}.zip 60 | - name: Create release 61 | uses: softprops/action-gh-release@v2 62 | if: ${{ inputs.release }} 63 | with: 64 | draft: true 65 | name: ACLViewer ${{ inputs.version }} 66 | tag_name: ${{ inputs.version }} 67 | files: | 68 | ACLViewer-${{ inputs.version }}.zip 69 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | Preamble 9 | 10 | The GNU General Public License is a free, copyleft license for 11 | software and other kinds of works. 12 | 13 | The licenses for most software and other practical works are designed 14 | to take away your freedom to share and change the works. By contrast, 15 | the GNU General Public License is intended to guarantee your freedom to 16 | share and change all versions of a program--to make sure it remains free 17 | software for all its users. We, the Free Software Foundation, use the 18 | GNU General Public License for most of our software; it applies also to 19 | any other work released this way by its authors. You can apply it to 20 | your programs, too. 21 | 22 | When we speak of free software, we are referring to freedom, not 23 | price. Our General Public Licenses are designed to make sure that you 24 | have the freedom to distribute copies of free software (and charge for 25 | them if you wish), that you receive source code or can get it if you 26 | want it, that you can change the software or use pieces of it in new 27 | free programs, and that you know you can do these things. 28 | 29 | To protect your rights, we need to prevent others from denying you 30 | these rights or asking you to surrender the rights. Therefore, you have 31 | certain responsibilities if you distribute copies of the software, or if 32 | you modify it: responsibilities to respect the freedom of others. 33 | 34 | For example, if you distribute copies of such a program, whether 35 | gratis or for a fee, you must pass on to the recipients the same 36 | freedoms that you received. You must make sure that they, too, receive 37 | or can get the source code. And you must show them these terms so they 38 | know their rights. 39 | 40 | Developers that use the GNU GPL protect your rights with two steps: 41 | (1) assert copyright on the software, and (2) offer you this License 42 | giving you legal permission to copy, distribute and/or modify it. 43 | 44 | For the developers' and authors' protection, the GPL clearly explains 45 | that there is no warranty for this free software. For both users' and 46 | authors' sake, the GPL requires that modified versions be marked as 47 | changed, so that their problems will not be attributed erroneously to 48 | authors of previous versions. 49 | 50 | Some devices are designed to deny users access to install or run 51 | modified versions of the software inside them, although the manufacturer 52 | can do so. This is fundamentally incompatible with the aim of 53 | protecting users' freedom to change the software. The systematic 54 | pattern of such abuse occurs in the area of products for individuals to 55 | use, which is precisely where it is most unacceptable. Therefore, we 56 | have designed this version of the GPL to prohibit the practice for those 57 | products. If such problems arise substantially in other domains, we 58 | stand ready to extend this provision to those domains in future versions 59 | of the GPL, as needed to protect the freedom of users. 60 | 61 | Finally, every program is threatened constantly by software patents. 62 | States should not allow patents to restrict development and use of 63 | software on general-purpose computers, but in those that do, we wish to 64 | avoid the special danger that patents applied to a free program could 65 | make it effectively proprietary. To prevent this, the GPL assures that 66 | patents cannot be used to render the program non-free. 67 | 68 | The precise terms and conditions for copying, distribution and 69 | modification follow. 70 | 71 | TERMS AND CONDITIONS 72 | 73 | 0. Definitions. 74 | 75 | "This License" refers to version 3 of the GNU General Public License. 76 | 77 | "Copyright" also means copyright-like laws that apply to other kinds of 78 | works, such as semiconductor masks. 79 | 80 | "The Program" refers to any copyrightable work licensed under this 81 | License. Each licensee is addressed as "you". "Licensees" and 82 | "recipients" may be individuals or organizations. 83 | 84 | To "modify" a work means to copy from or adapt all or part of the work 85 | in a fashion requiring copyright permission, other than the making of an 86 | exact copy. The resulting work is called a "modified version" of the 87 | earlier work or a work "based on" the earlier work. 88 | 89 | A "covered work" means either the unmodified Program or a work based 90 | on the Program. 91 | 92 | To "propagate" a work means to do anything with it that, without 93 | permission, would make you directly or secondarily liable for 94 | infringement under applicable copyright law, except executing it on a 95 | computer or modifying a private copy. Propagation includes copying, 96 | distribution (with or without modification), making available to the 97 | public, and in some countries other activities as well. 98 | 99 | To "convey" a work means any kind of propagation that enables other 100 | parties to make or receive copies. Mere interaction with a user through 101 | a computer network, with no transfer of a copy, is not conveying. 102 | 103 | An interactive user interface displays "Appropriate Legal Notices" 104 | to the extent that it includes a convenient and prominently visible 105 | feature that (1) displays an appropriate copyright notice, and (2) 106 | tells the user that there is no warranty for the work (except to the 107 | extent that warranties are provided), that licensees may convey the 108 | work under this License, and how to view a copy of this License. If 109 | the interface presents a list of user commands or options, such as a 110 | menu, a prominent item in the list meets this criterion. 111 | 112 | 1. Source Code. 113 | 114 | The "source code" for a work means the preferred form of the work 115 | for making modifications to it. "Object code" means any non-source 116 | form of a work. 117 | 118 | A "Standard Interface" means an interface that either is an official 119 | standard defined by a recognized standards body, or, in the case of 120 | interfaces specified for a particular programming language, one that 121 | is widely used among developers working in that language. 122 | 123 | The "System Libraries" of an executable work include anything, other 124 | than the work as a whole, that (a) is included in the normal form of 125 | packaging a Major Component, but which is not part of that Major 126 | Component, and (b) serves only to enable use of the work with that 127 | Major Component, or to implement a Standard Interface for which an 128 | implementation is available to the public in source code form. A 129 | "Major Component", in this context, means a major essential component 130 | (kernel, window system, and so on) of the specific operating system 131 | (if any) on which the executable work runs, or a compiler used to 132 | produce the work, or an object code interpreter used to run it. 133 | 134 | The "Corresponding Source" for a work in object code form means all 135 | the source code needed to generate, install, and (for an executable 136 | work) run the object code and to modify the work, including scripts to 137 | control those activities. However, it does not include the work's 138 | System Libraries, or general-purpose tools or generally available free 139 | programs which are used unmodified in performing those activities but 140 | which are not part of the work. For example, Corresponding Source 141 | includes interface definition files associated with source files for 142 | the work, and the source code for shared libraries and dynamically 143 | linked subprograms that the work is specifically designed to require, 144 | such as by intimate data communication or control flow between those 145 | subprograms and other parts of the work. 146 | 147 | The Corresponding Source need not include anything that users 148 | can regenerate automatically from other parts of the Corresponding 149 | Source. 150 | 151 | The Corresponding Source for a work in source code form is that 152 | same work. 153 | 154 | 2. Basic Permissions. 155 | 156 | All rights granted under this License are granted for the term of 157 | copyright on the Program, and are irrevocable provided the stated 158 | conditions are met. This License explicitly affirms your unlimited 159 | permission to run the unmodified Program. The output from running a 160 | covered work is covered by this License only if the output, given its 161 | content, constitutes a covered work. This License acknowledges your 162 | rights of fair use or other equivalent, as provided by copyright law. 163 | 164 | You may make, run and propagate covered works that you do not 165 | convey, without conditions so long as your license otherwise remains 166 | in force. You may convey covered works to others for the sole purpose 167 | of having them make modifications exclusively for you, or provide you 168 | with facilities for running those works, provided that you comply with 169 | the terms of this License in conveying all material for which you do 170 | not control copyright. Those thus making or running the covered works 171 | for you must do so exclusively on your behalf, under your direction 172 | and control, on terms that prohibit them from making any copies of 173 | your copyrighted material outside their relationship with you. 174 | 175 | Conveying under any other circumstances is permitted solely under 176 | the conditions stated below. Sublicensing is not allowed; section 10 177 | makes it unnecessary. 178 | 179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 180 | 181 | No covered work shall be deemed part of an effective technological 182 | measure under any applicable law fulfilling obligations under article 183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 184 | similar laws prohibiting or restricting circumvention of such 185 | measures. 186 | 187 | When you convey a covered work, you waive any legal power to forbid 188 | circumvention of technological measures to the extent such circumvention 189 | is effected by exercising rights under this License with respect to 190 | the covered work, and you disclaim any intention to limit operation or 191 | modification of the work as a means of enforcing, against the work's 192 | users, your or third parties' legal rights to forbid circumvention of 193 | technological measures. 194 | 195 | 4. Conveying Verbatim Copies. 196 | 197 | You may convey verbatim copies of the Program's source code as you 198 | receive it, in any medium, provided that you conspicuously and 199 | appropriately publish on each copy an appropriate copyright notice; 200 | keep intact all notices stating that this License and any 201 | non-permissive terms added in accord with section 7 apply to the code; 202 | keep intact all notices of the absence of any warranty; and give all 203 | recipients a copy of this License along with the Program. 204 | 205 | You may charge any price or no price for each copy that you convey, 206 | and you may offer support or warranty protection for a fee. 207 | 208 | 5. Conveying Modified Source Versions. 209 | 210 | You may convey a work based on the Program, or the modifications to 211 | produce it from the Program, in the form of source code under the 212 | terms of section 4, provided that you also meet all of these conditions: 213 | 214 | a) The work must carry prominent notices stating that you modified 215 | it, and giving a relevant date. 216 | 217 | b) The work must carry prominent notices stating that it is 218 | released under this License and any conditions added under section 219 | 7. This requirement modifies the requirement in section 4 to 220 | "keep intact all notices". 221 | 222 | c) You must license the entire work, as a whole, under this 223 | License to anyone who comes into possession of a copy. This 224 | License will therefore apply, along with any applicable section 7 225 | additional terms, to the whole of the work, and all its parts, 226 | regardless of how they are packaged. This License gives no 227 | permission to license the work in any other way, but it does not 228 | invalidate such permission if you have separately received it. 229 | 230 | d) If the work has interactive user interfaces, each must display 231 | Appropriate Legal Notices; however, if the Program has interactive 232 | interfaces that do not display Appropriate Legal Notices, your 233 | work need not make them do so. 234 | 235 | A compilation of a covered work with other separate and independent 236 | works, which are not by their nature extensions of the covered work, 237 | and which are not combined with it such as to form a larger program, 238 | in or on a volume of a storage or distribution medium, is called an 239 | "aggregate" if the compilation and its resulting copyright are not 240 | used to limit the access or legal rights of the compilation's users 241 | beyond what the individual works permit. Inclusion of a covered work 242 | in an aggregate does not cause this License to apply to the other 243 | parts of the aggregate. 244 | 245 | 6. Conveying Non-Source Forms. 246 | 247 | You may convey a covered work in object code form under the terms 248 | of sections 4 and 5, provided that you also convey the 249 | machine-readable Corresponding Source under the terms of this License, 250 | in one of these ways: 251 | 252 | a) Convey the object code in, or embodied in, a physical product 253 | (including a physical distribution medium), accompanied by the 254 | Corresponding Source fixed on a durable physical medium 255 | customarily used for software interchange. 256 | 257 | b) Convey the object code in, or embodied in, a physical product 258 | (including a physical distribution medium), accompanied by a 259 | written offer, valid for at least three years and valid for as 260 | long as you offer spare parts or customer support for that product 261 | model, to give anyone who possesses the object code either (1) a 262 | copy of the Corresponding Source for all the software in the 263 | product that is covered by this License, on a durable physical 264 | medium customarily used for software interchange, for a price no 265 | more than your reasonable cost of physically performing this 266 | conveying of source, or (2) access to copy the 267 | Corresponding Source from a network server at no charge. 268 | 269 | c) Convey individual copies of the object code with a copy of the 270 | written offer to provide the Corresponding Source. This 271 | alternative is allowed only occasionally and noncommercially, and 272 | only if you received the object code with such an offer, in accord 273 | with subsection 6b. 274 | 275 | d) Convey the object code by offering access from a designated 276 | place (gratis or for a charge), and offer equivalent access to the 277 | Corresponding Source in the same way through the same place at no 278 | further charge. You need not require recipients to copy the 279 | Corresponding Source along with the object code. If the place to 280 | copy the object code is a network server, the Corresponding Source 281 | may be on a different server (operated by you or a third party) 282 | that supports equivalent copying facilities, provided you maintain 283 | clear directions next to the object code saying where to find the 284 | Corresponding Source. Regardless of what server hosts the 285 | Corresponding Source, you remain obligated to ensure that it is 286 | available for as long as needed to satisfy these requirements. 287 | 288 | e) Convey the object code using peer-to-peer transmission, provided 289 | you inform other peers where the object code and Corresponding 290 | Source of the work are being offered to the general public at no 291 | charge under subsection 6d. 292 | 293 | A separable portion of the object code, whose source code is excluded 294 | from the Corresponding Source as a System Library, need not be 295 | included in conveying the object code work. 296 | 297 | A "User Product" is either (1) a "consumer product", which means any 298 | tangible personal property which is normally used for personal, family, 299 | or household purposes, or (2) anything designed or sold for incorporation 300 | into a dwelling. In determining whether a product is a consumer product, 301 | doubtful cases shall be resolved in favor of coverage. For a particular 302 | product received by a particular user, "normally used" refers to a 303 | typical or common use of that class of product, regardless of the status 304 | of the particular user or of the way in which the particular user 305 | actually uses, or expects or is expected to use, the product. A product 306 | is a consumer product regardless of whether the product has substantial 307 | commercial, industrial or non-consumer uses, unless such uses represent 308 | the only significant mode of use of the product. 309 | 310 | "Installation Information" for a User Product means any methods, 311 | procedures, authorization keys, or other information required to install 312 | and execute modified versions of a covered work in that User Product from 313 | a modified version of its Corresponding Source. The information must 314 | suffice to ensure that the continued functioning of the modified object 315 | code is in no case prevented or interfered with solely because 316 | modification has been made. 317 | 318 | If you convey an object code work under this section in, or with, or 319 | specifically for use in, a User Product, and the conveying occurs as 320 | part of a transaction in which the right of possession and use of the 321 | User Product is transferred to the recipient in perpetuity or for a 322 | fixed term (regardless of how the transaction is characterized), the 323 | Corresponding Source conveyed under this section must be accompanied 324 | by the Installation Information. But this requirement does not apply 325 | if neither you nor any third party retains the ability to install 326 | modified object code on the User Product (for example, the work has 327 | been installed in ROM). 328 | 329 | The requirement to provide Installation Information does not include a 330 | requirement to continue to provide support service, warranty, or updates 331 | for a work that has been modified or installed by the recipient, or for 332 | the User Product in which it has been modified or installed. Access to a 333 | network may be denied when the modification itself materially and 334 | adversely affects the operation of the network or violates the rules and 335 | protocols for communication across the network. 336 | 337 | Corresponding Source conveyed, and Installation Information provided, 338 | in accord with this section must be in a format that is publicly 339 | documented (and with an implementation available to the public in 340 | source code form), and must require no special password or key for 341 | unpacking, reading or copying. 342 | 343 | 7. Additional Terms. 344 | 345 | "Additional permissions" are terms that supplement the terms of this 346 | License by making exceptions from one or more of its conditions. 347 | Additional permissions that are applicable to the entire Program shall 348 | be treated as though they were included in this License, to the extent 349 | that they are valid under applicable law. If additional permissions 350 | apply only to part of the Program, that part may be used separately 351 | under those permissions, but the entire Program remains governed by 352 | this License without regard to the additional permissions. 353 | 354 | When you convey a copy of a covered work, you may at your option 355 | remove any additional permissions from that copy, or from any part of 356 | it. (Additional permissions may be written to require their own 357 | removal in certain cases when you modify the work.) You may place 358 | additional permissions on material, added by you to a covered work, 359 | for which you have or can give appropriate copyright permission. 360 | 361 | Notwithstanding any other provision of this License, for material you 362 | add to a covered work, you may (if authorized by the copyright holders of 363 | that material) supplement the terms of this License with terms: 364 | 365 | a) Disclaiming warranty or limiting liability differently from the 366 | terms of sections 15 and 16 of this License; or 367 | 368 | b) Requiring preservation of specified reasonable legal notices or 369 | author attributions in that material or in the Appropriate Legal 370 | Notices displayed by works containing it; or 371 | 372 | c) Prohibiting misrepresentation of the origin of that material, or 373 | requiring that modified versions of such material be marked in 374 | reasonable ways as different from the original version; or 375 | 376 | d) Limiting the use for publicity purposes of names of licensors or 377 | authors of the material; or 378 | 379 | e) Declining to grant rights under trademark law for use of some 380 | trade names, trademarks, or service marks; or 381 | 382 | f) Requiring indemnification of licensors and authors of that 383 | material by anyone who conveys the material (or modified versions of 384 | it) with contractual assumptions of liability to the recipient, for 385 | any liability that these contractual assumptions directly impose on 386 | those licensors and authors. 387 | 388 | All other non-permissive additional terms are considered "further 389 | restrictions" within the meaning of section 10. If the Program as you 390 | received it, or any part of it, contains a notice stating that it is 391 | governed by this License along with a term that is a further 392 | restriction, you may remove that term. If a license document contains 393 | a further restriction but permits relicensing or conveying under this 394 | License, you may add to a covered work material governed by the terms 395 | of that license document, provided that the further restriction does 396 | not survive such relicensing or conveying. 397 | 398 | If you add terms to a covered work in accord with this section, you 399 | must place, in the relevant source files, a statement of the 400 | additional terms that apply to those files, or a notice indicating 401 | where to find the applicable terms. 402 | 403 | Additional terms, permissive or non-permissive, may be stated in the 404 | form of a separately written license, or stated as exceptions; 405 | the above requirements apply either way. 406 | 407 | 8. Termination. 408 | 409 | You may not propagate or modify a covered work except as expressly 410 | provided under this License. Any attempt otherwise to propagate or 411 | modify it is void, and will automatically terminate your rights under 412 | this License (including any patent licenses granted under the third 413 | paragraph of section 11). 414 | 415 | However, if you cease all violation of this License, then your 416 | license from a particular copyright holder is reinstated (a) 417 | provisionally, unless and until the copyright holder explicitly and 418 | finally terminates your license, and (b) permanently, if the copyright 419 | holder fails to notify you of the violation by some reasonable means 420 | prior to 60 days after the cessation. 421 | 422 | Moreover, your license from a particular copyright holder is 423 | reinstated permanently if the copyright holder notifies you of the 424 | violation by some reasonable means, this is the first time you have 425 | received notice of violation of this License (for any work) from that 426 | copyright holder, and you cure the violation prior to 30 days after 427 | your receipt of the notice. 428 | 429 | Termination of your rights under this section does not terminate the 430 | licenses of parties who have received copies or rights from you under 431 | this License. If your rights have been terminated and not permanently 432 | reinstated, you do not qualify to receive new licenses for the same 433 | material under section 10. 434 | 435 | 9. Acceptance Not Required for Having Copies. 436 | 437 | You are not required to accept this License in order to receive or 438 | run a copy of the Program. Ancillary propagation of a covered work 439 | occurring solely as a consequence of using peer-to-peer transmission 440 | to receive a copy likewise does not require acceptance. However, 441 | nothing other than this License grants you permission to propagate or 442 | modify any covered work. These actions infringe copyright if you do 443 | not accept this License. Therefore, by modifying or propagating a 444 | covered work, you indicate your acceptance of this License to do so. 445 | 446 | 10. Automatic Licensing of Downstream Recipients. 447 | 448 | Each time you convey a covered work, the recipient automatically 449 | receives a license from the original licensors, to run, modify and 450 | propagate that work, subject to this License. You are not responsible 451 | for enforcing compliance by third parties with this License. 452 | 453 | An "entity transaction" is a transaction transferring control of an 454 | organization, or substantially all assets of one, or subdividing an 455 | organization, or merging organizations. If propagation of a covered 456 | work results from an entity transaction, each party to that 457 | transaction who receives a copy of the work also receives whatever 458 | licenses to the work the party's predecessor in interest had or could 459 | give under the previous paragraph, plus a right to possession of the 460 | Corresponding Source of the work from the predecessor in interest, if 461 | the predecessor has it or can get it with reasonable efforts. 462 | 463 | You may not impose any further restrictions on the exercise of the 464 | rights granted or affirmed under this License. For example, you may 465 | not impose a license fee, royalty, or other charge for exercise of 466 | rights granted under this License, and you may not initiate litigation 467 | (including a cross-claim or counterclaim in a lawsuit) alleging that 468 | any patent claim is infringed by making, using, selling, offering for 469 | sale, or importing the Program or any portion of it. 470 | 471 | 11. Patents. 472 | 473 | A "contributor" is a copyright holder who authorizes use under this 474 | License of the Program or a work on which the Program is based. The 475 | work thus licensed is called the contributor's "contributor version". 476 | 477 | A contributor's "essential patent claims" are all patent claims 478 | owned or controlled by the contributor, whether already acquired or 479 | hereafter acquired, that would be infringed by some manner, permitted 480 | by this License, of making, using, or selling its contributor version, 481 | but do not include claims that would be infringed only as a 482 | consequence of further modification of the contributor version. For 483 | purposes of this definition, "control" includes the right to grant 484 | patent sublicenses in a manner consistent with the requirements of 485 | this License. 486 | 487 | Each contributor grants you a non-exclusive, worldwide, royalty-free 488 | patent license under the contributor's essential patent claims, to 489 | make, use, sell, offer for sale, import and otherwise run, modify and 490 | propagate the contents of its contributor version. 491 | 492 | In the following three paragraphs, a "patent license" is any express 493 | agreement or commitment, however denominated, not to enforce a patent 494 | (such as an express permission to practice a patent or covenant not to 495 | sue for patent infringement). To "grant" such a patent license to a 496 | party means to make such an agreement or commitment not to enforce a 497 | patent against the party. 498 | 499 | If you convey a covered work, knowingly relying on a patent license, 500 | and the Corresponding Source of the work is not available for anyone 501 | to copy, free of charge and under the terms of this License, through a 502 | publicly available network server or other readily accessible means, 503 | then you must either (1) cause the Corresponding Source to be so 504 | available, or (2) arrange to deprive yourself of the benefit of the 505 | patent license for this particular work, or (3) arrange, in a manner 506 | consistent with the requirements of this License, to extend the patent 507 | license to downstream recipients. "Knowingly relying" means you have 508 | actual knowledge that, but for the patent license, your conveying the 509 | covered work in a country, or your recipient's use of the covered work 510 | in a country, would infringe one or more identifiable patents in that 511 | country that you have reason to believe are valid. 512 | 513 | If, pursuant to or in connection with a single transaction or 514 | arrangement, you convey, or propagate by procuring conveyance of, a 515 | covered work, and grant a patent license to some of the parties 516 | receiving the covered work authorizing them to use, propagate, modify 517 | or convey a specific copy of the covered work, then the patent license 518 | you grant is automatically extended to all recipients of the covered 519 | work and works based on it. 520 | 521 | A patent license is "discriminatory" if it does not include within 522 | the scope of its coverage, prohibits the exercise of, or is 523 | conditioned on the non-exercise of one or more of the rights that are 524 | specifically granted under this License. You may not convey a covered 525 | work if you are a party to an arrangement with a third party that is 526 | in the business of distributing software, under which you make payment 527 | to the third party based on the extent of your activity of conveying 528 | the work, and under which the third party grants, to any of the 529 | parties who would receive the covered work from you, a discriminatory 530 | patent license (a) in connection with copies of the covered work 531 | conveyed by you (or copies made from those copies), or (b) primarily 532 | for and in connection with specific products or compilations that 533 | contain the covered work, unless you entered into that arrangement, 534 | or that patent license was granted, prior to 28 March 2007. 535 | 536 | Nothing in this License shall be construed as excluding or limiting 537 | any implied license or other defenses to infringement that may 538 | otherwise be available to you under applicable patent law. 539 | 540 | 12. No Surrender of Others' Freedom. 541 | 542 | If conditions are imposed on you (whether by court order, agreement or 543 | otherwise) that contradict the conditions of this License, they do not 544 | excuse you from the conditions of this License. If you cannot convey a 545 | covered work so as to satisfy simultaneously your obligations under this 546 | License and any other pertinent obligations, then as a consequence you may 547 | not convey it at all. For example, if you agree to terms that obligate you 548 | to collect a royalty for further conveying from those to whom you convey 549 | the Program, the only way you could satisfy both those terms and this 550 | License would be to refrain entirely from conveying the Program. 551 | 552 | 13. Use with the GNU Affero General Public License. 553 | 554 | Notwithstanding any other provision of this License, you have 555 | permission to link or combine any covered work with a work licensed 556 | under version 3 of the GNU Affero General Public License into a single 557 | combined work, and to convey the resulting work. The terms of this 558 | License will continue to apply to the part which is the covered work, 559 | but the special requirements of the GNU Affero General Public License, 560 | section 13, concerning interaction through a network will apply to the 561 | combination as such. 562 | 563 | 14. Revised Versions of this License. 564 | 565 | The Free Software Foundation may publish revised and/or new versions of 566 | the GNU General Public License from time to time. Such new versions will 567 | be similar in spirit to the present version, but may differ in detail to 568 | address new problems or concerns. 569 | 570 | Each version is given a distinguishing version number. If the 571 | Program specifies that a certain numbered version of the GNU General 572 | Public License "or any later version" applies to it, you have the 573 | option of following the terms and conditions either of that numbered 574 | version or of any later version published by the Free Software 575 | Foundation. If the Program does not specify a version number of the 576 | GNU General Public License, you may choose any version ever published 577 | by the Free Software Foundation. 578 | 579 | If the Program specifies that a proxy can decide which future 580 | versions of the GNU General Public License can be used, that proxy's 581 | public statement of acceptance of a version permanently authorizes you 582 | to choose that version for the Program. 583 | 584 | Later license versions may give you additional or different 585 | permissions. However, no additional obligations are imposed on any 586 | author or copyright holder as a result of your choosing to follow a 587 | later version. 588 | 589 | 15. Disclaimer of Warranty. 590 | 591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 599 | 600 | 16. Limitation of Liability. 601 | 602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 610 | SUCH DAMAGES. 611 | 612 | 17. Interpretation of Sections 15 and 16. 613 | 614 | If the disclaimer of warranty and limitation of liability provided 615 | above cannot be given local legal effect according to their terms, 616 | reviewing courts shall apply local law that most closely approximates 617 | an absolute waiver of all civil liability in connection with the 618 | Program, unless a warranty or assumption of liability accompanies a 619 | copy of the Program in return for a fee. 620 | 621 | END OF TERMS AND CONDITIONS 622 | 623 | How to Apply These Terms to Your New Programs 624 | 625 | If you develop a new program, and you want it to be of the greatest 626 | possible use to the public, the best way to achieve this is to make it 627 | free software which everyone can redistribute and change under these terms. 628 | 629 | To do so, attach the following notices to the program. It is safest 630 | to attach them to the start of each source file to most effectively 631 | state the exclusion of warranty; and each file should have at least 632 | the "copyright" line and a pointer to where the full notice is found. 633 | 634 | 635 | Copyright (C) 636 | 637 | This program is free software: you can redistribute it and/or modify 638 | it under the terms of the GNU General Public License as published by 639 | the Free Software Foundation, either version 3 of the License, or 640 | (at your option) any later version. 641 | 642 | This program is distributed in the hope that it will be useful, 643 | but WITHOUT ANY WARRANTY; without even the implied warranty of 644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 645 | GNU General Public License for more details. 646 | 647 | You should have received a copy of the GNU General Public License 648 | along with this program. If not, see . 649 | 650 | Also add information on how to contact you by electronic and paper mail. 651 | 652 | If the program does terminal interaction, make it output a short 653 | notice like this when it starts in an interactive mode: 654 | 655 | Copyright (C) 656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 657 | This is free software, and you are welcome to redistribute it 658 | under certain conditions; type `show c' for details. 659 | 660 | The hypothetical commands `show w' and `show c' should show the appropriate 661 | parts of the General Public License. Of course, your program's commands 662 | might be different; for a GUI interface, you would use an "about box". 663 | 664 | You should also get your employer (if you work as a programmer) or school, 665 | if any, to sign a "copyright disclaimer" for the program, if necessary. 666 | For more information on this, and how to apply and follow the GNU GPL, see 667 | . 668 | 669 | The GNU General Public License does not permit incorporating your program 670 | into proprietary programs. If your program is a subroutine library, you 671 | may consider it more useful to permit linking proprietary applications with 672 | the library. If this is what you want to do, use the GNU Lesser General 673 | Public License instead of this License. But first, please read 674 | . 675 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # ACLViewer 2 | ACL Viewer for Windows 3 | 4 | - Automatic dark mode / light mode depending on system theme 5 | - Fast ACL/SDDL/ACCESS_MASK parsing 6 | - Displays ACLs for directories and files 7 | 8 | # Hotkeys 9 | 10 | - F5 to refresh the treeview 11 | 12 | # To Do 13 | 14 | - ~~Add an Export option to export the ACL ListView as .txt or .csv~~ Done 15 | - ~~Add an Export option to export selected ACE with permissions (and individual permission access masks)~~ Done 16 | - Add a Hotkey to toggle hiding/unhiding Inherited ACEs 17 | - Consider changing the labels to edit boxes to easily copy details from 18 | 19 | # Screenshots 20 | 21 | ![ACLViewer-2 0](https://github.com/user-attachments/assets/aca2eac0-a9a9-4569-821f-789049a2ddd8) 22 | 23 | ![ACLViewer-2 0-verbose](https://github.com/user-attachments/assets/02c0245a-9a1c-4883-bc15-84ffab645754) 24 | 25 | -------------------------------------------------------------------------------- /app.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WildByDesign/ACLViewer/dc578125ef34c2d6895adbc2129bab0ab55e86f3/app.ico -------------------------------------------------------------------------------- /checked.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WildByDesign/ACLViewer/dc578125ef34c2d6895adbc2129bab0ab55e86f3/checked.ico -------------------------------------------------------------------------------- /icons/file.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WildByDesign/ACLViewer/dc578125ef34c2d6895adbc2129bab0ab55e86f3/icons/file.ico -------------------------------------------------------------------------------- /icons/filesel.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WildByDesign/ACLViewer/dc578125ef34c2d6895adbc2129bab0ab55e86f3/icons/filesel.ico -------------------------------------------------------------------------------- /icons/folder.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WildByDesign/ACLViewer/dc578125ef34c2d6895adbc2129bab0ab55e86f3/icons/folder.ico -------------------------------------------------------------------------------- /icons/foldersel.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WildByDesign/ACLViewer/dc578125ef34c2d6895adbc2129bab0ab55e86f3/icons/foldersel.ico -------------------------------------------------------------------------------- /icons/harddrive.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WildByDesign/ACLViewer/dc578125ef34c2d6895adbc2129bab0ab55e86f3/icons/harddrive.ico -------------------------------------------------------------------------------- /icons/harddrivesel.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WildByDesign/ACLViewer/dc578125ef34c2d6895adbc2129bab0ab55e86f3/icons/harddrivesel.ico -------------------------------------------------------------------------------- /icons/removable.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WildByDesign/ACLViewer/dc578125ef34c2d6895adbc2129bab0ab55e86f3/icons/removable.ico -------------------------------------------------------------------------------- /include/GUIDarkMode_v0.02mod.au3: -------------------------------------------------------------------------------- 1 | #include-once ; #include 2 | 3 | #include 4 | #include 5 | 6 | Global $isDarkMode = _WinAPI_ShouldAppsUseDarkMode() 7 | 8 | #Region ; APIThemeConstantsEx.au3 9 | ;~ #include "APIThemeConstantsEx.au3" 10 | ; _WinAPI_GetIsImmersiveColorUsingHighContrast($IMMERSIVE_HC_CACHE_MODE) 11 | Global Const $IHCM_USE_CACHED_VALUE = 0 12 | Global Const $IIHCM_REFRESH = 1 13 | ; _WinAPI_SetPreferredAppMode($PREFERREDAPPMODE) 14 | Global Const $APPMODE_DEFAULT = 0 15 | Global Const $APPMODE_ALLOWDARK = 1 16 | Global Const $APPMODE_FORCEDARK = 2 17 | Global Const $APPMODE_FORCELIGHT = 3 18 | Global Const $APPMODE_MAX = 4 19 | #EndRegion ; APIThemeConstantsEx.au3 20 | 21 | #Region ; WinAPIThemeEx.au3 22 | ;~ #include "WinAPIThemeEx.au3" 23 | 24 | 25 | ; #CURRENT# ===================================================================================================================== 26 | ; _WinAPI_ShouldAppsUseDarkMode 27 | ; _WinAPI_AllowDarkModeForWindow 28 | ; _WinAPI_AllowDarkModeForApp 29 | ; _WinAPI_FlushMenuThemes 30 | ; _WinAPI_RefreshImmersiveColorPolicyState 31 | ; _WinAPI_IsDarkModeAllowedForWindow 32 | ; _WinAPI_GetIsImmersiveColorUsingHighContrast 33 | ; _WinAPI_OpenNcThemeData 34 | ; =============================================================================================================================== 35 | 36 | ; #FUNCTION# ==================================================================================================================== 37 | ; Name ..........: _WinAPI_ShouldAppsUseDarkMode 38 | ; Description ...: Checks if apps should use the dark mode. 39 | ; Syntax ........: _WinAPI_ShouldAppsUseDarkMode() 40 | ; Parameters ....: None 41 | ; Return values .: Success: Returns True if apps should use dark mode. 42 | ; Failure: Returns False and sets @error: 43 | ; -1: Operating system version is earlier than Windows 10 (version 1809, build 17763). 44 | ; Other values: DllCall error, check @error @extended for more information. 45 | ; Author ........: NoNameCode 46 | ; Modified ......: 47 | ; Remarks .......: Requires Windows 10 (version 1809, build 17763) or later. 48 | ; Related .......: 49 | ; Link ..........: http://www.opengate.at/blog/2021/08/dark-mode-win32/ 50 | ; Example .......: No 51 | ; =============================================================================================================================== 52 | Func _WinAPI_ShouldAppsUseDarkMode() 53 | If @OSBuild < 17763 Then Return SetError(-1, 0, False) 54 | Local $fnShouldAppsUseDarkMode = 132 55 | Local $aResult = DllCall('uxtheme.dll', 'bool', $fnShouldAppsUseDarkMode) 56 | If @error Then Return SetError(@error, @extended, False) 57 | Return $aResult[0] 58 | EndFunc ;==>_WinAPI_ShouldAppsUseDarkMode 59 | 60 | ; #FUNCTION# ==================================================================================================================== 61 | ; Name ..........: _WinAPI_AllowDarkModeForWindow 62 | ; Description ...: Allows or disallows dark mode for a specific window handle. 63 | ; Syntax ........: _WinAPI_AllowDarkModeForWindow($hWnd, $bAllow = True) 64 | ; Parameters ....: $hWnd - Handle to the window. 65 | ; $bAllow - [optional] If True, allows dark mode; if False, disallows dark mode. Default is True. 66 | ; Return values .: Success: Returns True if the operation succeeded. 67 | ; Failure: Returns False and sets @error: 68 | ; -1: Operating system version is earlier than Windows 10 (version 1809, build 17763). 69 | ; Other values: DllCall error, check @error @extended for more information. 70 | ; Author ........: NoNameCode 71 | ; Modified ......: 72 | ; Remarks .......: Requires Windows 10 (version 1809, build 17763) or later. 73 | ; Related .......: 74 | ; Link ..........: http://www.opengate.at/blog/2021/08/dark-mode-win32/ 75 | ; Example .......: No 76 | ; =============================================================================================================================== 77 | Func _WinAPI_AllowDarkModeForWindow($hWnd, $bAllow = True) 78 | If @OSBuild < 17763 Then Return SetError(-1, 0, False) 79 | Local $fnAllowDarkModeForWindow = 133 80 | Local $aResult = DllCall('uxtheme.dll', 'bool', $fnAllowDarkModeForWindow, 'hwnd', $hWnd, 'bool', $bAllow) 81 | If @error Then Return SetError(@error, @extended, False) 82 | Return $aResult[0] 83 | EndFunc ;==>_WinAPI_AllowDarkModeForWindow 84 | 85 | ; #FUNCTION# ==================================================================================================================== 86 | ; Name ..........: _WinAPI_AllowDarkModeForApp 87 | ; Description ...: Allows or disallows dark mode for the entire application. 88 | ; Syntax ........: _WinAPI_AllowDarkModeForApp($bAllow = True) 89 | ; Parameters ....: $bAllow - [optional] If True, allows dark mode for the application; if False, disallows dark mode. Default is True. 90 | ; Return values .: Success: Returns True if the operation succeeded. 91 | ; Failure: Returns False and sets @error: 92 | ; -1: Operating system version is earlier than Windows 10 (version 1809, build 17763). 93 | ; -2: Operating system version is later than or equal to Windows 10 (version 1903, build 18362). (Use _WinAPI_SetPreferredAppMode instat!) 94 | ; Other values: DllCall error, check @error @extended for more information. 95 | ; Author ........: NoNameCode 96 | ; Modified ......: 97 | ; Remarks .......: Requires Windows 10 (version 1809, build 17763) and earlier than Windows 10 (version 1903, build 18362). 98 | ; Related .......: _WinAPI_SetPreferredAppMode 99 | ; Link ..........: http://www.opengate.at/blog/2021/08/dark-mode-win32/ 100 | ; Example .......: No 101 | ; =============================================================================================================================== 102 | Func _WinAPI_AllowDarkModeForApp($bAllow = True) 103 | If @OSBuild < 17763 Then Return SetError(-1, 0, False) 104 | If @OSBuild >= 18362 Then Return SetError(-2, 0, False) 105 | Local $fnAllowDarkModeForApp = 135 106 | Local $aResult = DllCall('uxtheme.dll', 'bool', $fnAllowDarkModeForApp, 'bool', $bAllow) 107 | If @error Then Return SetError(@error, @extended, False) 108 | Return $aResult[0] 109 | EndFunc ;==>_WinAPI_AllowDarkModeForApp 110 | 111 | ; #FUNCTION# ==================================================================================================================== 112 | ; Name ..........: _WinAPI_FlushMenuThemes 113 | ; Description ...: Refreshes the system's immersive color policy state, allowing changes to take effect. 114 | ; Syntax ........: _WinAPI_FlushMenuThemes() 115 | ; Parameters ....: None 116 | ; Return values .: Success: True 117 | ; Failure: False and sets the @error flag: 118 | ; -1: Operating system version is earlier than Windows 10 (version 17763) 119 | ; Other values: DllCall error, check @error @extended for more information. 120 | ; Author ........: NoNameCode 121 | ; Modified ......: 122 | ; Remarks .......: This function is applicable for Windows 10 (version 17763) and later. 123 | ; Related .......: 124 | ; Link ..........: http://www.opengate.at/blog/2021/08/dark-mode-win32/ 125 | ; Example .......: No 126 | ; =============================================================================================================================== 127 | Func _WinAPI_FlushMenuThemes() 128 | If @OSBuild < 17763 Then Return SetError(-1, 0, False) 129 | Local $fnFlushMenuThemes = 136 130 | Local $aResult = DllCall('uxtheme.dll', 'none', $fnFlushMenuThemes) 131 | If @error Or Not IsArray($aResult) Then Return SetError(@error, @extended, False) 132 | Return True 133 | EndFunc ;==>_WinAPI_FlushMenuThemes 134 | 135 | ; #FUNCTION# ==================================================================================================================== 136 | ; Name ..........: _WinAPI_RefreshImmersiveColorPolicyState 137 | ; Description ...: Refreshes the system's immersive color policy state, allowing changes to take effect. 138 | ; Syntax ........: _WinAPI_RefreshImmersiveColorPolicyState() 139 | ; Parameters ....: None 140 | ; Return values .: Success: True 141 | ; Failure: False and sets the @error flag: 142 | ; -1: Operating system version is earlier than Windows 10 (version 17763) 143 | ; Other values: DllCall error, check @error @extended for more information. 144 | ; Author ........: NoNameCode 145 | ; Modified ......: 146 | ; Remarks .......: This function is applicable for Windows 10 (version 17763) and later. 147 | ; Related .......: 148 | ; Link ..........: http://www.opengate.at/blog/2021/08/dark-mode-win32/ 149 | ; Example .......: No 150 | ; =============================================================================================================================== 151 | Func _WinAPI_RefreshImmersiveColorPolicyState() 152 | If @OSBuild < 17763 Then Return SetError(-1, 0, False) 153 | Local $fnRefreshImmersiveColorPolicyState = 104 154 | Local $aResult = DllCall('uxtheme.dll', 'none', $fnRefreshImmersiveColorPolicyState) 155 | If @error Or Not IsArray($aResult) Then Return SetError(@error, @extended, False) 156 | Return True 157 | EndFunc ;==>_WinAPI_RefreshImmersiveColorPolicyState 158 | 159 | ; #FUNCTION# ==================================================================================================================== 160 | ; Name ..........: _WinAPI_IsDarkModeAllowedForWindow 161 | ; Description ...: Checks if the dark mode is allowed for the specified window. 162 | ; Syntax ........: _WinAPI_IsDarkModeAllowedForWindow() 163 | ; Parameters ....: None 164 | ; Return values .: Success: True if dark mode is allowed for the window, False otherwise. 165 | ; Failure: False and sets the @error flag: 166 | ; -1: Operating system version is earlier than Windows 10 (version 17763) 167 | ; Other values: DllCall error, check @error @extended for more information. 168 | ; Author ........: NoNameCode 169 | ; Modified ......: 170 | ; Remarks .......: This function is applicable for Windows 10 (version 17763) and later. 171 | ; Related .......: 172 | ; Link ..........: http://www.opengate.at/blog/2021/08/dark-mode-win32/ 173 | ; Example .......: No 174 | ; =============================================================================================================================== 175 | Func _WinAPI_IsDarkModeAllowedForWindow() 176 | If @OSBuild < 17763 Then Return SetError(-1, 0, False) 177 | Local $fnIsDarkModeAllowedForWindow = 137 178 | Local $aResult = DllCall('uxtheme.dll', 'bool', $fnIsDarkModeAllowedForWindow) 179 | If @error Or Not IsArray($aResult) Then Return SetError(@error, @extended, False) 180 | Return $aResult[0] 181 | EndFunc ;==>_WinAPI_IsDarkModeAllowedForWindow 182 | 183 | ; #FUNCTION# ==================================================================================================================== 184 | ; Name ..........: _WinAPI_GetIsImmersiveColorUsingHighContrast 185 | ; Description ...: Retrieves whether immersive color is using high contrast. 186 | ; Syntax ........: _WinAPI_GetIsImmersiveColorUsingHighContrast($IMMERSIVE_HC_CACHE_MODE) 187 | ; Parameters ....: $IMMERSIVE_HC_CACHE_MODE - The cache mode. Use one of the following values: 188 | ; $IHCM_USE_CACHED_VALUE (0) - Use the cached value. (Default) 189 | ; $IHCM_REFRESH (1) - Refresh the value. 190 | ; Return values .: Success: True if immersive color is using high contrast. 191 | ; Failure: False and sets the @error flag: 192 | ; -1: Operating system version is earlier than Windows 10 (version 17763) 193 | ; Other values: DllCall error, check @error @extended for more information. 194 | ; Author ........: NoNameCode 195 | ; Modified ......: 196 | ; Remarks .......: This function is applicable for Windows 10 (version 17763) and later. 197 | ; Related .......: 198 | ; Link ..........: http://www.opengate.at/blog/2021/08/dark-mode-win32/ 199 | ; Example .......: No 200 | ; =============================================================================================================================== 201 | Func _WinAPI_GetIsImmersiveColorUsingHighContrast($IMMERSIVE_HC_CACHE_MODE = $IHCM_USE_CACHED_VALUE) 202 | If @OSBuild < 17763 Then Return SetError(-1, 0, False) 203 | Local $fnGetIsImmersiveColorUsingHighContrast = 106 204 | Local $aResult = DllCall('uxtheme.dll', 'bool', $fnGetIsImmersiveColorUsingHighContrast, 'int', $IMMERSIVE_HC_CACHE_MODE) 205 | If @error Or Not IsArray($aResult) Then Return SetError(@error, @extended, False) 206 | Return $aResult[0] 207 | EndFunc ;==>_WinAPI_GetIsImmersiveColorUsingHighContrast 208 | 209 | ; #FUNCTION# ==================================================================================================================== 210 | ; Name ..........: _WinAPI_OpenNcThemeData 211 | ; Description ...: Opens the theme data for a window. 212 | ; Syntax ........: _WinAPI_OpenNcThemeData($hWnd, $pClassList) 213 | ; Parameters ....: $hWnd - Handle to the window. 214 | ; $sClassList - String that contains a semicolon-separated list of classes. 215 | ; Return values .: Success: A handle to the theme data. 216 | ; Failure: 0 and sets the @error flag: 217 | ; -1: Operating system version is earlier than Windows 10 (version 17763) 218 | ; Other values: DllCall error, check @error @extended for more information. 219 | ; Author ........: NoNameCode 220 | ; Modified ......: 221 | ; Remarks .......: 222 | ; Related .......: 223 | ; Link ..........: https://github.com/ysc3839/win32-darkmode/blob/master/win32-darkmode/DarkMode.h#L69 224 | ; Example .......: No 225 | ; =============================================================================================================================== 226 | Func _WinAPI_OpenNcThemeData($hWnd, $sClassList) 227 | If @OSBuild < 17763 Then Return SetError(-1, 0, False) 228 | Local $fnOpenNcThemeData = 49 229 | Local $aResult = DllCall('uxtheme.dll', 'hwnd', $fnOpenNcThemeData, 'hwnd', $hWnd, 'wstr', $sClassList) 230 | If @error Or Not IsArray($aResult) Then Return SetError(@error, @extended, 0) 231 | Return $aResult[0] 232 | EndFunc ;==>_WinAPI_OpenNcThemeData 233 | 234 | ; #FUNCTION# ==================================================================================================================== 235 | ; Name ..........: _WinAPI_ShouldSystemUseDarkMode 236 | ; Description ...: Checks if system should use the dark mode. 237 | ; Syntax ........: _WinAPI_ShouldSystemUseDarkMode() 238 | ; Parameters ....: None 239 | ; Return values .: Success: Returns True if system should use dark mode. 240 | ; Failure: Returns False and sets @error: 241 | ; -1: Operating system version is earlier than Windows 10 (version 1903, build 18362). 242 | ; Other values: DllCall error, check @error @extended for more information. 243 | ; Author ........: NoNameCode 244 | ; Modified ......: 245 | ; Remarks .......: Requires Windows 10 (version 1903, build 18362) or later. 246 | ; Related .......: 247 | ; Link ..........: http://www.opengate.at/blog/2021/08/dark-mode-win32/ 248 | ; Example .......: No 249 | ; =============================================================================================================================== 250 | Func _WinAPI_ShouldSystemUseDarkMode() 251 | If @OSBuild < 18362 Then Return SetError(-1, 0, False) 252 | Local $fnShouldSystemUseDarkMode = 138 253 | Local $aResult = DllCall('uxtheme.dll', 'bool', $fnShouldSystemUseDarkMode) 254 | If @error Or Not IsArray($aResult) Then Return SetError(@error, @extended, False) 255 | Return $aResult[0] 256 | EndFunc ;==>_WinAPI_ShouldSystemUseDarkMode 257 | 258 | ; #FUNCTION# ==================================================================================================================== 259 | ; Name ..........: _WinAPI_SetPreferredAppMode 260 | ; Description ...: Sets the preferred application mode for Windows 10 (version 1903, build 18362) and later. 261 | ; Syntax ........: _WinAPI_SetPreferredAppMode($PREFERREDAPPMODE) 262 | ; Parameters ....: $PREFERREDAPPMODE - The preferred application mode. See enum PreferredAppMode for possible values. 263 | ; $APPMODE_DEFAULT (0) 264 | ; $APPMODE_ALLOWDARK (1) 265 | ; $APPMODE_FORCEDARK (2) 266 | ; $APPMODE_FORCELIGHT (3) 267 | ; $APPMODE_MAX (4) 268 | ; Return values .: Success: The PreferredAppMode retuned by the DllCall 269 | ; Failure: '' and sets the @error flag: 270 | ; -1: Operating system version is earlier than Windows 10 (version 18362) 271 | ; Other values: DllCall error, check @error @extended for more information. 272 | ; Author ........: NoNameCode 273 | ; Modified ......: 274 | ; Remarks .......: This function is applicable for Windows 10 (version 18362) and later. 275 | ; Related .......: _WinAPI_AllowDarkModeForApp 276 | ; Link ..........: http://www.opengate.at/blog/2021/08/dark-mode-win32/ 277 | ; Example .......: No 278 | ; =============================================================================================================================== 279 | Func _WinAPI_SetPreferredAppMode($PREFERREDAPPMODE) 280 | If @OSBuild < 18362 Then Return SetError(-1, 0, False) 281 | Local $fnSetPreferredAppMode = 135 282 | Local $aResult = DllCall('uxtheme.dll', 'int', $fnSetPreferredAppMode, 'int', $PREFERREDAPPMODE) 283 | If @error Or Not IsArray($aResult) Then Return SetError(@error, @extended, '') 284 | Return $aResult[0] 285 | EndFunc ;==>_WinAPI_SetPreferredAppMode 286 | 287 | 288 | #EndRegion ;b WinAPIThemeEx.au3 289 | 290 | #Region ; GUIStyles.inc.au3 291 | ;~ #include "GUIStyles.inc.au3" 292 | 293 | Global Const $_g__Style_Gui[32][2] = _ 294 | [[0x80000000, 'WS_POPUP'], _ 295 | [0x40000000, 'WS_CHILD'], _ 296 | [0x20000000, 'WS_MINIMIZE'], _ 297 | [0x10000000, 'WS_VISIBLE'], _ 298 | [0x08000000, 'WS_DISABLED'], _ 299 | [0x04000000, 'WS_CLIPSIBLINGS'], _ 300 | [0x02000000, 'WS_CLIPCHILDREN'], _ 301 | [0x01000000, 'WS_MAXIMIZE'], _ 302 | [0x00CF0000, 'WS_OVERLAPPEDWINDOW'], _ ; (WS_CAPTION | WS_SYSMENU | WS_SIZEBOX | WS_MINIMIZEBOX | WS_MAXIMIZEBOX) aka 'WS_TILEDWINDOW' 303 | [0x00C00000, 'WS_CAPTION'], _ ; (WS_BORDER | WS_DLGFRAME) 304 | [0x00800000, 'WS_BORDER'], _ 305 | [0x00400000, 'WS_DLGFRAME'], _ 306 | [0x00200000, 'WS_VSCROLL'], _ 307 | [0x00100000, 'WS_HSCROLL'], _ 308 | [0x00080000, 'WS_SYSMENU'], _ 309 | [0x00040000, 'WS_SIZEBOX'], _ 310 | [0x00020000, '! WS_MINIMIZEBOX ! WS_GROUP'], _ ; ! GUI ! Control 311 | [0x00010000, '! WS_MAXIMIZEBOX ! WS_TABSTOP'], _ ; ! GUI ! Control 312 | [0x00002000, 'DS_CONTEXTHELP'], _ 313 | [0x00001000, 'DS_CENTERMOUSE'], _ 314 | [0x00000800, 'DS_CENTER'], _ 315 | [0x00000400, 'DS_CONTROL'], _ 316 | [0x00000200, 'DS_SETFOREGROUND'], _ 317 | [0x00000100, 'DS_NOIDLEMSG'], _ 318 | [0x00000080, 'DS_MODALFRAME'], _ 319 | [0x00000040, 'DS_SETFONT'], _ 320 | [0x00000020, 'DS_LOCALEDIT'], _ 321 | [0x00000010, 'DS_NOFAILCREATE'], _ 322 | [0x00000008, 'DS_FIXEDSYS'], _ 323 | [0x00000004, 'DS_3DLOOK'], _ 324 | [0x00000002, 'DS_SYSMODAL'], _ 325 | [0x00000001, 'DS_ABSALIGN']] 326 | ; 327 | ; [0x80880000, 'WS_POPUPWINDOW'] 328 | ; [0x20000000, 'WS_ICONIC'] 329 | ; [0x00040000, 'WS_THICKFRAME'] 330 | ; 331 | ; [0x00000000, 'WS_OVERLAPPED'] ; also named 'WS_TILED' 332 | 333 | 334 | Global Const $_g__Style_GuiExtended[21][2] = _ 335 | [[0x08000000, 'WS_EX_NOACTIVATE'], _ 336 | [0x02000000, 'WS_EX_COMPOSITED'], _ 337 | [0x00400000, 'WS_EX_LAYOUTRTL'], _ 338 | [0x00100000, '! WS_EX_NOINHERITLAYOUT ! GUI_WS_EX_PARENTDRAG'], _ ; ! GUI ! Control (label or pic, AutoIt "draggable" feature on 2 controls) 339 | [0x00080000, 'WS_EX_LAYERED'], _ 340 | [0x00040000, 'WS_EX_APPWINDOW'], _ 341 | [0x00020000, 'WS_EX_STATICEDGE'], _ 342 | [0x00010000, 'WS_EX_CONTROLPARENT'], _ ; AutoIt adds a "draggable" feature to this GUI extended style behavior 343 | [0x00004000, 'WS_EX_LEFTSCROLLBAR'], _ 344 | [0x00002000, 'WS_EX_RTLREADING'], _ 345 | [0x00001000, 'WS_EX_RIGHT'], _ 346 | [0x00000400, 'WS_EX_CONTEXTHELP'], _ 347 | [0x00000200, 'WS_EX_CLIENTEDGE'], _ 348 | [0x00000100, 'WS_EX_WINDOWEDGE'], _ 349 | [0x00000080, 'WS_EX_TOOLWINDOW'], _ 350 | [0x00000040, 'WS_EX_MDICHILD'], _ 351 | [0x00000020, 'WS_EX_TRANSPARENT'], _ 352 | [0x00000010, 'WS_EX_ACCEPTFILES'], _ 353 | [0x00000008, 'WS_EX_TOPMOST'], _ 354 | [0x00000004, 'WS_EX_NOPARENTNOTIFY'], _ 355 | [0x00000001, 'WS_EX_DLGMODALFRAME']] 356 | ; 357 | ; [0x00000300, 'WS_EX_OVERLAPPEDWINDOW'] 358 | ; [0x00000188, 'WS_EX_PALETTEWINDOW'] 359 | ; 360 | ; [0x00000000, 'WS_EX_LEFT'] 361 | ; [0x00000000, 'WS_EX_LTRREADING'] 362 | ; [0x00000000, 'WS_EX_RIGHTSCROLLBAR'] 363 | 364 | 365 | Global Const $_g__Style_Avi[5][2] = _ 366 | [[0x0010, 'ACS_NONTRANSPARENT'], _ 367 | [0x0008, 'ACS_TIMER'], _ 368 | [0x0004, 'ACS_AUTOPLAY'], _ 369 | [0x0002, 'ACS_TRANSPARENT'], _ 370 | [0x0001, 'ACS_CENTER']] 371 | 372 | 373 | Global Const $_g__Style_Button[20][2] = _ 374 | [[0x8000, 'BS_FLAT'], _ 375 | [0x4000, 'BS_NOTIFY'], _ 376 | [0x2000, 'BS_MULTILINE'], _ 377 | [0x1000, 'BS_PUSHLIKE'], _ 378 | [0x0C00, 'BS_VCENTER'], _ 379 | [0x0800, 'BS_BOTTOM'], _ 380 | [0x0400, 'BS_TOP'], _ 381 | [0x0300, 'BS_CENTER'], _ 382 | [0x0200, 'BS_RIGHT'], _ 383 | [0x0100, 'BS_LEFT'], _ 384 | [0x0080, 'BS_BITMAP'], _ 385 | [0x0040, 'BS_ICON'], _ 386 | [0x0020, 'BS_RIGHTBUTTON'], _ 387 | [0x0009, 'BS_AUTORADIOBUTTON'] , _ 388 | [0x0007, 'BS_GROUPBOX'], _ 389 | [0x0006, 'BS_AUTO3STATE'], _ 390 | [0x0005, 'BS_3STATE'], _ 391 | [0x0003, 'BS_AUTOCHECKBOX'], _ 392 | [0x0002, 'BS_CHECKBOX'], _ 393 | [0x0001, 'BS_DEFPUSHBUTTON']] 394 | 395 | 396 | Global Const $_g__Style_Combo[13][2] = _ 397 | [[0x4000, 'CBS_LOWERCASE'], _ 398 | [0x2000, 'CBS_UPPERCASE'], _ 399 | [0x0800, 'CBS_DISABLENOSCROLL'], _ 400 | [0x0400, 'CBS_NOINTEGRALHEIGHT'], _ 401 | [0x0200, 'CBS_HASSTRINGS'], _ 402 | [0x0100, 'CBS_SORT'], _ 403 | [0x0080, 'CBS_OEMCONVERT'], _ 404 | [0x0040, 'CBS_AUTOHSCROLL'], _ 405 | [0x0020, 'CBS_OWNERDRAWVARIABLE'], _ 406 | [0x0010, 'CBS_OWNERDRAWFIXED'], _ 407 | [0x0003, 'CBS_DROPDOWNLIST'], _ 408 | [0x0002, 'CBS_DROPDOWN'], _ 409 | [0x0001, 'CBS_SIMPLE']] 410 | 411 | 412 | Global Const $_g__Style_Common[12][2] = _ ; "for rebar controls, toolbar controls, and status windows (msdn)" 413 | [[0x0083, 'CCS_RIGHT'], _ 414 | [0x0082, 'CCS_NOMOVEX'], _ 415 | [0x0081, 'CCS_LEFT'], _ 416 | [0x0080, 'CCS_VERT'], _ 417 | [0x0040, 'CCS_NODIVIDER'], _ 418 | [0x0020, 'CCS_ADJUSTABLE'], _ 419 | [0x0010, 'CCS_NOHILITE'], _ 420 | [0x0008, 'CCS_NOPARENTALIGN'], _ 421 | [0x0004, 'CCS_NORESIZE'], _ 422 | [0x0003, 'CCS_BOTTOM'], _ 423 | [0x0002, 'CCS_NOMOVEY'], _ 424 | [0x0001, 'CCS_TOP']] 425 | 426 | 427 | Global Const $_g__Style_DateTime[7][2] = _ 428 | [[0x0020, 'DTS_RIGHTALIGN'], _ 429 | [0x0010, 'DTS_APPCANPARSE'], _ 430 | [0x000C, 'DTS_SHORTDATECENTURYFORMAT'], _ 431 | [0x0009, 'DTS_TIMEFORMAT'], _ 432 | [0x0004, 'DTS_LONGDATEFORMAT'], _ 433 | [0x0002, 'DTS_SHOWNONE'], _ 434 | [0x0001, 'DTS_UPDOWN']] 435 | ; 436 | ; [0x0000, 'DTS_SHORTDATEFORMAT'] 437 | 438 | 439 | Global Const $_g__Style_Edit[13][2] = _ 440 | [[0x2000, 'ES_NUMBER'], _ 441 | [0x1000, 'ES_WANTRETURN'], _ 442 | [0x0800, 'ES_READONLY'], _ 443 | [0x0400, 'ES_OEMCONVERT'], _ 444 | [0x0100, 'ES_NOHIDESEL'], _ 445 | [0x0080, 'ES_AUTOHSCROLL'], _ 446 | [0x0040, 'ES_AUTOVSCROLL'], _ 447 | [0x0020, 'ES_PASSWORD'], _ 448 | [0x0010, 'ES_LOWERCASE'], _ 449 | [0x0008, 'ES_UPPERCASE'], _ 450 | [0x0004, 'ES_MULTILINE'], _ 451 | [0x0002, 'ES_RIGHT'], _ 452 | [0x0001, 'ES_CENTER']] 453 | 454 | 455 | Global Const $_g__Style_Header[10][2] = _ 456 | [[0x1000, 'HDS_OVERFLOW'], _ 457 | [0x0800, 'HDS_NOSIZING'], _ 458 | [0x0400, 'HDS_CHECKBOXES'], _ 459 | [0x0200, 'HDS_FLAT'], _ 460 | [0x0100, 'HDS_FILTERBAR'], _ 461 | [0x0080, 'HDS_FULLDRAG'], _ 462 | [0x0040, 'HDS_DRAGDROP'], _ 463 | [0x0008, 'HDS_HIDDEN'], _ 464 | [0x0004, 'HDS_HOTTRACK'], _ 465 | [0x0002, 'HDS_BUTTONS']] 466 | ; 467 | ; [0x0000, '$HDS_HORZ'] 468 | 469 | 470 | Global Const $_g__Style_ListBox[16][2] = _ 471 | [[0x8000, 'LBS_COMBOBOX'], _ 472 | [0x4000, 'LBS_NOSEL'], _ 473 | [0x2000, 'LBS_NODATA'], _ 474 | [0x1000, 'LBS_DISABLENOSCROLL'], _ 475 | [0x0800, 'LBS_EXTENDEDSEL'], _ 476 | [0x0400, 'LBS_WANTKEYBOARDINPUT'], _ 477 | [0x0200, 'LBS_MULTICOLUMN'], _ 478 | [0x0100, 'LBS_NOINTEGRALHEIGHT'], _ 479 | [0x0080, 'LBS_USETABSTOPS'], _ 480 | [0x0040, 'LBS_HASSTRINGS'], _ 481 | [0x0020, 'LBS_OWNERDRAWVARIABLE'], _ 482 | [0x0010, 'LBS_OWNERDRAWFIXED'], _ 483 | [0x0008, 'LBS_MULTIPLESEL'], _ 484 | [0x0004, 'LBS_NOREDRAW'], _ 485 | [0x0002, 'LBS_SORT'], _ 486 | [0x0001, 'LBS_NOTIFY']] 487 | ; 488 | ; [0xA00003, 'LBS_STANDARD'] ; i.e. (LBS_NOTIFY | LBS_SORT | WS_VSCROLL | WS_BORDER) help file correct, ListBoxConstants.au3 incorrect 489 | 490 | 491 | Global Const $_g__Style_ListView[17][2] = _ 492 | [[0x8000, 'LVS_NOSORTHEADER'], _ 493 | [0x4000, 'LVS_NOCOLUMNHEADER'], _ 494 | [0x2000, 'LVS_NOSCROLL'], _ 495 | [0x1000, 'LVS_OWNERDATA'], _ 496 | [0x0800, 'LVS_ALIGNLEFT'], _ 497 | [0x0400, 'LVS_OWNERDRAWFIXED'], _ 498 | [0x0200, 'LVS_EDITLABELS'], _ 499 | [0x0100, 'LVS_AUTOARRANGE'], _ 500 | [0x0080, 'LVS_NOLABELWRAP'], _ 501 | [0x0040, 'LVS_SHAREIMAGELISTS'], _ 502 | [0x0020, 'LVS_SORTDESCENDING'], _ 503 | [0x0010, 'LVS_SORTASCENDING'], _ 504 | [0x0008, 'LVS_SHOWSELALWAYS'], _ 505 | [0x0004, 'LVS_SINGLESEL'], _ 506 | [0x0003, 'LVS_LIST'], _ 507 | [0x0002, 'LVS_SMALLICON'], _ 508 | [0x0001, 'LVS_REPORT']] 509 | ; 510 | ; [0x0000, 'LVS_ICON'] 511 | ; [0x0000, 'LVS_ALIGNTOP'] 512 | 513 | 514 | Global Const $_g__Style_ListViewExtended[20][2] = _ 515 | [[0x00100000, 'LVS_EX_SIMPLESELECT'], _ 516 | [0x00080000, 'LVS_EX_SNAPTOGRID'], _ 517 | [0x00020000, 'LVS_EX_HIDELABELS'], _ 518 | [0x00010000, 'LVS_EX_DOUBLEBUFFER'], _ 519 | [0x00008000, 'LVS_EX_BORDERSELECT'], _ 520 | [0x00004000, 'LVS_EX_LABELTIP'], _ 521 | [0x00002000, 'LVS_EX_MULTIWORKAREAS'], _ 522 | [0x00001000, 'LVS_EX_UNDERLINECOLD'], _ 523 | [0x00000800, 'LVS_EX_UNDERLINEHOT'], _ 524 | [0x00000400, 'LVS_EX_INFOTIP'], _ 525 | [0x00000200, 'LVS_EX_REGIONAL'], _ 526 | [0x00000100, 'LVS_EX_FLATSB'], _ 527 | [0x00000080, 'LVS_EX_TWOCLICKACTIVATE'], _ 528 | [0x00000040, 'LVS_EX_ONECLICKACTIVATE'], _ 529 | [0x00000020, 'LVS_EX_FULLROWSELECT'], _ 530 | [0x00000010, 'LVS_EX_HEADERDRAGDROP'], _ 531 | [0x00000008, 'LVS_EX_TRACKSELECT'], _ 532 | [0x00000004, 'LVS_EX_CHECKBOXES'], _ 533 | [0x00000002, 'LVS_EX_SUBITEMIMAGES'], _ 534 | [0x00000001, 'LVS_EX_GRIDLINES']] 535 | 536 | Global Const $_g__Style_MonthCal[8][2] = _ 537 | [[0x0100, 'MCS_NOSELCHANGEONNAV'], _ 538 | [0x0080, 'MCS_SHORTDAYSOFWEEK'], _ 539 | [0x0040, 'MCS_NOTRAILINGDATES'], _ 540 | [0x0010, 'MCS_NOTODAY'], _ 541 | [0x0008, 'MCS_NOTODAYCIRCLE'], _ 542 | [0x0004, 'MCS_WEEKNUMBERS'], _ 543 | [0x0002, 'MCS_MULTISELECT'], _ 544 | [0x0001, 'MCS_DAYSTATE']] 545 | 546 | 547 | Global Const $_g__Style_Pager[3][2] = _ 548 | [[0x0004, 'PGS_DRAGNDROP'], _ 549 | [0x0002, 'PGS_AUTOSCROLL'], _ 550 | [0x0001, 'PGS_HORZ']] 551 | ; 552 | ; [0x0000, 'PGS_VERT'] 553 | 554 | 555 | Global Const $_g__Style_Progress[4][2] = _ 556 | [[0x0010, 'PBS_SMOOTHREVERSE'], _ 557 | [0x0008, 'PBS_MARQUEE'], _ 558 | [0x0004, 'PBS_VERTICAL'], _ 559 | [0x0001, 'PBS_SMOOTH']] 560 | 561 | 562 | Global Const $_g__Style_Rebar[8][2] = _ 563 | [[0x8000, 'RBS_DBLCLKTOGGLE'], _ 564 | [0x4000, 'RBS_VERTICALGRIPPER'], _ 565 | [0x2000, 'RBS_AUTOSIZE'], _ 566 | [0x1000, 'RBS_REGISTERDROP'], _ 567 | [0x0800, 'RBS_FIXEDORDER'], _ 568 | [0x0400, 'RBS_BANDBORDERS'], _ 569 | [0x0200, 'RBS_VARHEIGHT'], _ 570 | [0x0100, 'RBS_TOOLTIPS']] 571 | 572 | 573 | Global Const $_g__Style_RichEdit[8][2] = _ ; will also use plenty (not all) of Edit styles 574 | [[0x01000000, 'ES_SELECTIONBAR'], _ 575 | [0x00400000, 'ES_VERTICAL'], _ ; Asian-language support only (msdn) 576 | [0x00080000, 'ES_NOIME'], _ ; ditto 577 | [0x00040000, 'ES_SELFIME'], _ ; ditto 578 | [0x00008000, 'ES_SAVESEL'], _ 579 | [0x00004000, 'ES_SUNKEN'], _ 580 | [0x00002000, 'ES_DISABLENOSCROLL'], _ ; same value as 'ES_NUMBER' => issue ? 581 | [0x00000008, 'ES_NOOLEDRAGDROP']] ; same value as 'ES_UPPERCASE' but RichRdit controls do not support 'ES_UPPERCASE' style (msdn) 582 | 583 | 584 | Global Const $_g__Style_Scrollbar[5][2] = _ 585 | [[0x0010, 'SBS_SIZEGRIP'], _ 586 | [0x0008, 'SBS_SIZEBOX'], _ 587 | [0x0004, 'SBS_RIGHTALIGN or SBS_BOTTOMALIGN'], _ ; i.e. use SBS_RIGHTALIGN with SBS_VERT, use SBS_BOTTOMALIGN with SBS_HORZ (msdn) 588 | [0x0002, 'SBS_LEFTALIGN or SBS_TOPALIGN'], _ ; i.e. use SBS_LEFTALIGN with SBS_VERT, use SBS_TOPALIGN with SBS_HORZ (msdn) 589 | [0x0001, 'SBS_VERT']] 590 | ; 591 | ; [0x0000, 'SBS_HORZ'] 592 | 593 | 594 | Global Const $_g__Style_Slider[13][2] = _ ; i.e. trackbar 595 | [[0x1000, 'TBS_TRANSPARENTBKGND'], _ 596 | [0x0800, 'TBS_NOTIFYBEFOREMOVE'], _ 597 | [0x0400, 'TBS_DOWNISLEFT'], _ 598 | [0x0200, 'TBS_REVERSED'], _ 599 | [0x0100, 'TBS_TOOLTIPS'], _ 600 | [0x0080, 'TBS_NOTHUMB'], _ 601 | [0x0040, 'TBS_FIXEDLENGTH'], _ 602 | [0x0020, 'TBS_ENABLESELRANGE'], _ 603 | [0x0010, 'TBS_NOTICKS'], _ 604 | [0x0008, 'TBS_BOTH'], _ 605 | [0x0004, 'TBS_LEFT or TBS_TOP'], _ ; i.e. TBS_LEFT tick marks when vertical slider, or TBS_TOP tick marks when horizontal slider 606 | [0x0002, 'TBS_VERT'], _ 607 | [0x0001, 'TBS_AUTOTICKS']] 608 | ; 609 | ; [0x0000, 'TBS_RIGHT'] 610 | ; [0x0000, 'TBS_BOTTOM'] 611 | ; [0x0000, 'TBS_HORZ'] 612 | 613 | 614 | Global Const $_g__Style_Static[18][2] = _ 615 | [[0x1000, 'SS_SUNKEN'], _ 616 | [0x0400, 'SS_RIGHTJUST'], _ 617 | [0x0200, 'SS_CENTERIMAGE'], _ 618 | [0x0100, 'SS_NOTIFY'], _ 619 | [0x0080, 'SS_NOPREFIX'], _ 620 | [0x0012, 'SS_ETCHEDFRAME'], _ 621 | [0x0011, 'SS_ETCHEDVERT'], _ 622 | [0x0010, 'SS_ETCHEDHORZ'], _ 623 | [0x000C, 'SS_LEFTNOWORDWRAP'], _ 624 | [0x000B, 'SS_SIMPLE'], _ 625 | [0x0009, 'SS_WHITEFRAME'], _ 626 | [0x0008, 'SS_GRAYFRAME'], _ 627 | [0x0007, 'SS_BLACKFRAME'], _ 628 | [0x0006, 'SS_WHITERECT'], _ 629 | [0x0005, 'SS_GRAYRECT'], _ 630 | [0x0004, 'SS_BLACKRECT'], _ 631 | [0x0002, 'SS_RIGHT'], _ 632 | [0x0001, 'SS_CENTER']] 633 | ; 634 | ; [0x0000, 'SS_LEFT'] 635 | 636 | 637 | Global Const $_g__Style_StatusBar[2][2] = _ 638 | [[0x0800, 'SBARS_TOOLTIPS'], _ 639 | [0x0100, 'SBARS_SIZEGRIP']] 640 | ; 641 | ; [0x0800, 'SBT_TOOLTIPS'] 642 | 643 | 644 | Global Const $_g__Style_Tab[17][2] = _ 645 | [[0x8000, 'TCS_FOCUSNEVER'], _ 646 | [0x4000, 'TCS_TOOLTIPS'], _ 647 | [0x2000, 'TCS_OWNERDRAWFIXED'], _ 648 | [0x1000, 'TCS_FOCUSONBUTTONDOWN'], _ 649 | [0x0800, 'TCS_RAGGEDRIGHT'], _ 650 | [0x0400, 'TCS_FIXEDWIDTH'], _ 651 | [0x0200, 'TCS_MULTILINE'], _ 652 | [0x0100, 'TCS_BUTTONS'], _ 653 | [0x0080, 'TCS_VERTICAL'], _ 654 | [0x0040, 'TCS_HOTTRACK'], _ 655 | [0x0020, 'TCS_FORCELABELLEFT'], _ 656 | [0x0010, 'TCS_FORCEICONLEFT'], _ 657 | [0x0008, 'TCS_FLATBUTTONS'], _ 658 | [0x0004, 'TCS_MULTISELECT'], _ 659 | [0x0002, 'TCS_RIGHT'], _ 660 | [0x0002, 'TCS_BOTTOM'], _ 661 | [0x0001, 'TCS_SCROLLOPPOSITE']] 662 | ; 663 | ; [0x0000, 'TCS_TABS'] 664 | ; [0x0000, 'TCS_SINGLELINE'] 665 | ; [0x0000, 'TCS_RIGHTJUSTIFY'] 666 | 667 | 668 | Global Const $_g__Style_Toolbar[8][2] = _ 669 | [[0x8000, 'TBSTYLE_TRANSPARENT'], _ 670 | [0x4000, 'TBSTYLE_REGISTERDROP'], _ 671 | [0x2000, 'TBSTYLE_CUSTOMERASE'], _ 672 | [0x1000, 'TBSTYLE_LIST'], _ 673 | [0x0800, 'TBSTYLE_FLAT'], _ 674 | [0x0400, 'TBSTYLE_ALTDRAG'], _ 675 | [0x0200, 'TBSTYLE_WRAPABLE'], _ 676 | [0x0100, 'TBSTYLE_TOOLTIPS']] 677 | 678 | 679 | Global Const $_g__Style_TreeView[16][2] = _ 680 | [[0x8000, 'TVS_NOHSCROLL'], _ 681 | [0x4000, 'TVS_NONEVENHEIGHT'], _ 682 | [0x2000, 'TVS_NOSCROLL'], _ 683 | [0x1000, 'TVS_FULLROWSELECT'], _ 684 | [0x0800, 'TVS_INFOTIP'], _ 685 | [0x0400, 'TVS_SINGLEEXPAND'], _ 686 | [0x0200, 'TVS_TRACKSELECT'], _ 687 | [0x0100, 'TVS_CHECKBOXES'], _ 688 | [0x0080, 'TVS_NOTOOLTIPS'], _ 689 | [0x0040, 'TVS_RTLREADING'], _ 690 | [0x0020, 'TVS_SHOWSELALWAYS'], _ 691 | [0x0010, 'TVS_DISABLEDRAGDROP'], _ 692 | [0x0008, 'TVS_EDITLABELS'], _ 693 | [0x0004, 'TVS_LINESATROOT'], _ 694 | [0x0002, 'TVS_HASLINES'], _ 695 | [0x0001, 'TVS_HASBUTTONS']] 696 | 697 | 698 | Global Const $_g__Style_UpDown[9][2] = _ 699 | [[0x0100, 'UDS_HOTTRACK'], _ 700 | [0x0080, 'UDS_NOTHOUSANDS'], _ 701 | [0x0040, 'UDS_HORZ'], _ 702 | [0x0020, 'UDS_ARROWKEYS'], _ 703 | [0x0010, 'UDS_AUTOBUDDY'], _ 704 | [0x0008, 'UDS_ALIGNLEFT'], _ 705 | [0x0004, 'UDS_ALIGNRIGHT'], _ 706 | [0x0002, 'UDS_SETBUDDYINT'], _ 707 | [0x0001, 'UDS_WRAP']] 708 | 709 | 710 | #EndRegion ; GUIStyles.inc.au3 711 | 712 | #Region ; GUIStyles.au3 713 | ;~ #include "GUIStyles.au3" 714 | Func hWnd2Styles($hWnd) 715 | Return _GetCtrlStyleString(_WinAPI_GetWindowLong($hWnd, $GWL_STYLE), _WinAPI_GetWindowLong($hWnd, $GWL_EXSTYLE), _WinAPI_GetClassName($hWnd)) 716 | EndFunc 717 | 718 | Func _GetStyleString($iStyle, $fExStyle) 719 | ConsoleWrite('+ Func _GetStyleString(' & $iStyle & ', ' & $fExStyle & ')' & @CRLF) 720 | Local $Text = '', $Data = $fExStyle ? $_g__Style_GuiExtended : $_g__Style_Gui 721 | 722 | For $i = 0 To UBound($Data) - 1 723 | If BitAND($iStyle, $Data[$i][0]) = $Data[$i][0] Then 724 | $iStyle = BitAND($iStyle, BitNOT($Data[$i][0])) 725 | If StringLeft($Data[$i][1], 1) <> "!" Then 726 | $Text &= $Data[$i][1] & ', ' 727 | Else 728 | ; ex. '! WS_MINIMIZEBOX ! WS_GROUP' => 'WS_MINIMIZEBOX, ' 729 | $Text &= StringMid($Data[$i][1], 3, StringInStr($Data[$i][1], "!", 2, 2) - 4) & ', ' 730 | EndIf 731 | EndIf 732 | Next 733 | 734 | If $iStyle Then $Text = '0x' & Hex($iStyle, 8) & ', ' & $Text 735 | 736 | Return StringRegExpReplace($Text, ',\s\z', '') 737 | EndFunc ;==>_GetStyleString 738 | 739 | Func _GetCtrlStyleString($iStyle, $fExStyle, $sClass, $iLVExStyle = 0) 740 | 741 | If $sClass = "AutoIt v3 GUI" Or $sClass = "#32770" Or $sClass = "MDIClient" Then ; control = child GUI, dialog box (msgbox) etc... 742 | Return _GetStyleString($iStyle, 0) 743 | EndIf 744 | 745 | If StringLeft($sClass, 8) = "RichEdit" Then $sClass = "RichEdit" ; RichEdit, RichEdit20A, RichEdit20W, RichEdit50A, RichEdit50W 746 | 747 | Local $Text = '' 748 | 749 | _GetCtrlStyleString2($iStyle, $Text, $sClass, $iLVExStyle) ; 4th param. in case $sClass = "Ex_SysListView32" (special treatment) 750 | 751 | If $sClass = "ReBarWindow32" Or $sClass = "ToolbarWindow32" Or $sClass = "msctls_statusbar32" Then 752 | $sClass = "Common" ; "for rebar controls, toolbar controls, and status windows" (msdn) 753 | _GetCtrlStyleString2($iStyle, $Text, $sClass) 754 | ElseIf $sClass = "RichEdit" Then 755 | $sClass = "Edit" ; "Richedit controls also support many edit control styles (not all)" (msdn) 756 | _GetCtrlStyleString2($iStyle, $Text, $sClass) 757 | EndIf 758 | 759 | Local $Data = $fExStyle ? $_g__Style_GuiExtended : $_g__Style_Gui 760 | 761 | For $i = 0 To UBound($Data) - 1 762 | If BitAND($iStyle, $Data[$i][0]) = $Data[$i][0] Then 763 | If (Not BitAND($Data[$i][0], 0xFFFF)) Or ($fExStyle) Then 764 | $iStyle = BitAND($iStyle, BitNOT($Data[$i][0])) 765 | If StringLeft($Data[$i][1], 1) <> "!" Then 766 | $Text &= $Data[$i][1] & ', ' 767 | Else 768 | ; ex. '! WS_MINIMIZEBOX ! WS_GROUP' => 'WS_GROUP, ' 769 | $Text &= StringMid($Data[$i][1], StringInStr($Data[$i][1], "!", 2, 2) + 2) & ', ' 770 | EndIf 771 | EndIf 772 | EndIf 773 | Next 774 | 775 | If $iStyle Then $Text = '0x' & Hex($iStyle, 8) & ', ' & $Text 776 | 777 | Return StringRegExpReplace($Text, ',\s\z', '') 778 | EndFunc ;==>_GetCtrlStyleString 779 | 780 | ;===================================================================== 781 | Func _GetCtrlStyleString2(ByRef $iStyle, ByRef $Text, $sClass, $iLVExStyle = 0) 782 | 783 | Local $Data 784 | 785 | Switch $sClass ; $Input[16] 786 | Case "Button" 787 | $Data = $_g__Style_Button 788 | Case "ComboBox", "ComboBoxEx32" 789 | $Data = $_g__Style_Combo 790 | Case "Common" 791 | $Data = $_g__Style_Common ; "for rebar controls, toolbar controls, and status windows (msdn)" 792 | Case "Edit" 793 | $Data = $_g__Style_Edit 794 | Case "ListBox" 795 | $Data = $_g__Style_ListBox 796 | Case "msctls_progress32" 797 | $Data = $_g__Style_Progress 798 | Case "msctls_statusbar32" 799 | $Data = $_g__Style_StatusBar 800 | Case "msctls_trackbar32" 801 | $Data = $_g__Style_Slider 802 | Case "msctls_updown32" 803 | $Data = $_g__Style_UpDown 804 | Case "ReBarWindow32" 805 | $Data = $_g__Style_Rebar 806 | Case "RichEdit" 807 | $Data = $_g__Style_RichEdit 808 | Case "Scrollbar" 809 | $Data = $_g__Style_Scrollbar 810 | Case "Static" 811 | $Data = $_g__Style_Static 812 | Case "SysAnimate32" 813 | $Data = $_g__Style_Avi 814 | Case "SysDateTimePick32" 815 | $Data = $_g__Style_DateTime 816 | Case "SysHeader32" 817 | $Data = $_g__Style_Header 818 | Case "SysListView32" 819 | $Data = $_g__Style_ListView 820 | Case "Ex_SysListView32" ; special treatment below 821 | $Data = $_g__Style_ListViewExtended 822 | Case "SysMonthCal32" 823 | $Data = $_g__Style_MonthCal 824 | Case "SysPager" 825 | $Data = $_g__Style_Pager 826 | Case "SysTabControl32", "SciTeTabCtrl" 827 | $Data = $_g__Style_Tab 828 | Case "SysTreeView32" 829 | $Data = $_g__Style_TreeView 830 | Case "ToolbarWindow32" 831 | $Data = $_g__Style_Toolbar 832 | Case Else 833 | Return 834 | EndSwitch 835 | 836 | If $sClass <> "Ex_SysListView32" Then 837 | For $i = 0 To UBound($Data) - 1 838 | If BitAND($iStyle, $Data[$i][0]) = $Data[$i][0] Then 839 | $iStyle = BitAND($iStyle, BitNOT($Data[$i][0])) 840 | $Text = $Data[$i][1] & ', ' & $Text 841 | EndIf 842 | Next 843 | Else 844 | For $i = 0 To UBound($Data) - 1 845 | If BitAND($iLVExStyle, $Data[$i][0]) = $Data[$i][0] Then 846 | $iLVExStyle = BitAND($iLVExStyle, BitNOT($Data[$i][0])) 847 | $Text = $Data[$i][1] & ', ' & $Text 848 | If BitAND($iStyle, $Data[$i][0]) = $Data[$i][0] Then 849 | $iStyle = BitAND($iStyle, BitNOT($Data[$i][0])) 850 | EndIf 851 | EndIf 852 | Next 853 | If $iLVExStyle Then $Text = 'LVex: 0x' & Hex($iLVExStyle, 8) & ', ' & $Text 854 | ; next test bc LVS_EX_FULLROWSELECT (default AutoIt LV ext style) and WS_EX_TRANSPARENT got both same value 0x20 (hard to solve in some cases) 855 | If BitAND($iStyle, $WS_EX_TRANSPARENT) = $WS_EX_TRANSPARENT Then ; note that $WS_EX_TRANSPARENT has nothing to do with listview 856 | $iStyle = BitAND($iStyle, BitNOT($WS_EX_TRANSPARENT)) 857 | EndIf 858 | ; $WS_EX_NOPARENTNOTIFY and LVS_EX_CHECKBOXES share the same value of 0x00000004 859 | If BitAND($iStyle, $WS_EX_NOPARENTNOTIFY) = $WS_EX_NOPARENTNOTIFY Then ; note that $WS_EX_NOPARENTNOTIFY has nothing to do with listview 860 | $iStyle = BitAND($iStyle, BitNOT($WS_EX_NOPARENTNOTIFY)) 861 | EndIf 862 | EndIf 863 | EndFunc ;==>_GetCtrlStyleString2 864 | 865 | 866 | 867 | #EndRegion ; GUIStyles.au3 868 | 869 | 870 | ;~ #include "_FindDelayLoadThunkInModule.au3" 871 | 872 | #include 873 | #include ; _WinAPI_GetDlgCtrlID 874 | 875 | 876 | #include 877 | ;~ #include 878 | #include 879 | ;~ #include 880 | 881 | #include ; Just For _ArrayDisplay() 882 | #include ; Debug ListView Header 883 | 884 | 885 | ; #INDEX# ======================================================================================================================= 886 | ; Title .........: GUIDarkmode UDF Library for AutoIt3 887 | ; AutoIt Version : 3.3.16.1 888 | ; Description ...: Additional variables, constants and functions for the WinAPITheme.au3 889 | ; Author(s) .....: NoNameCode 890 | ; =============================================================================================================================== 891 | 892 | #Region Global Variables and Constants 893 | 894 | ; #VARIABLES# =================================================================================================================== 895 | 896 | ; Darkmode default colors for GUI / -Ctrls 897 | Global $GUIDARKMODE_COLOR_GUIBK = 0x202020 ; 0x383838 ; 0x202020 ;Orig argumentum: 0x1B1B1B 898 | Global $GUIDARKMODE_COLOR_GUICTRL = 0xe0e0e0 ;Orig argumentum: 0xFBFBFB 899 | Global $GUIDARKMODE_COLOR_GUICTRLBK = 0x202020 ; 0x383838 ; 0x202020 ; 0x3f3f3f ;Orig argumentum: 0x2B2B2B 900 | 901 | ; =============================================================================================================================== 902 | 903 | ; #CONSTANTS# =================================================================================================================== 904 | 905 | Global Const $DWMWA_USE_IMMERSIVE_DARK_MODE = (@OSBuild <= 18985) ? 19 : 20 ; before this build set to 19, otherwise set to 20, no thanks Windaube to document anything ?? 906 | 907 | ; =============================================================================================================================== 908 | #EndRegion Global Variables and Constants 909 | 910 | #Region Functions list 911 | ; #CURRENT# ===================================================================================================================== 912 | ; _GUISetDarkTheme 913 | ; _GUICtrlSetDarkTheme 914 | ; _GUICtrlAllSetDarkTheme 915 | ; =============================================================================================================================== 916 | #EndRegion Functions list 917 | 918 | 919 | 920 | #Region Public Functions 921 | 922 | ; #FUNCTION# ==================================================================================================================== 923 | ; Name ..........: _GUISetDarkTheme 924 | ; Description ...: Sets the theme for a specified window to either dark or light mode on Windows 10. 925 | ; Syntax ........: _GUISetDarkTheme($hwnd, $dark_theme = True) 926 | ; Parameters ....: $hwnd - The handle to the window. 927 | ; $dark_theme - If True, sets the dark theme; if False, sets the light theme. 928 | ; (Default is True for dark theme.) 929 | ; Return values .: None 930 | ; Author ........: DK12000, NoNameCode 931 | ; Modified ......: 932 | ; Remarks .......: 933 | ; Related .......: 934 | ; Link ..........: https://www.autoitscript.com/forum/topic/211196-gui-title-bar-dark-theme-an-elegant-solution-using-dwmapi/ 935 | ; Example .......: No 936 | ; =============================================================================================================================== 937 | Func _GUISetDarkTheme($hWnd, $bEnableDarkTheme = True) 938 | Local $iPreferredAppMode = ($bEnableDarkTheme == True) ? $APPMODE_FORCEDARK : $APPMODE_FORCELIGHT 939 | Local $iGUI_BkColor = ($bEnableDarkTheme == True) ? $GUIDARKMODE_COLOR_GUIBK : _WinAPI_SwitchColor(_WinAPI_GetSysColor($COLOR_3DFACE)) 940 | _WinAPI_SetPreferredAppMode($iPreferredAppMode) 941 | _WinAPI_RefreshImmersiveColorPolicyState() 942 | _WinAPI_FlushMenuThemes() 943 | GUISetBkColor($iGUI_BkColor, $hWnd) 944 | _GUICtrlSetDarkTheme($hWnd, $bEnableDarkTheme) ;To Color the GUI's own Scrollbar 945 | ;~ DllCall('dwmapi.dll', 'long', 'DwmSetWindowAttribute', 'hwnd', $hWnd, 'dword', $DWMWA_USE_IMMERSIVE_DARK_MODE, 'dword*', Int($bEnableDarkTheme), 'dword', 4) 946 | _WinAPI_DwmSetWindowAttribute_unr($hWnd, $DWMWA_USE_IMMERSIVE_DARK_MODE, $bEnableDarkTheme) 947 | EndFunc ;==>_GUISetDarkTheme 948 | 949 | ; #FUNCTION# ==================================================================================================================== 950 | ; Name ..........: _GUICtrlAllSetDarkTheme 951 | ; Description ...: Sets the dark theme to all existing sub Controls from a GUI 952 | ; Syntax ........: _GUICtrlAllSetDarkTheme($hGUI[, $bEnableDarkTheme = True]) 953 | ; Parameters ....: $hGUI - GUI handle 954 | ; $bEnableDarkTheme - [optional] a boolean value. Default is True. 955 | ; Return values .: None 956 | ; Author ........: NoName 957 | ; Modified ......: 958 | ; Remarks .......: 959 | ; Related .......: 960 | ; Link ..........: 961 | ; Example .......: No 962 | ; =============================================================================================================================== 963 | Func _GUICtrlAllSetDarkTheme($hGUI, $bEnableDarkTheme = True) 964 | Local $aCtrls = _WinAPI_EnumChildWindows($hGUI, False) 965 | If @error Then 966 | Dim $aCtrls[1][2] = [[0]] 967 | Return SetError(1, UBound($aCtrls) - 1, $aCtrls) 968 | EndIf 969 | For $i = 1 To $aCtrls[0][0] 970 | _GUICtrlSetDarkTheme($aCtrls[$i][0], $bEnableDarkTheme) 971 | Next 972 | Return $aCtrls 973 | EndFunc ;==>_GUICtrlAllSetDarkTheme 974 | 975 | ; #FUNCTION# ==================================================================================================================== 976 | ; Name ..........: _GUICtrlSetDarkTheme 977 | ; Description ...: Sets the dark theme for a specified control. 978 | ; Syntax ........: _GUICtrlSetDarkTheme($vCtrl, $bEnableDarkTheme = True) 979 | ; Parameters ....: $vCtrl - The control handle or identifier. 980 | ; $bEnableDarkTheme - If True, enables the dark theme; if False, disables it. 981 | ; (Default is True for enabling dark theme.) 982 | ; Return values .: Success: True 983 | ; Failure: False and sets the @error flag: 984 | ; 1: Invalid control handle or identifier. 985 | ; 2: Error while allowing dark mode for the window. 986 | ; 3: Error while setting the window theme. 987 | ; 4: Error while sending the WM_THEMECHANGED message. 988 | ; Author ........: NoNameCode 989 | ; Modified ......: 990 | ; Remarks .......: This function requires the _WinAPI_SetWindowTheme and _WinAPI_AllowDarkModeForWindow functions. 991 | ; Related .......: 992 | ; Link ..........: http://www.opengate.at/blog/2021/08/dark-mode-win32/ 993 | ; Example .......: Yes 994 | ; =============================================================================================================================== 995 | Global $iGUI_Ctrl_Color = -2, $iGUI_Ctrl_BkColor = -2 996 | Func _GUICtrlSetDarkTheme($vCtrl, $bEnableDarkTheme = True) 997 | Local $sThemeName = Null, $sThemeList = Null 998 | $iGUI_Ctrl_Color = ($bEnableDarkTheme == True) ? $GUIDARKMODE_COLOR_GUICTRL : _WinAPI_SwitchColor(_WinAPI_GetSysColor($COLOR_WINDOWTEXT)) 999 | $iGUI_Ctrl_BkColor = ($bEnableDarkTheme == True) ? $GUIDARKMODE_COLOR_GUICTRLBK : _WinAPI_SwitchColor(_WinAPI_GetSysColor($COLOR_BTNFACE)) 1000 | ;~ If Not IsHWnd($vCtrl) Then $vCtrl = GUICtrlGetHandle($vCtrl) 1001 | ;~ If Not IsHWnd($vCtrl) Then Return SetError(1, 0, False) 1002 | _WinAPI_AllowDarkModeForWindow($vCtrl, $bEnableDarkTheme) 1003 | If @error <> 0 Then 1004 | ConsoleWrite('! _GUICtrlSetDarkTheme: _WinAPI_AllowDarkModeForWindow: FAILED @ ' & $vCtrl & @CRLF) 1005 | Return SetError(2, @error, False) 1006 | EndIf 1007 | 1008 | ;========= 1009 | ;~ _WinAPI_SetWindowTheme_unr($vCtrl, 0, 0) ; argu Testing 1010 | ;~ ConsoleWrite(@CRLF & _WinAPI_GetClassName($vCtrl)) 1011 | Local $sStyles = hWnd2Styles($vCtrl) 1012 | 1013 | Switch _WinAPI_GetClassName($vCtrl) 1014 | Case 'Button' 1015 | If StringInStr($sStyles, "BS_AUTORADIOBUTTON") Or StringInStr($sStyles, "BS_GROUPBOX") Or StringInStr($sStyles, "BS_AUTOCHECKBOX") Or StringInStr($sStyles, "LVS_EX_CHECKBOXES") And $isDarkMode = True Then 1016 | $sThemeName = "DarkMode_Explorer" 1017 | ElseIf StringInStr($sStyles, "BS_AUTORADIOBUTTON") Or StringInStr($sStyles, "BS_GROUPBOX") Or StringInStr($sStyles, "BS_AUTOCHECKBOX") Or StringInStr($sStyles, "LVS_EX_CHECKBOXES") And $isDarkMode = False Then 1018 | $sThemeName = "Explorer" 1019 | ConsoleWrite('>' & $sStyles & '<' & @CRLF) 1020 | If Not StringInStr($sStyles, "BS_PUSHLIKE") Then _WinAPI_SetWindowTheme($vCtrl, "", "") 1021 | ;~ DllCall("UxTheme.dll", "int", "SetWindowTheme", "hwnd", $vCtrl, "wstr", 0, "wstr", 0) 1022 | GUICtrlSetColor(_WinAPI_GetDlgCtrlID($vCtrl), $iGUI_Ctrl_Color) 1023 | GUICtrlSetBkColor(_WinAPI_GetDlgCtrlID($vCtrl), $iGUI_Ctrl_BkColor) 1024 | Else 1025 | If $isDarkMode = True Then 1026 | $sThemeName = 'DarkMode_Explorer' 1027 | Else 1028 | $sThemeName = 'Explorer' 1029 | EndIf 1030 | EndIf 1031 | 1032 | 1033 | Case 'AutoIt v3 GUI' 1034 | $sThemeName = 'DarkMode_Explorer' 1035 | 1036 | Case 'ComboBox' ;,'Edit' 1037 | If $isDarkMode = True Then 1038 | $sThemeName = 'DarkMode_CFD' 1039 | Else 1040 | $sThemeName = 'CFD' 1041 | EndIf 1042 | GUICtrlSetColor(_WinAPI_GetDlgCtrlID($vCtrl), $iGUI_Ctrl_Color) 1043 | GUICtrlSetBkColor(_WinAPI_GetDlgCtrlID($vCtrl), $iGUI_Ctrl_BkColor) 1044 | Case 'SysHeader32' 1045 | $sThemeName = 'ItemsView' 1046 | $sThemeList = 'Header' 1047 | Case 'ListBox', 'SysTreeView32', 'SysListView32', 'Edit', 'msctls_trackbar32' 1048 | If $isDarkMode = True Then 1049 | $sThemeName = 'DarkMode_Explorer' 1050 | Else 1051 | $sThemeName = 'Explorer' 1052 | EndIf 1053 | ;~ $sThemeList = 0 ; failed 1054 | GUICtrlSetColor(_WinAPI_GetDlgCtrlID($vCtrl), $iGUI_Ctrl_Color) 1055 | GUICtrlSetBkColor(_WinAPI_GetDlgCtrlID($vCtrl), $iGUI_Ctrl_BkColor) 1056 | Case 'Static' 1057 | GUICtrlSetColor(_WinAPI_GetDlgCtrlID($vCtrl), $iGUI_Ctrl_Color ) ; $iGUI_Ctrl_Color 1058 | Case 'SysDateTimePick32' 1059 | ;Right now; no solution 1060 | ;~ _WinAPI_SetWindowTheme($vCtrl, "", "") 1061 | Case 'SysTabControl32' 1062 | _WinAPI_SetWindowTheme($vCtrl, "", "") 1063 | 1064 | $sThemeName = 'DarkMode' 1065 | ;~ $sThemeName = 'DarkMode_Explorer' 1066 | ;~ $sThemeList = 'ExplorerStatusBar' ;=> Favorite 1067 | $sThemeList = 'FileExplorerBannerContainer' ;=> Favorite 1068 | ;~ $sThemeList = 'ItemsView' 1069 | ;~ $sThemeList = 'Menu' 1070 | ;~ $sThemeList = 'Toolbar' 1071 | GUICtrlSetColor(_WinAPI_GetDlgCtrlID($vCtrl), $iGUI_Ctrl_Color) 1072 | GUICtrlSetBkColor(_WinAPI_GetDlgCtrlID($vCtrl), $iGUI_Ctrl_BkColor) 1073 | 1074 | 1075 | GUICtrlSetColor(_WinAPI_GetDlgCtrlID($vCtrl), $iGUI_Ctrl_Color) 1076 | GUICtrlSetBkColor(_WinAPI_GetDlgCtrlID($vCtrl), $iGUI_Ctrl_BkColor) 1077 | ;Right now; no solution 1078 | Case 'Scrollbar' 1079 | $sThemeName = 'DarkMode_Explorer' 1080 | ;~ $sThemeName = 'DarkMode_CFD' 1081 | ;~ $sThemeName = 'DarkMode' 1082 | ;~ GUICtrlSetBkColor(_WinAPI_GetDlgCtrlID($vCtrl), $iGUI_Ctrl_BkColor) 1083 | ;~ GUICtrlSetBkColor($vCtrl, $iGUI_Ctrl_BkColor) 1084 | ;~ GUISetBkColor($iGUI_Ctrl_BkColor, $vCtrl) 1085 | 1086 | Case Else 1087 | If $sThemeName = Null Then $sThemeName = 'Explorer' 1088 | EndSwitch 1089 | ConsoleWrite(@CRLF & 'Class:' & _WinAPI_GetClassName($vCtrl) & ' Theme:' & $sThemeName & '::' & $sThemeList & @TAB & ControlGetText($vCtrl, "", 0) & @TAB & hWnd2Styles($vCtrl)) 1090 | ;========= 1091 | If $sThemeName = "" Then Return True 1092 | _WinAPI_SetWindowTheme_unr($vCtrl, $sThemeName, $sThemeList) 1093 | If @error <> 0 Then Return SetError(3, @error, False) 1094 | _SendMessage($vCtrl, $WM_THEMECHANGED, 0, 0) 1095 | If @error <> 0 Then Return SetError(4, @error, False) 1096 | Return True 1097 | EndFunc ;==>_GUICtrlSetDarkTheme 1098 | 1099 | ;//Testting 1100 | Func _GUICtrlSetDarkThemeEx($vCtrl, $sThemeName = Null, $sThemeList = Null, $bEnableDarkTheme = True) 1101 | If Not IsHWnd($vCtrl) Then $vCtrl = GUICtrlGetHandle($vCtrl) 1102 | If Not IsHWnd($vCtrl) Then Return SetError(1, 0, False) 1103 | _WinAPI_AllowDarkModeForWindow($vCtrl, $bEnableDarkTheme) 1104 | If @error <> 0 Then Return SetError(2, @error, False) 1105 | _WinAPI_SetWindowTheme_unr($vCtrl, $sThemeName, $sThemeList) 1106 | If @error <> 0 Then Return SetError(3, @error, False) 1107 | _SendMessage($vCtrl, $WM_THEMECHANGED, 0, 0) 1108 | If @error <> 0 Then Return SetError(4, @error, False) 1109 | Return True 1110 | EndFunc ;==>_GUICtrlSetDarkThemeEx 1111 | 1112 | #EndRegion Public Functions 1113 | 1114 | #Region Internal Functions 1115 | 1116 | 1117 | ; #FUNCTION# ==================================================================================================================== 1118 | ; Name ..........: _WinAPI_SetWindowTheme_unr 1119 | ; Description ...: Dose the same as _WinAPI_SetWindowTheme; But has no Restrictions 1120 | ; Syntax ........: _WinAPI_SetWindowTheme_unr($hWnd[, $sName = Null[, $sList = Null]]) 1121 | ; Parameters ....: $hWnd - a handle value. 1122 | ; $sName - [optional] a string value. Default is Null. 1123 | ; $sList - [optional] a string value. Default is Null. 1124 | ; Return values .: Success: 1 Failure: @error, @extended & False 1125 | ; Author ........: argumentum 1126 | ; Modified ......: 1127 | ; Remarks .......: 1128 | ; Related .......: 1129 | ; Link ..........: https://www.autoitscript.com/forum/topic/211475-winapithemeex-darkmode-for-autoits-win32guis/?do=findComment&comment=1530103 1130 | ; Example .......: No 1131 | ; =============================================================================================================================== 1132 | Func _WinAPI_SetWindowTheme_unr($hWnd, $sName = Null, $sList = Null) ; #include ; unthoughtful unrestricting mod. 1133 | Local $sResult = DllCall('UxTheme.dll', 'long', 'SetWindowTheme', 'hwnd', $hWnd, 'wstr', $sName, 'wstr', $sList) 1134 | If @error Then Return SetError(@error, @extended, 0) 1135 | If $sResult[0] Then Return SetError(10, $sResult[0], 0) 1136 | Return 1 1137 | EndFunc ;==>_WinAPI_SetWindowTheme_unr 1138 | 1139 | ; #FUNCTION# ==================================================================================================================== 1140 | ; Name ..........: _WinAPI_DwmSetWindowAttribute_unr 1141 | ; Description ...: Dose the same as _WinAPI_DwmSetWindowAttribute; But has no Restrictions 1142 | ; Syntax ........: _WinAPI_DwmSetWindowAttribute_unr($hWnd, $iAttribute, $iData) 1143 | ; Parameters ....: $hWnd - a handle value. 1144 | ; $iAttribute - an integer value. 1145 | ; $iData - an integer value. 1146 | ; Return values .: Success: 1 Failure: @error, @extended & False 1147 | ; Author ........: argumentum 1148 | ; Modified ......: 1149 | ; Remarks .......: 1150 | ; Related .......: 1151 | ; Link ..........: https://www.autoitscript.com/forum/topic/211475-winapithemeex-darkmode-for-autoits-win32guis/?do=findComment&comment=1530103 1152 | ; Example .......: No 1153 | ; =============================================================================================================================== 1154 | Func _WinAPI_DwmSetWindowAttribute_unr($hWnd, $iAttribute, $iData) ; #include ; unthoughtful unrestricting mod. 1155 | Local $aCall = DllCall('dwmapi.dll', 'long', 'DwmSetWindowAttribute', 'hwnd', $hWnd, 'dword', $iAttribute, _ 1156 | 'dword*', $iData, 'dword', 4) 1157 | If @error Then Return SetError(@error, @extended, 0) 1158 | If $aCall[0] Then Return SetError(10, $aCall[0], 0) 1159 | Return 1 1160 | EndFunc ;==>_WinAPI_DwmSetWindowAttribute_unr 1161 | 1162 | #EndRegion Internal Functions 1163 | 1164 | #Region Experimental Functions 1165 | 1166 | ;~ Func FixDarkScrollBar() 1167 | ;~ Local $hComctl = _WinAPI_GetModuleHandle("comctl32.dll") 1168 | ;~ If $hComctl Then 1169 | ;~ Local $addr = _FindDelayLoadThunkInModule($hComctl, $UxThemeDLL, $OpenNcThemeDataOrdinal) 1170 | ;~ If $addr Then 1171 | ;~ Local $oldProtect, $MyOpenThemeData 1172 | 1173 | ;~ If _WinAPI_VirtualProtect($addr, DllStructGetSize(DllStructCreate("ptr")), $PAGE_READWRITE, $oldProtect) Then 1174 | ;~ $MyOpenThemeData = DLLCallbackRegister("_Modifyed_OpenNcThemeData", "lresult", "hwnd;wstr") 1175 | ;~ DllStructSetData(DllStructCreate("ptr", $addr), 1, $MyOpenThemeData) 1176 | ;~ _WinAPI_VirtualProtect($addr, DllStructGetSize(DllStructCreate("ptr")), $oldProtect, 0) 1177 | ;~ EndIf 1178 | ;~ EndIf 1179 | ;~ EndIf 1180 | ;~ EndFunc 1181 | 1182 | 1183 | ;~ Func _Modifyed_OpenNcThemeData($hWnd, $classList) 1184 | ;~ If StringCompare($classList, "ScrollBar") = 0 Then 1185 | ;~ $hWnd = 0 1186 | ;~ $classList = "Explorer::ScrollBar" 1187 | ;~ EndIf 1188 | ;~ Return _WinAPI_OpenNcThemeData($hWnd, $classList) 1189 | ;~ EndFunc 1190 | 1191 | #EndRegion Experimental Functions 1192 | 1193 | 1194 | #Region Enable GUI DARKMODE 1195 | 1196 | Func GuiDarkmodeApply($hGUI) 1197 | _GUISetDarkTheme($hGUI) 1198 | _GUICtrlAllSetDarkTheme($hGUI) 1199 | ConsoleWrite(@CRLF & '+ _GUICtrlAllSetDarkTheme: ' & @error & ',' & @extended & @CRLF) 1200 | EndFunc 1201 | 1202 | #EndRegion Enable GUI DARKMODE 1203 | 1204 | #Region Enable GUI LIGHTMODE 1205 | 1206 | Func GuiLightmodeApply($hGUI) 1207 | $bEnableDarkTheme = False 1208 | _GUISetDarkTheme($hGUI, $bEnableDarkTheme) 1209 | _GUICtrlAllSetDarkTheme($hGUI, $bEnableDarkTheme) 1210 | ConsoleWrite(@CRLF & '+ _GUICtrlAllSetDarkTheme: ' & @error & ',' & @extended & @CRLF) 1211 | EndFunc 1212 | 1213 | #EndRegion Enable GUI LIGHTMODE 1214 | 1215 | -------------------------------------------------------------------------------- /include/GUIFrame.au3: -------------------------------------------------------------------------------- 1 | #include-once 2 | 3 | ; #INDEX# ============================================================================================================ 4 | ; Title .........: GUIFrame 5 | ; AutoIt Version : 3.3 + 6 | ; Language ......: English 7 | ; Description ...: Splits a GUI into slideable and resizable 2 part frames which can be further split if required 8 | ; Remarks .......: - The UDF uses OnAutoItExitRegister to call _GUIFrame_Exit to delete subclassed separator bars 9 | ; using the UDF created WndProc and to release the Callback on exit 10 | ; - The UDF can indicate when a specific fram has been resized 11 | ; - If the script already has a WM_SIZE message handler then do NOT use _GUIFrame_ResizeReg, 12 | ; but call the _GUIFrame_SIZE_Handler function from within the existing handler 13 | ; Author ........: Original UDF by Kip 14 | ; Modified ......; This version by Melba23 - using x64 compatible code drawn from Yashied's WinAPIEx library 15 | ; ==================================================================================================================== 16 | 17 | ; #AutoIt3Wrapper_Au3Check_Parameters=-d -w 1 -w 2 -w 3 -w- 4 -w 5 -w 6 -w- 7 18 | 19 | ; #INCLUDES# ========================================================================================================= 20 | #include 21 | 22 | ; #GLOBAL VARIABLES# ================================================================================================= 23 | 24 | ; Array to hold handles for each frame set 25 | Global $aGF_HandleIndex[1][8] = [[0, 0, 0]] 26 | ; [0][0] = 0 ; Count of frames [0][1] = Move registered flag 27 | ; 28 | ; [n][0] = Parent GUI handle [n][4] = Original GUI handle 29 | ; [n][1] = First frame handle [n][5] = Indices of first frame internal frames 30 | ; [n][2] = Second frame handle [n][6] = Indices of second frame internal frames 31 | ; [n][3] = Separator bar handle [n][7] = Frame resize flag 32 | 33 | ; Array to hold sizing percentages for each frame set 34 | Global $aGF_SizingIndex[1][8] 35 | ; [n][0] = First frame min [n][2] = X coord [n][4] = Width [n][6] = Seperator percentage position 36 | ; [n][1] = Second frame min [n][3] = Y coord [n][5] = Height [n][7] = Resize type (0/1/2) 37 | 38 | ; Array to hold other settings for each frame set 39 | Global $aGF_SettingsIndex[1][3] 40 | ; [n][0] = Separator orientation (vert/horz = 0/1) 41 | ; [n][1] = Resizable frame flag (0/1) 42 | ; [n][2] = Separator size (default = 5) 43 | 44 | ; Array to hold WinProc handles for each separator 45 | Global $aGF_SepProcIndex[1][2] = [[0, 0]] 46 | 47 | ; Store registered Callback handle 48 | Global $hGF_RegCallBack = DllCallbackRegister("_GUIFrame_SepWndProc", "lresult", "hwnd;uint;wparam;lparam") 49 | $aGF_SepProcIndex[0][1] = DllCallbackGetPtr($hGF_RegCallBack) 50 | 51 | ; #ONAUTOITEXIT FUNCTIONS# =========================================================================================== 52 | OnAutoItExitRegister("_GUIFrame_Exit") 53 | 54 | ; #CURRENT# ========================================================================================================== 55 | ; _GUIFrame_Create: Splits a GUI into 2 frames 56 | ; _GUIFrame_SetMin: Sets minimum sizes for each frame 57 | ; _GUIFrame_ResizeSet: Sets resizing flag for all or specified frame sets 58 | ; _GUIFrame_GetHandle: Returns the handle of a frame element (required for further splitting) 59 | ; _GUIFrame_Switch: Sets a frame element as current GUI 60 | ; _GUIFrame_GetSepPos: Returns the current position of the separator 61 | ; _GUIFrame_SetSepPos: Moves the separator bar to adjust frame sizes 62 | ; _GUIFrame_ResizeState: Returns the resize state of the frames 63 | ; _GUIFrame_ResizeReg: Registers WM_SIZE message for resizing 64 | ; _GUIFrame_SIZE_Handler: WM_SIZE message handler to resize frames using _GUIFrame_Move 65 | ; ==================================================================================================================== 66 | 67 | ; #INTERNAL_USE_ONLY#================================================================================================= 68 | ; _GUIFrame_SepSubClass: Sets new WndProc for frame separator bar 69 | ; _GUIFrame_SepWndProc: New WndProc for frame separator bar 70 | ; _GUIFrame_SepPassMsg: Passes Msg to original frame WndProc for action 71 | ; _GUIFrame_Move: Moves and resizes frame elements and separator bars 72 | ; _GUIFrame_Exit: Deletes all subclassed separator bars to free UDF WndProc and frees registered callback handle 73 | ; ==================================================================================================================== 74 | 75 | ; #FUNCTION# ========================================================================================================= 76 | ; Name...........: _GUIFrame_Create 77 | ; Description ...: Splits a GUI into 2 frames 78 | ; Syntax.........: _GUIFrame_Create($hWnd, $iSepOrient = 0, $iSepPos = 0, $iSepSize = 5, $iX = 0, $iY = 0, $iWidth = 0, $iHeight = 0, $iStyle = 0, $iExStyle = 0, $fShowWindow) 79 | ; Parameters ....: $hWnd - Handle of GUI to split 80 | ; $iSepOrient - Orientation of separator bar: 0 = Vertical (default), 1 = Horizontal 81 | ; $iSepPos - Required initial position of separator (default = centre of frame GUI) 82 | ; $iSepSize - Size of separator bar (default = 5, min = 3, max = 9) 83 | ; $iX - Left of frame area (default = 0) 84 | ; $iY - Top of frame area (default = 0) 85 | ; $iWidth - Width of frame area (default = full width) 86 | ; $iHeight - Height of frame area (default = full height) 87 | ; SiStyle - Required style value for frame elements 88 | ; SiExStyle - Required extended style value for frame elements 89 | ; $fShowWindow - True = Use API call to display frame if not displayed on start 90 | ; - False (default) - Do not use API call 91 | ; Requirement(s).: v3.3 + 92 | ; Return values .: Success: Returns index number of frame/separator set 93 | ; Failure: Returns 0 and sets @error as follows: 94 | ; 1 = Deprecated 95 | ; 2 = GUI creation failed 96 | ; 2 = Separator subclassing failed 97 | ; Author ........: Kip 98 | ; Modified ......: Melba23 99 | ; Remarks .......: 100 | ; Example........: Yes 101 | ;===================================================================================================================== 102 | Func _GUIFrame_Create($hWnd, $iSepOrient = 0, $iSepPos = 0, $iSepSize = 5, $iX = 0, $iY = 0, $iOrg_Width = 0, $iOrg_Height = 0, $iStyle = 0, $iExStyle = 0, $fShowWindow = False) 103 | 104 | Local $iSeperator_Pos, $hSeparator, $hFirstFrame, $hSecondFrame, $nSepPercent 105 | 106 | ; Set separator size 107 | Local $iSeparatorSize = 3 108 | Switch $iSepSize 109 | Case 3 To 9 110 | $iSeparatorSize = $iSepSize 111 | EndSwitch 112 | 113 | ; Set default sizing if no parameters set 114 | Local $iWidth = $iOrg_Width 115 | Local $iHeight = $iOrg_Height 116 | Local $aFullSize = WinGetClientSize($hWnd) 117 | If Not $iOrg_Width Then $iWidth = $aFullSize[0] 118 | If Not $iOrg_Height Then $iHeight = $aFullSize[1] 119 | 120 | ; Create parent GUI within client area 121 | Local $hParent = GUICreate("FrameParent", $iWidth, $iHeight, $iX, $iY, BitOR(0x40000000, $iStyle), $iExStyle, $hWnd) ; $WS_CHILD 122 | If $fShowWindow Then _WinAPI_ShowWindow($hParent, @SW_SHOW) ; Possible fix if frames do not display on start 123 | If $isDarkMode = True Then 124 | GuiDarkmodeApply($hParent) 125 | Else 126 | Local $bEnableDarkTheme = False 127 | GuiLightmodeApply($hParent) 128 | EndIf 129 | GUISetState(@SW_SHOW, $hParent) 130 | 131 | ; Confirm size of frame parent client area 132 | Local $aSize = WinGetClientSize($hParent) 133 | $iWidth = $aSize[0] 134 | $iHeight = $aSize[1] 135 | 136 | If $iSepOrient = 0 Then 137 | 138 | ; Set initial separator position 139 | $iSeperator_Pos = $iSepPos 140 | ; Adjust position if not within GUI or default set (=0) 141 | If $iSepPos > $iWidth Or $iSepPos < 1 Then 142 | $iSeperator_Pos = Round(($iWidth / 2) - ($iSeparatorSize / 2)) 143 | EndIf 144 | ; Create separator bar and force cursor change over separator 145 | $hSeparator = GUICreate("", $iSeparatorSize, $iHeight, $iSeperator_Pos, 0, 0x40000000, -1, $hParent) ;$WS_CHILD 146 | GUICtrlCreateLabel("", 0, 0, $iSeparatorSize, $iHeight, -1) ; $WS_EX_DLGMODALFRAME 147 | If $isDarkMode = True Then 148 | GUICtrlSetBkColor(-1, 0x505050) 149 | Else 150 | GUICtrlSetBkColor(-1, 0xC0C0C0) 151 | EndIf 152 | GUICtrlSetCursor(-1, 13) 153 | If $isDarkMode = True Then 154 | GuiDarkmodeApply($hSeparator) 155 | Else 156 | Local $bEnableDarkTheme = False 157 | GuiLightmodeApply($hSeparator) 158 | EndIf 159 | GUISetState(@SW_SHOW, $hSeparator) 160 | ; Create the sizable frames 161 | $hFirstFrame = GUICreate("", $iSeperator_Pos, $iHeight, 0, 0, 0x40000000, -1, $hParent) ;$WS_CHILD 162 | If $isDarkMode = True Then 163 | GuiDarkmodeApply($hFirstFrame) 164 | Else 165 | Local $bEnableDarkTheme = False 166 | GuiLightmodeApply($hFirstFrame) 167 | EndIf 168 | GUISetState(@SW_SHOW, $hFirstFrame) 169 | $hSecondFrame = GUICreate("", $iWidth - ($iSeperator_Pos + $iSeparatorSize), $iHeight, $iSeperator_Pos + $iSeparatorSize, 0, 0x40000000, -1, $hParent) ;$WS_CHILD 170 | If $isDarkMode = True Then 171 | GuiDarkmodeApply($hSecondFrame) 172 | Else 173 | Local $bEnableDarkTheme = False 174 | GuiLightmodeApply($hSecondFrame) 175 | EndIf 176 | GUISetState(@SW_SHOW, $hSecondFrame) 177 | ; Set seperator position percentage 178 | $nSepPercent = $iSeperator_Pos / $iWidth 179 | 180 | Else 181 | 182 | $iSeperator_Pos = $iSepPos 183 | If $iSepPos > $iHeight Or $iSepPos < 1 Then 184 | $iSeperator_Pos = Round(($iHeight / 2) - ($iSeparatorSize / 2)) 185 | EndIf 186 | $hSeparator = GUICreate("", $iWidth, $iSeparatorSize, 0, $iSeperator_Pos, 0x40000000, -1, $hParent) ;$WS_CHILD 187 | GUICtrlCreateLabel("", 0, 0, $iWidth, $iSeparatorSize, -1, 0x01) ; $WS_EX_DLGMODALFRAME 188 | GUICtrlSetCursor(-1, 11) 189 | If $isDarkMode = True Then 190 | GuiDarkmodeApply($hSeparator) 191 | Else 192 | Local $bEnableDarkTheme = False 193 | GuiLightmodeApply($hSeparator) 194 | EndIf 195 | GUISetState(@SW_SHOW, $hSeparator) 196 | $hFirstFrame = GUICreate("", $iWidth, $iSeperator_Pos, 0, 0, 0x40000000, -1, $hParent) ;$WS_CHILD 197 | If $isDarkMode = True Then 198 | GuiDarkmodeApply($hFirstFrame) 199 | Else 200 | Local $bEnableDarkTheme = False 201 | GuiLightmodeApply($hFirstFrame) 202 | EndIf 203 | GUISetState(@SW_SHOW, $hFirstFrame) 204 | $hSecondFrame = GUICreate("", $iWidth, $iHeight - ($iSeperator_Pos + $iSeparatorSize), 0, $iSeperator_Pos + $iSeparatorSize, 0x40000000, -1, $hParent) ;$WS_CHILD 205 | If $isDarkMode = True Then 206 | GuiDarkmodeApply($hSecondFrame) 207 | Else 208 | Local $bEnableDarkTheme = False 209 | GuiLightmodeApply($hSecondFrame) 210 | EndIf 211 | GUISetState(@SW_SHOW, $hSecondFrame) 212 | $nSepPercent = $iSeperator_Pos / $iHeight 213 | 214 | EndIf 215 | 216 | ; Check for error creating GUIs 217 | If $hParent = 0 Or $hSeparator = 0 Or $hFirstFrame = 0 Or $hSecondFrame = 0 Then 218 | ; Delete all GUIs and return error 219 | GUIDelete($hParent) 220 | GUIDelete($hSeparator) 221 | GUIDelete($hFirstFrame) 222 | GUIDelete($hSecondFrame) 223 | Return SetError(2, 0, 0) 224 | EndIf 225 | 226 | ; Subclass the separator 227 | If _GUIFrame_SepSubClass($hSeparator) = 0 Then 228 | ; If Subclassing failed then delete all GUIs and return error 229 | GUIDelete($hParent) 230 | GUIDelete($hSeparator) 231 | GUIDelete($hFirstFrame) 232 | GUIDelete($hSecondFrame) 233 | Return SetError(3, 0, 0) 234 | EndIf 235 | 236 | ; Create new lines in the storage arrays for this frame set 237 | Local $iIndex = $aGF_HandleIndex[0][0] + 1 238 | ReDim $aGF_HandleIndex[$iIndex + 1][8] 239 | ReDim $aGF_SizingIndex[$iIndex + 1][8] 240 | ReDim $aGF_SettingsIndex[$iIndex + 1][3] 241 | 242 | ; Store this frame set handles/variables/defaults in the new lines 243 | $aGF_HandleIndex[0][0] = $iIndex 244 | $aGF_HandleIndex[$iIndex][0] = $hParent 245 | $aGF_HandleIndex[$iIndex][1] = $hFirstFrame 246 | $aGF_HandleIndex[$iIndex][2] = $hSecondFrame 247 | $aGF_HandleIndex[$iIndex][3] = $hSeparator 248 | $aGF_HandleIndex[$iIndex][4] = $hWnd 249 | $aGF_HandleIndex[$iIndex][5] = 0 250 | $aGF_HandleIndex[$iIndex][6] = 0 251 | $aGF_SizingIndex[$iIndex][0] = 0 252 | $aGF_SizingIndex[$iIndex][1] = 0 253 | $aGF_SizingIndex[$iIndex][6] = $nSepPercent 254 | $aGF_SettingsIndex[$iIndex][0] = $iSepOrient 255 | $aGF_SettingsIndex[$iIndex][1] = 0 256 | $aGF_SettingsIndex[$iIndex][2] = $iSeparatorSize 257 | 258 | ; Store this frame index in parent line if parent is an existing frame 259 | For $i = 1 To $aGF_HandleIndex[0][0] - 1 260 | If $aGF_HandleIndex[$i][1] = $hWnd Then 261 | If $aGF_HandleIndex[$i][5] = 0 Then 262 | $aGF_HandleIndex[$i][5] = $iIndex 263 | Else 264 | $aGF_HandleIndex[$i][5] &= "|" & $iIndex 265 | EndIf 266 | ExitLoop 267 | EndIf 268 | If $aGF_HandleIndex[$i][2] = $hWnd Then 269 | If $aGF_HandleIndex[$i][6] = 0 Then 270 | $aGF_HandleIndex[$i][6] = $iIndex 271 | Else 272 | $aGF_HandleIndex[$i][6] &= "|" & $iIndex 273 | EndIf 274 | ExitLoop 275 | EndIf 276 | Next 277 | 278 | ; Store coordinate and size fractions 279 | If $iX Then 280 | $aGF_SizingIndex[$iIndex][2] = $iX / $aFullSize[0] 281 | Else 282 | $aGF_SizingIndex[$iIndex][2] = 0 283 | EndIf 284 | If $iY Then 285 | $aGF_SizingIndex[$iIndex][3] = $iY / $aFullSize[1] 286 | Else 287 | $aGF_SizingIndex[$iIndex][3] = 0 288 | EndIf 289 | If $iOrg_Width Then 290 | $aGF_SizingIndex[$iIndex][4] = $iOrg_Width / $aFullSize[0] 291 | Else 292 | $aGF_SizingIndex[$iIndex][4] = 1 293 | EndIf 294 | If $iOrg_Height Then 295 | $aGF_SizingIndex[$iIndex][5] = $iOrg_Height / $aFullSize[1] 296 | Else 297 | $aGF_SizingIndex[$iIndex][5] = 1 298 | EndIf 299 | 300 | ; Switch back to main GUI 301 | GUISwitch($hWnd) 302 | 303 | ; Return the index for this frame 304 | Return $iIndex 305 | 306 | EndFunc ;==>_GUIFrame_Create 307 | 308 | ; #FUNCTION# ========================================================================================================= 309 | ; Name...........: _GUIFrame_SetMin 310 | ; Description ...: Sets minimum sizes for frames 311 | ; Syntax.........: _GUIFrame_SetMin($iFrame, $iFirstMin = 0, $iSecondMin = 0, $fAbsolute = False) 312 | ; Parameters ....: $iFrame - Index of frame set as returned by _GUIFrame_Create 313 | ; $iFirstMin - Min size of first (left/top) frame - max half size 314 | ; $iSecondMin - Min Size of second (right/bottom) frame - max half size 315 | ; $fAbsolute - True = Minima fixed when GUI resized 316 | ; - False = Minima adjusted on resize to equivalent percentage of new GUI size (default) 317 | ; Requirement(s).: v3.3 + 318 | ; Return values .: None 319 | ; Author ........: Melba23 based on some original code by Kip 320 | ; Modified ......: 321 | ; Remarks .......: If the frame is resized, these minima are adjusted accordingly unless $fAbsolute is set 322 | ; Example........: Yes 323 | ;===================================================================================================================== 324 | Func _GUIFrame_SetMin($iFrame, $iFirstMin = 0, $iSecondMin = 0, $fAbsolute = False) 325 | 326 | ; Check for valid frame index 327 | If $iFrame < 1 Or $iFrame > $aGF_HandleIndex[0][0] Then Return 0 328 | ; Get size of parent 329 | Local $aSize = WinGetClientSize($aGF_HandleIndex[$iFrame][0]) 330 | ; Now check orientation and determine 331 | Local $iMax, $iFullSize 332 | If $aGF_SettingsIndex[$iFrame][0] = 0 Then 333 | $iMax = Floor(($aSize[0] / 2) - $aGF_SettingsIndex[$iFrame][2]) 334 | $iFullSize = $aSize[0] 335 | Else 336 | $iMax = Floor(($aSize[1] / 2) - $aGF_SettingsIndex[$iFrame][2]) 337 | $iFullSize = $aSize[1] 338 | EndIf 339 | ; Set minimums 340 | If $fAbsolute Then 341 | $aGF_SizingIndex[$iFrame][0] = Int($iFirstMin) 342 | $aGF_SizingIndex[$iFrame][1] = Int($iSecondMin) 343 | Else 344 | If $iFirstMin > $iMax Then 345 | $aGF_SizingIndex[$iFrame][0] = $iMax / $iFullSize 346 | Else 347 | $aGF_SizingIndex[$iFrame][0] = $iFirstMin / $iFullSize 348 | EndIf 349 | If $iSecondMin > $iMax Then 350 | $aGF_SizingIndex[$iFrame][1] = $iMax / $iFullSize 351 | Else 352 | $aGF_SizingIndex[$iFrame][1] = $iSecondMin / $iFullSize 353 | EndIf 354 | EndIf 355 | 356 | EndFunc ;==>_GUIFrame_SetMin 357 | 358 | ; #FUNCTION# ========================================================================================================= 359 | ; Name...........: _GUIFrame_ResizeSet 360 | ; Description ...: Sets resizing flag for frames 361 | ; Syntax.........: _GUIFrame_ResizeSet($iFrame = 0[, $iType = 0]) 362 | ; Parameters ....: $iFrame - Index of frame set as returned by _GUIFrame_Create (Default - 0 = all existing frames) 363 | ; $iType - Separator behaviour on GUI resize 364 | ; 0 = Frames retain percentage size (default) 365 | ; 1 = Top/left frame fixed size 366 | ; 2 = Bottom/right frame fixed size 367 | ; Requirement(s).: v3.3 + 368 | ; Return values .: Success: 2 - All existing frame flags set 369 | ; 1 - Specified flag set 370 | ; Failure: 0 with @error set to: 371 | ; 1 - Invalid frame specified 372 | ; 2 - Invalid type parameter 373 | ; Author ........: Melba23 374 | ; Modified ......: 375 | ; Remarks .......: 376 | ; Example........: Yes 377 | ;===================================================================================================================== 378 | Func _GUIFrame_ResizeSet($iFrame = 0, $iType = 0) 379 | 380 | Switch $iType 381 | Case 0, 1, 2 382 | ; Valid 383 | Case Else 384 | Return SetError(2, 0, 0) 385 | EndSwitch 386 | 387 | Switch $iFrame 388 | Case 0 ; Set all frames 389 | For $i = 1 To $aGF_HandleIndex[0][0] 390 | $aGF_SettingsIndex[$i][1] = 1 391 | $aGF_SizingIndex[$i][7] = $iType 392 | Next 393 | Return 2 394 | Case 1 To $aGF_HandleIndex[0][0] ; Only valid frames accepted 395 | $aGF_SettingsIndex[$iFrame][1] = 1 396 | $aGF_SizingIndex[$iFrame][7] = $iType 397 | Return 1 398 | Case Else ; Error 399 | Return SetError(1, 0, 0) 400 | EndSwitch 401 | 402 | EndFunc ;==>_GUIFrame_ResizeSet 403 | 404 | ; #FUNCTION# ========================================================================================================= 405 | ; Name...........: _GUIFrame_GetHandle 406 | ; Description ...: Returns the handle of a frame element (required for further splitting) 407 | ; Syntax.........: _GUIFrame_GetHandle($iFrame, $iElement) 408 | ; Parameters ....: $iFrame - Index of frame set as returned by _GUIFrame_Create 409 | ; $iElement - 1 = first (left/top) frame, 2 = second (right/bottom) frame 410 | ; Requirement(s).: v3.3 + 411 | ; Return values .: Success: Handle of frame 412 | ; Failure: 0 with @error set as follows 413 | ; 1 - Invalid frame specified 414 | ; 2 - Invalid element specified 415 | ; Author ........: Kip 416 | ; Modified ......: Melba23 417 | ; Remarks .......: _GUIFrame_Create requires a GUI handle as a parameter 418 | ; Example........: Yes 419 | ;===================================================================================================================== 420 | Func _GUIFrame_GetHandle($iFrame, $iElement) 421 | 422 | ; Check valid frame index and element 423 | Switch $iFrame 424 | Case 1 To $aGF_HandleIndex[0][0] 425 | Switch $iElement 426 | Case 1, 2 427 | ; Return handle 428 | Return $aGF_HandleIndex[$iFrame][$iElement] 429 | EndSwitch 430 | Return SetError(2, 0, 0) 431 | EndSwitch 432 | Return SetError(1, 0, 0) 433 | 434 | EndFunc ;==>_GUIFrame_GetHandle 435 | 436 | ; #FUNCTION# ========================================================================================================= 437 | ; Name...........: _GUIFrame_Switch 438 | ; Description ...: Sets a frame element as current GUI 439 | ; Syntax.........: _GUIFrame_Switch($iFrame, $iElement) 440 | ; Parameters ....: $iFrame - Index of frame set as returned by _GUIFrame_Create 441 | ; $iElement - 1 = first (left/top) frame, 2 = second (right/bottom) frame 442 | ; Requirement(s).: v3.3 + 443 | ; Return values .: None 444 | ; Author ........: Kip 445 | ; Modified ......: Melba23 446 | ; Remarks .......: Subsequent controls are created in the specified frame element 447 | ; Example........: Yes 448 | ;===================================================================================================================== 449 | Func _GUIFrame_Switch($iFrame, $iElement) 450 | 451 | ; Check valid frame index and element 452 | Switch $iFrame 453 | Case 1 To $aGF_HandleIndex[0][0] 454 | Switch $iElement 455 | Case 1, 2 456 | ; Switch to specified element 457 | Return GUISwitch($aGF_HandleIndex[$iFrame][$iElement]) 458 | EndSwitch 459 | Return SetError(2, 0, 0) 460 | EndSwitch 461 | Return SetError(1, 0, 0) 462 | 463 | EndFunc ;==>_GUIFrame_Switch 464 | 465 | ; #FUNCTION# ========================================================================================================= 466 | ; Name...........: _GUIFrame_GetSepPos() 467 | ; Description ...: Returns the current position of the separator 468 | ; Syntax.........: _GUIFrame_GetSepPos($iFrame) 469 | ; Parameters ....: $iFrame - Index of frame set as returned by _GUIFrame_Create 470 | ; Requirement(s).: v3.3 + 471 | ; Return values .: Success: Position of separator 472 | ; Failure: -1 = Invalid frame specified 473 | ; Author ........: Melba23 474 | ; Remarks .......: This value can be stored and used as the initial separator position parameter in _GUIFrame_Create 475 | ; to restore exit position on restart 476 | ; Example........: Yes 477 | ;===================================================================================================================== 478 | Func _GUIFrame_GetSepPos($iFrame) 479 | 480 | Local $iSepPos 481 | 482 | ; Check for valid frame index 483 | If $iFrame < 1 Or $iFrame > $aGF_HandleIndex[0][0] Then Return -1 484 | 485 | ; Get position of first frame 486 | Local $aFrame_Pos = WinGetPos($aGF_HandleIndex[$iFrame][1]) 487 | ; Get position of separator 488 | Local $aSep_Pos = WinGetPos($aGF_HandleIndex[$iFrame][3]) 489 | ; Check on separator orientation 490 | If $aGF_SettingsIndex[$iFrame][0] Then 491 | $iSepPos = $aSep_Pos[1] - $aFrame_Pos[1] 492 | Else 493 | $iSepPos = $aSep_Pos[0] - $aFrame_Pos[0] 494 | EndIf 495 | Return $iSepPos 496 | 497 | EndFunc ;==>_GUIFrame_GetSepPos 498 | 499 | ; #FUNCTION# ========================================================================================================= 500 | ; Name...........: _GUIFrame_SetSepPos() 501 | ; Description ...: Moves the separator bar to adjust frame sizes 502 | ; Syntax.........: _GUIFrame_SetSepPos($iFrame, $iSepPos) 503 | ; Parameters ....: $iFrame - Index of frame set as returned by _GUIFrame_Create 504 | ; $iSepos - Position of separator bar within frame 505 | ; Requirement(s).: v3.3 + 506 | ; Return values .: Success: 1 507 | ; Failure: 0 with @error set as follows 508 | ; 1 - Invalid frame specified 509 | ; 2 - Invalid separator position (outside frame) 510 | ; 3 - Invalid separator position (below frame minimum size) 511 | ; Author ........: Melba23 512 | ; Remarks .......: This value can be stored and used as the initial separator position parameter in _GUIFrame_Create 513 | ; to restore exit position on restart 514 | ; Example........: Yes 515 | ;===================================================================================================================== 516 | Func _GUIFrame_SetSepPos($iFrame, $iSepPos) 517 | 518 | Local $iFirstMin, $iSecondMin 519 | 520 | ; Check for valid frame index 521 | If $iFrame < 1 Or $iFrame > $aGF_HandleIndex[0][0] Then Return SetError(1, 0, 0) 522 | 523 | ; Check separator actually needs to move 524 | If $iSepPos = _GUIFrame_GetSepPos($iFrame) Then Return 1 525 | 526 | ; Get frame GUI size 527 | Local $aWinPos = WinGetPos($aGF_HandleIndex[$iFrame][0]) 528 | ; Depending on separator orientation 529 | If $aGF_SettingsIndex[$iFrame][0] Then 530 | ; Check sep position is valid 531 | If $iSepPos < 0 Or $iSepPos > $aWinPos[3] Then Return SetError(2, 0, 0) 532 | ; Determine minima for frames 533 | $iFirstMin = $aWinPos[3] * $aGF_SizingIndex[$iFrame][0] 534 | $iSecondMin = ($aWinPos[3] * (1 - $aGF_SizingIndex[$iFrame][1])) - $aGF_SettingsIndex[$iFrame][2] 535 | ; Check required value is valid 536 | If $iSepPos < $iFirstMin Or $iSepPos > $iSecondMin Then Return SetError(3, 0, 0) 537 | ; Move frames and seperator 538 | WinMove($aGF_HandleIndex[$iFrame][1], "", 0, 0, $aWinPos[2], $iSepPos) 539 | WinMove($aGF_HandleIndex[$iFrame][2], "", 0, $iSepPos + $aGF_SettingsIndex[$iFrame][2], $aWinPos[2], $aWinPos[3] - ($iSepPos + $aGF_SettingsIndex[$iFrame][2])) 540 | WinMove($aGF_HandleIndex[$iFrame][3], "", 0, $iSepPos, $aWinPos[2], $aGF_SettingsIndex[$iFrame][2]) 541 | ; Store new separator position 542 | $aGF_SizingIndex[$iFrame][6] = $iSepPos / $aWinPos[3] 543 | Else 544 | If $iSepPos < 0 Or $iSepPos > $aWinPos[2] Then Return SetError(2, 0, 0) 545 | $iFirstMin = $aWinPos[2] * $aGF_SizingIndex[$iFrame][0] 546 | $iSecondMin = ($aWinPos[2] * (1 - $aGF_SizingIndex[$iFrame][1])) - $aGF_SettingsIndex[$iFrame][2] 547 | If $iSepPos < $iFirstMin Or $iSepPos > $iSecondMin Then Return SetError(3, 0, 0) 548 | WinMove($aGF_HandleIndex[$iFrame][1], "", 0, 0, $iSepPos, $aWinPos[3]) 549 | WinMove($aGF_HandleIndex[$iFrame][2], "", $iSepPos + $aGF_SettingsIndex[$iFrame][2], 0, $aWinPos[2] - ($iSepPos + $aGF_SettingsIndex[$iFrame][2]), $aWinPos[3]) 550 | WinMove($aGF_HandleIndex[$iFrame][3], "", $iSepPos, 0, $aGF_SettingsIndex[$iFrame][2], $aWinPos[3]) 551 | $aGF_SizingIndex[$iFrame][6] = $iSepPos / $aWinPos[2] 552 | EndIf 553 | 554 | ; Set callback 555 | $aGF_HandleIndex[$iFrame][7] = 1 556 | 557 | Return 1 558 | 559 | EndFunc ;==>_GUIFrame_SetSepPos 560 | 561 | ; #FUNCTION# ========================================================================================================= 562 | ; Name...........: _GUIFrame_ResizeState 563 | ; Description ...: Returns the resize state of the frames 564 | ; Syntax.........: _GUIFrame_ResizeState() 565 | ; Parameters ....: None 566 | ; Requirement(s).: v3.3 + 567 | ; Return values .: Success: Array of frame resize flags 568 | ; Author ........: Melba23 569 | ; Remarks .......: An array is always returned - the user must query the flag for the relevant frame to detect resizing 570 | ; Example........: Yes 571 | ;===================================================================================================================== 572 | Func _GUIFrame_ResizeState() 573 | 574 | ; Create array to hold resize flags 575 | Local $aRet[$aGF_HandleIndex[0][0] + 1] = [0] 576 | For $i = 1 To $aGF_HandleIndex[0][0] 577 | ; Read state 578 | $aRet[$i] = $aGF_HandleIndex[$i][7] 579 | ; Set flag is resized 580 | If $aGF_HandleIndex[$i][7] Then $aRet[0] = 1 581 | ; Clear resized flag 582 | $aGF_HandleIndex[$i][7] = 0 583 | Next 584 | ; Return array of flags 585 | Return $aRet 586 | 587 | EndFunc 588 | 589 | ; #FUNCTION# ========================================================================================================= 590 | ; Name...........: _GUIFrame_ResizeReg 591 | ; Description ...: Registers WM_SIZE message for resizing 592 | ; Syntax.........: _GUIFrame_ResizeReg() 593 | ; Parameters ....: None 594 | ; Requirement(s).: v3.3 + 595 | ; Return values .: Success: 1 - Message handler registered 596 | ; Failure: 0 with @error set to 1 - Message handler already registered 597 | ; Author ........: Melba23 598 | ; Modified ......: 599 | ; Remarks .......: 600 | ; Example........: Yes 601 | ;===================================================================================================================== 602 | Func _GUIFrame_ResizeReg() 603 | 604 | ; Register the WM_SIZE message 605 | If $aGF_HandleIndex[0][1] = 0 Then 606 | Local $iRet = GUIRegisterMsg(0x05, "_GUIFrame_SIZE_Handler") ; $WM_SIZE 607 | If $iRet Then 608 | $aGF_HandleIndex[0][1] = 1 609 | Return 1 610 | EndIf 611 | EndIf 612 | Return SetError(1, 0, 0) 613 | 614 | EndFunc ;==>_GUIFrame_ResizeReg 615 | 616 | ; #FUNCTION# ========================================================================================================= 617 | ; Name...........: _GUIFrame_SIZE_Handler 618 | ; Description ...: Used to resize frames when resizing of holding GUI occurs 619 | ; Syntax.........: _GUIFrame_SIZE_Handler($hWnd, $iMsg, $wParam, $lParam) 620 | ; Parameters ....: None 621 | ; Requirement(s).: v3.3 + 622 | ; Return values .: None 623 | ; Author ........: Melba23 624 | ; Modified ......: 625 | ; Remarks .......: If the script already has a WM_SIZE handler, then just call this function from within it 626 | ; and do NOT use the _GUIFrame_ResizeReg function 627 | ; Example........: Yes 628 | ;===================================================================================================================== 629 | Func _GUIFrame_SIZE_Handler($hWnd, $iMsg, $wParam, $lParam) 630 | 631 | #forceref $iMsg, $wParam, $lParam 632 | Local $iIndex 633 | 634 | ; Get index of base frame GUI 635 | For $iIndex = 1 To $aGF_HandleIndex[0][0] 636 | If $aGF_HandleIndex[$iIndex][4] = $hWnd Then ExitLoop 637 | Next 638 | 639 | ; If handle not found 640 | If $iIndex > $aGF_HandleIndex[0][0] Then Return "GUI_RUNDEFMSG" 641 | 642 | ; Check if we should resize this set 643 | If $aGF_SettingsIndex[$iIndex][1] = 1 Then 644 | 645 | ; Get new base GUI size 646 | Local $aSize = WinGetClientSize($hWnd) 647 | ; Resize frames 648 | _GUIFrame_Move($iIndex, $aSize[0] * $aGF_SizingIndex[$iIndex][2], $aSize[1] * $aGF_SizingIndex[$iIndex][3], $aSize[0] * $aGF_SizingIndex[$iIndex][4], $aSize[1] * $aGF_SizingIndex[$iIndex][5]) 649 | 650 | ; Adjust any resizeable internal frames - array elements are adjacent for ease of coding 651 | For $i = 0 To 1 652 | ; Adjust internal frames of first/second frame if any exist 653 | If $aGF_HandleIndex[$iIndex][5 + $i] <> 0 Then 654 | ; StringSplit the element content on "|" 655 | Local $aInternal = StringSplit($aGF_HandleIndex[$iIndex][5 + $i], "|") 656 | ; Then loop though the Number(values) found 657 | For $j = 1 To $aInternal[0] 658 | Local $iIntIndex = Number($aInternal[$j]) 659 | ; Check if internal frame is resizable 660 | If $aGF_SettingsIndex[$iIntIndex][1] = 1 Then 661 | ; And change if so 662 | _GUIFrame_SIZE_Handler($aGF_HandleIndex[$iIntIndex][4], $iMsg, $wParam, $lParam) 663 | EndIf 664 | Next 665 | EndIf 666 | Next 667 | 668 | ; Set callback 669 | $aGF_HandleIndex[$iIndex][7] = 1 670 | 671 | EndIf 672 | 673 | Return "GUI_RUNDEFMSG" 674 | 675 | EndFunc ;==>_GUIFrame_SIZE_Handler 676 | 677 | ; #INTERNAL_USE_ONLY#============================================================================================================ 678 | ; Name...........: _GUIFrame_SepSubClass 679 | ; Description ...: Sets new WndProc for frame separator bar 680 | ; Author ........: Kip 681 | ; Modified.......: Melba23, using SetWindowLongPtr x64 compatible code drawn from Yashied's WinAPIEx library 682 | ; Remarks .......: This function is used internally by _GUIFrame_Create 683 | ; =============================================================================================================================== 684 | Func _GUIFrame_SepSubClass($hWnd) 685 | 686 | Local $aRet 687 | 688 | ; Check separator has not already been used 689 | For $i = 1 To $aGF_SepProcIndex[0][0] 690 | If $aGF_SepProcIndex[$i][0] = $hWnd Then Return 0 691 | Next 692 | 693 | ; Store current WinProc handle in new array line 694 | Local $iIndex = $aGF_SepProcIndex[0][0] + 1 695 | ReDim $aGF_SepProcIndex[$iIndex + 1][2] 696 | $aGF_SepProcIndex[0][0] = $iIndex 697 | $aGF_SepProcIndex[$iIndex][0] = $hWnd 698 | ; Subclass separator bar 699 | If @AutoItX64 Then 700 | $aRet = DllCall('user32.dll', 'long_ptr', 'SetWindowLongPtrW', 'hwnd', $hWnd, 'int', -4, 'long_ptr', $aGF_SepProcIndex[0][1]) ; $GWL_WNDPROC 701 | Else 702 | $aRet = DllCall('user32.dll', 'long', 'SetWindowLongW', 'hwnd', $hWnd, 'int', -4, 'long', $aGF_SepProcIndex[0][1]) ; $GWL_WNDPROC 703 | EndIf 704 | ; Check for subclassing error 705 | If @error Or $aRet[0] = 0 Then Return 0 706 | ; Return success 707 | $aGF_SepProcIndex[$iIndex][1] = $aRet[0] 708 | Return 1 709 | 710 | EndFunc ;==>_GUIFrame_SepSubClass 711 | 712 | ; #INTERNAL_USE_ONLY#============================================================================================================ 713 | ; Name...........: _GUIFrame_SepWndProc 714 | ; Description ...: New WndProc for frame separator bar 715 | ; Author ........: Kip 716 | ; Modified.......: Melba23 717 | ; Remarks .......: This function is used internally by _GUIFrame_SepSubClass 718 | ; =============================================================================================================================== 719 | Func _GUIFrame_SepWndProc($hWnd, $iMsg, $wParam, $lParam) 720 | 721 | Local $iSubtract, $fAbsolute = False 722 | 723 | If $iMsg = 0x0111 Then ; WM_COMMAND 724 | 725 | ; Check if hWnd is a Separator bar 726 | For $iIndex = 1 To $aGF_HandleIndex[0][0] 727 | If $aGF_HandleIndex[$iIndex][3] = $hWnd Then ExitLoop 728 | Next 729 | ; If not then pass message on to org WndProc 730 | If $iIndex > $aGF_HandleIndex[0][0] Then Return _GUIFrame_SepPassMsg($hWnd, $iMsg, $wParam, $lParam) 731 | 732 | ; Extract values from array 733 | Local $hParent = $aGF_HandleIndex[$iIndex][0] 734 | Local $hFirstFrame = $aGF_HandleIndex[$iIndex][1] 735 | Local $hSecondFrame = $aGF_HandleIndex[$iIndex][2] 736 | Local $hSeparator = $aGF_HandleIndex[$iIndex][3] 737 | Local $iFirstMin = $aGF_SizingIndex[$iIndex][0] 738 | Local $iSecondMin = $aGF_SizingIndex[$iIndex][1] 739 | If $iFirstMin > 1 Or $iSecondMin > 1 Then 740 | $fAbsolute = True 741 | EndIf 742 | Local $iSeparatorSize = $aGF_SettingsIndex[$iIndex][2] 743 | 744 | ; Get client size of the parent 745 | Local $aClientSize = WinGetClientSize($hParent) 746 | Local $iWidth = $aClientSize[0] 747 | Local $iHeight = $aClientSize[1] 748 | 749 | ; Get cursor info for the Separator 750 | Local $aCInfo = GUIGetCursorInfo($hSeparator) 751 | 752 | ; Depending on separator orientation 753 | If $aGF_SettingsIndex[$iIndex][0] = 0 Then 754 | 755 | ; Get Separator X-coord 756 | $iSubtract = $aCInfo[0] 757 | 758 | Do 759 | ; Get parent X-coord 760 | $aCInfo = GUIGetCursorInfo($hParent) 761 | Local $iCursorX = $aCInfo[0] 762 | 763 | ; Determine width of first frame 764 | Local $iFirstWidth = $iCursorX - $iSubtract 765 | ; And ensure it is at least minimum 766 | If $fAbsolute Then 767 | If $iFirstWidth < $iFirstMin Then $iFirstWidth = $iFirstMin 768 | If $iWidth - $iFirstWidth - $iSeparatorSize < $iSecondMin Then $iFirstWidth = $iWidth - $iSeparatorSize - $iSecondMin 769 | Else 770 | If $iFirstWidth < $iWidth * $iFirstMin Then $iFirstWidth = $iWidth * $iFirstMin 771 | If $iWidth - ($iFirstWidth + $iSeparatorSize) < $iWidth * $iSecondMin Then $iFirstWidth = $iWidth - ($iWidth * $iSecondMin) - $iSeparatorSize 772 | EndIf 773 | 774 | ; Move the GUIs to the correct places 775 | WinMove($hFirstFrame, "", 0, 0, $iFirstWidth, $iHeight) 776 | WinMove($hSecondFrame, "", $iFirstWidth + $iSeparatorSize, 0, $iWidth - ($iFirstWidth + $iSeparatorSize), $iHeight) 777 | WinMove($hSeparator, "", $iFirstWidth, 0, $iSeparatorSize, $iHeight) 778 | 779 | ; Do until the mouse button is released 780 | Until Not _WinAPI_GetAsyncKeyState(0x01) 781 | 782 | ; Store current separator percentage position 783 | $aGF_SizingIndex[$iIndex][6] = $iFirstWidth / $iWidth 784 | 785 | ElseIf $aGF_SettingsIndex[$iIndex][0] = 1 Then 786 | 787 | $iSubtract = $aCInfo[1] 788 | Do 789 | $aCInfo = GUIGetCursorInfo($hParent) 790 | Local $iCursorY = $aCInfo[1] 791 | Local $iFirstHeight = $iCursorY - $iSubtract 792 | If $fAbsolute Then 793 | If $iFirstHeight < $iFirstMin Then $iFirstHeight = $iFirstMin 794 | If $iHeight - $iFirstHeight - $iSeparatorSize < $iSecondMin Then $iFirstHeight = $iHeight - $iSeparatorSize - $iSecondMin 795 | Else 796 | If $iFirstHeight < $iHeight * $iFirstMin Then $iFirstHeight = $iHeight * $iFirstMin 797 | If $iHeight - ($iFirstHeight + $iSeparatorSize) < $iHeight * $iSecondMin Then $iFirstHeight = $iHeight - ($iHeight * $iSecondMin) - $iSeparatorSize 798 | EndIf 799 | WinMove($hFirstFrame, "", 0, 0, $iWidth, $iFirstHeight) 800 | WinMove($hSecondFrame, "", 0, $iFirstHeight + $iSeparatorSize, $iWidth, $iHeight - ($iFirstHeight + $iSeparatorSize)) 801 | WinMove($hSeparator, "", 0, $iFirstHeight, $iWidth, $iSeparatorSize) 802 | Until Not _WinAPI_GetAsyncKeyState(0x01) 803 | $aGF_SizingIndex[$iIndex][6] = $iFirstHeight / $iHeight 804 | 805 | EndIf 806 | 807 | ; Set callback 808 | $aGF_HandleIndex[$iIndex][7] = 1 809 | 810 | EndIf 811 | 812 | ; Pass the message on to org WndProc 813 | Return _GUIFrame_SepPassMsg($hWnd, $iMsg, $wParam, $lParam) 814 | 815 | EndFunc ;==>_GUIFrame_SepWndProc 816 | 817 | ; #INTERNAL_USE_ONLY#============================================================================================================ 818 | ; Name...........: _GUIFrame_SepPassMsg 819 | ; Description ...: Passes Msg to frame parent WndProc for action 820 | ; Author ........: Kip 821 | ; Modified.......: Melba23 822 | ; Remarks .......: This function is used internally by _GUIFrame_SepWndProc 823 | ; =============================================================================================================================== 824 | Func _GUIFrame_SepPassMsg($hWnd, $iMsg, $wParam, $lParam) 825 | 826 | For $i = 1 To $aGF_SepProcIndex[0][0] 827 | If $aGF_SepProcIndex[$i][0] = $hWnd Then Return _WinAPI_CallWindowProc($aGF_SepProcIndex[$i][1], $hWnd, $iMsg, $wParam, $lParam) 828 | Next 829 | 830 | EndFunc ;==>_GUIFrame_SepPassMsg 831 | 832 | ; #INTERNAL_USE_ONLY#============================================================================================================ 833 | ; Name...........: _GUIFrame_Move 834 | ; Description ...: Moves and resizes frame elements and separator bars 835 | ; Author ........: Kip 836 | ; Modified.......: Melba23 837 | ; Remarks .......: This function is used internally by _GUIFrame_SIZE_Handler 838 | ; =============================================================================================================================== 839 | Func _GUIFrame_Move($iFrame, $iX, $iY, $iWidth = 0, $iHeight = 0) 840 | 841 | If $iFrame < 1 Or $iFrame > $aGF_HandleIndex[0][0] Then Return 0 842 | 843 | Local $fAbsolute = False, $iDimension, $iActual_Size_1, $iActual_Size_2, $iSize 844 | Local $iOrientation = $aGF_SettingsIndex[$iFrame][0] 845 | Local $iSeparatorSize = $aGF_SettingsIndex[$iFrame][2] 846 | 847 | ; Set size if not specified 848 | If Not $iWidth Then $iWidth = _WinAPI_GetWindowWidth($aGF_HandleIndex[$iFrame][0]) 849 | If Not $iHeight Then $iHeight = _WinAPI_GetWindowHeight($aGF_HandleIndex[$iFrame][0]) 850 | 851 | ; Move parent 852 | WinMove($aGF_HandleIndex[$iFrame][0], "", $iX, $iY, $iWidth, $iHeight) 853 | 854 | ; Depending on separator orientation get required width/height values 855 | If $iOrientation = 1 Then 856 | $iDimension = $iHeight 857 | $iActual_Size_1 = _WinAPI_GetWindowHeight($aGF_HandleIndex[$iFrame][1]) 858 | $iActual_Size_2 = _WinAPI_GetWindowHeight($aGF_HandleIndex[$iFrame][2]) 859 | Else 860 | $iDimension = $iWidth 861 | $iActual_Size_1 = _WinAPI_GetWindowWidth($aGF_HandleIndex[$iFrame][1]) 862 | $iActual_Size_2 = _WinAPI_GetWindowWidth($aGF_HandleIndex[$iFrame][2]) 863 | EndIf 864 | 865 | ; Check resize type required 866 | Switch $aGF_SizingIndex[$iFrame][7] 867 | Case 0 868 | ; Determine new size for first frame using separator position percentage 869 | $iSize = Int($iDimension * $aGF_SizingIndex[$iFrame][6]) 870 | Case 1 871 | ; Get current fixed first frame size 872 | $iSize = $iActual_Size_1 873 | Case 2 874 | ; Determine new first frame size with fixed second frame size 875 | $iSize = $iDimension - $iSeparatorSize - $iActual_Size_2 876 | EndSwitch 877 | 878 | ; Set frame min percentages 879 | Local $iFirstMin = $aGF_SizingIndex[$iFrame][0] 880 | Local $iSecondMin = $aGF_SizingIndex[$iFrame][1] 881 | If $iFirstMin > 1 Or $iSecondMin > 1 Then 882 | $fAbsolute = True 883 | EndIf 884 | 885 | ; Check for minimum size of first frame 886 | Local $iAdjust_Other = True 887 | Local $fSep_Adjusted = False 888 | 889 | ; Adjust first frame size 890 | If $fAbsolute Then 891 | If $iSize < $iFirstMin Then 892 | $iSize = $iFirstMin 893 | $iAdjust_Other = False 894 | $fSep_Adjusted = True 895 | EndIf 896 | Else 897 | If $iSize < $iDimension * $iFirstMin Then 898 | $iSize = $iDimension * $iFirstMin 899 | $iAdjust_Other = False 900 | $fSep_Adjusted = True 901 | EndIf 902 | EndIf 903 | 904 | ; Now adjust second frame if first not adjusted 905 | If $iAdjust_Other Then 906 | 907 | ; Find max available size for this frame 908 | Local $iSecondMax = $iDimension - $iFirstMin - $iSeparatorSize 909 | If $iSecondMax < $iSecondMin Then 910 | $iSecondMin = $iSecondMax 911 | EndIf 912 | 913 | ; Adjust second frame size 914 | If $fAbsolute Then 915 | If $iActual_Size_2 < $iSecondMin Then 916 | $iSize = $iDimension - $iSecondMin - $iSeparatorSize 917 | $fSep_Adjusted = True 918 | EndIf 919 | Else 920 | If $iActual_Size_2 < $iDimension * $iSecondMin Then 921 | $iSize = $iDimension - ($iDimension * $iSecondMin) - $iSeparatorSize 922 | $fSep_Adjusted = True 923 | EndIf 924 | EndIf 925 | EndIf 926 | 927 | ; If the separator has been moved programatically then reset percentage size of first frame 928 | If $fSep_Adjusted Then 929 | $aGF_SizingIndex[$iFrame][6] = $iSize / $iDimension 930 | EndIf 931 | 932 | ; Move and resize GUIs according to orientation 933 | If $iOrientation = 1 Then 934 | WinMove($aGF_HandleIndex[$iFrame][1], "", 0, 0, $iWidth, $iSize) 935 | WinMove($aGF_HandleIndex[$iFrame][2], "", 0, $iSize + $iSeparatorSize, $iWidth, $iHeight - $iSize - $iSeparatorSize) 936 | WinMove($aGF_HandleIndex[$iFrame][3], "", 0, $iSize, $iWidth, $iSeparatorSize) 937 | Else 938 | WinMove($aGF_HandleIndex[$iFrame][1], "", 0, 0, $iSize, $iHeight) 939 | WinMove($aGF_HandleIndex[$iFrame][2], "", $iSize + $iSeparatorSize, 0, $iWidth - $iSize - $iSeparatorSize, $iHeight) 940 | WinMove($aGF_HandleIndex[$iFrame][3], "", $iSize, 0, $iSeparatorSize, $iHeight) 941 | EndIf 942 | 943 | EndFunc ;==>_GUIFrame_Move 944 | 945 | ; #INTERNAL_USE_ONLY#============================================================================================================ 946 | ; Name...........: _GUIFrame_Exit() 947 | ; Description ...: Deletes all subclassed separator bars to free UDF WndProc and frees registered callback handle 948 | ; Author ........: Melba23 949 | ; Remarks .......: Called by OnAutoItExitRegister to delete all subclassed separator bars and to free the UDF created WndProc. 950 | ; Example........: Yes 951 | ;================================================================================================================================ 952 | Func _GUIFrame_Exit() 953 | 954 | ; Delete all subclassed separator bars 955 | For $i = $aGF_HandleIndex[0][0] To 1 Step -1 956 | GUIDelete($aGF_HandleIndex[$i][3]) 957 | Next 958 | ; Free registered Callback handle 959 | DllCallbackFree($hGF_RegCallBack) 960 | 961 | EndFunc ;==>_GUIFrame_Exit -------------------------------------------------------------------------------- /unchecked.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WildByDesign/ACLViewer/dc578125ef34c2d6895adbc2129bab0ab55e86f3/unchecked.ico --------------------------------------------------------------------------------