├── .gitattributes ├── .github ├── FUNDING.yml └── ISSUE_TEMPLATE │ ├── bug_report.yml │ ├── config.yml │ ├── feature_request.yml │ └── question.md ├── .gitignore ├── .gitmodules ├── CHANGELOG.md ├── LICENSE ├── README.md ├── bin ├── History.txt ├── License.txt ├── Readme.txt ├── install.bat └── uninstall.bat ├── build.bat ├── build_locale.bat ├── build_vc.bat ├── images └── matrix.png ├── matrix.sln ├── matrix.vcxproj ├── matrix.vcxproj.filters ├── matrix.vcxproj.user └── src ├── app.h ├── main.c ├── main.h ├── res ├── 100.ico ├── blank.cur ├── glyph.bmp └── manifest.xml ├── resource.h └── resource.rc /.gitattributes: -------------------------------------------------------------------------------- 1 | *.c diff 2 | *.cpp diff 3 | *.h diff 4 | *.rc diff 5 | *.ini diff 6 | *.txt diff 7 | *.xml diff 8 | *.lng diff 9 | -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | custom: ["https://www.paypal.me/henrypp", "https://yoomoney.ru/to/4100115776040583", "https://www.blockchain.com/btc/address/1LrRTXPsvHcQWCNZotA9RcwjsGcRghG96c", "https://www.blockchain.com/eth/address/0xe2C84A62eb2a4EF154b19bec0c1c106734B95960"] 2 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.yml: -------------------------------------------------------------------------------- 1 | name: Bug report 2 | title: "[Bug]" 3 | description: Let me know about crash or existing functionality not working like it should. 4 | labels: [ "bug" ] 5 | body: 6 | - type: markdown 7 | attributes: 8 | value: Thanks for taking the time to fill out this bug report! 9 | - type: checkboxes 10 | id: checklist 11 | attributes: 12 | label: Checklist 13 | options: 14 | - label: I have used the search function to see if someone else has already submitted the same bug report. 15 | required: true 16 | - label: I will describe the problem with as much detail as possible. 17 | required: true 18 | - type: input 19 | id: version 20 | attributes: 21 | label: App version 22 | description: What the application version do you use. 23 | placeholder: x.y.z 24 | validations: 25 | required: true 26 | - type: input 27 | id: windows_version 28 | attributes: 29 | label: Windows version 30 | description: What Windows version do you use. 31 | validations: 32 | required: true 33 | - type: textarea 34 | id: steps 35 | attributes: 36 | label: Steps to reproduce 37 | placeholder: | 38 | 1. Go to '…' 39 | 2. Click on '…' 40 | 3. Scroll down to '…' 41 | 4. etc. 42 | validations: 43 | required: true 44 | - type: textarea 45 | id: expected 46 | attributes: 47 | label: Expected behavior 48 | description: After following the steps, what did you think application would do? 49 | validations: 50 | required: false 51 | - type: textarea 52 | id: actual 53 | attributes: 54 | label: Actual behavior 55 | description: What did application do instead? Screenshots might help. 56 | validations: 57 | required: true 58 | - type: textarea 59 | id: logs 60 | attributes: 61 | label: Logs 62 | description: | 63 | - If application have debug log insert it here. 64 | - If application have crash dump please attach it here. 65 | 66 | Tip: You can attach images, log files or crash dumps by clicking this area to highlight it and then dragging files in. 67 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/config.yml: -------------------------------------------------------------------------------- 1 | blank_issues_enabled: false 2 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.yml: -------------------------------------------------------------------------------- 1 | name: Feature request 2 | title: "[Feature]" 3 | description: Suggest an idea for this project. 4 | labels: [ "feature" ] 5 | body: 6 | - type: checkboxes 7 | id: checklist 8 | attributes: 9 | label: Checklist 10 | options: 11 | - label: I have used the search function to see if someone else has already submitted the same feature request. 12 | required: true 13 | - label: I will describe the problem with as much detail as possible. 14 | required: true 15 | - label: This issue only contains a request for one single feature, **not** multiple (related) features. 16 | required: true 17 | - type: input 18 | id: version 19 | attributes: 20 | label: App version 21 | description: What the application version do you use. 22 | placeholder: x.y.z 23 | validations: 24 | required: true 25 | - type: textarea 26 | id: problem 27 | attributes: 28 | label: Problem you are trying to solve 29 | description: Give a brief explanation of the problem you are trying to solve. 30 | validations: 31 | required: true 32 | - type: textarea 33 | id: solution 34 | attributes: 35 | label: Suggested solution 36 | description: Describe how you would like the app to help you solve that problem. Try to be as specific as possible. 37 | validations: 38 | required: true 39 | - type: textarea 40 | id: screenshots 41 | attributes: 42 | label: Screenshots / Drawings / Technical details 43 | description: | 44 | If your request is about (or includes) changing or extending the user interface (UI), describe what the UI would look like and how the user would interact with it. 45 | 46 | Tip: You can attach images or log files by clicking this area to highlight it and then dragging files in. 47 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/question.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Question 3 | about: Ask a question about application. 4 | title: '[Question]' 5 | labels: [ "question" ] 6 | assignees: '' 7 | 8 | --- 9 | 10 | Describe the question with as much detail as possible. 11 | 12 | --- 13 | 14 | App version: 15 | Windows version: -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .vs/ 2 | .vscode/ 3 | temp/ 4 | bin/32/ 5 | bin/64/ 6 | bin/arm64/ 7 | x64/ 8 | win32/ 9 | arm64/ 10 | __pycache__ 11 | 12 | thumbs.db 13 | ehthumbs.db 14 | desktop.ini 15 | 16 | *.cab 17 | *.msi 18 | *.msm 19 | *.msp 20 | *.lnk 21 | *.jpg 22 | *.zip 23 | *.log 24 | *.pdb 25 | *.exp 26 | *.sdf 27 | *.opensdf 28 | *.db 29 | *.opendb 30 | *.suo 31 | *.exp 32 | *.iobj 33 | *.ipch 34 | *.ipdb 35 | *.ilk 36 | *.obj 37 | *.res 38 | *.tlog 39 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "routine"] 2 | path = ../routine 3 | url = https://github.com/henrypp/routine.git 4 | 5 | [submodule "builder"] 6 | path = ../builder 7 | url = https://github.com/henrypp/builder.git 8 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | v1.4 (12 September 2018) 2 | - added settings window 3 | - added feature for close screensaver on "Esc" only (issue #2) 4 | - improved installation scripts 5 | - changed randomize colors algorithm 6 | - fixed multi-monitor support (issue #3) 7 | - fixed bugs 8 | 9 | v1.3 (22 November 2016) 10 | - added config (see matrix.ini) 11 | - added installation scripts 12 | - added some optimization 13 | - added stability improvements (treat warnings as errors) 14 | 15 | v1.2 (21 January 2016) 16 | - added preview 17 | - fixed bug in windows 10 (x64 build) 18 | 19 | v1.1 (24 December 2015) 20 | - x64 build 21 | 22 | v1.0 (6 September 2011) 23 | - first public version 24 | -------------------------------------------------------------------------------- /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 |

Matrix Screensaver

2 | 3 |

4 | 5 | 6 | 7 | 8 | 9 |

10 | 11 | ------- 12 | 13 |

14 | 15 |

16 | 17 | ### Description: 18 | The Matrix ScreenSaver is a small, fast and elegant Windows version of the green "Matrix" cypher-code seen in the films. 19 | 20 | Originally written by J Brown 2003. 21 | 22 | ### System requirements: 23 | - Windows 7, 8, 8.1, 10, 11 32-bit/64-bit/ARM64 24 | - An SSE2-capable CPU 25 | - KB2533623 KB3063858 update for Windows 7 was required [[x64](https://www.microsoft.com/en-us/download/details.aspx?id=47442) / [x32](https://www.microsoft.com/en-us/download/details.aspx?id=47409)] 26 | 27 | ### Donate: 28 | - [Bitcoin](https://www.blockchain.com/btc/address/1LrRTXPsvHcQWCNZotA9RcwjsGcRghG96c) (BTC) 29 | - [Ethereum](https://www.blockchain.com/explorer/addresses/eth/0xe2C84A62eb2a4EF154b19bec0c1c106734B95960) (ETC) 30 | - [Paypal](https://paypal.me/henrypp) (USD) 31 | - [Yandex Money](https://yoomoney.ru/to/4100115776040583) (RUB) 32 | 33 | ### GPG Signature: 34 | Binaries have GPG signature simplewall.exe.sig in application folder. 35 | 36 | - Public key: [pubkey.asc](https://raw.githubusercontent.com/henrypp/builder/master/pubkey.asc) ([pgpkeys.eu](https://pgpkeys.eu/pks/lookup?op=index&fingerprint=on&search=0x5635B5FD)) 37 | - Key ID: 0x5635B5FD 38 | - Fingerprint: D985 2361 1524 AB29 BE73 30AC 2881 20A7 5635 B5FD 39 | --- 40 | - Website: [github.com/henrypp](https://github.com/henrypp) 41 | - Support: sforce5@mail.ru 42 | --- 43 | (c) 2011-2025 Henry++ 44 | -------------------------------------------------------------------------------- /bin/History.txt: -------------------------------------------------------------------------------- 1 | v1.4 (12 September 2018) 2 | - added settings window 3 | - added feature for close screensaver on "Esc" only (issue #2) 4 | - improved installation scripts 5 | - changed randomize colors algorithm 6 | - fixed multi-monitor support (issue #3) 7 | - fixed bugs 8 | 9 | v1.3 (22 November 2016) 10 | - added config (see matrix.ini) 11 | - added installation scripts 12 | - added some optimization 13 | - added stability improvements (treat warnings as errors) 14 | 15 | v1.2 (21 January 2016) 16 | - added preview 17 | - fixed bug in windows 10 (x64 build) 18 | 19 | v1.1 (24 December 2015) 20 | - x64 build 21 | 22 | v1.0 (6 September 2011) 23 | - first public version 24 | -------------------------------------------------------------------------------- /bin/License.txt: -------------------------------------------------------------------------------- 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 | -------------------------------------------------------------------------------- /bin/Readme.txt: -------------------------------------------------------------------------------- 1 | Matrix Screensaver 2 | 3 | The Matrix ScreenSaver is a small, fast and elegant Windows version of the green "Matrix" cypher-code seen in the films. 4 | 5 | Originally written by J Brown 2003. 6 | 7 | Website: https://github.com/henrypp 8 | Support: sforce5@mail.ru 9 | 10 | (c) 2011-2025 Henry++ 11 | -------------------------------------------------------------------------------- /bin/install.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | 3 | set "MATRIX_PATH=%~dp0matrix.scr" 4 | set "MATRIX_PATH_DEST=%windir%\system32\matrix.scr" 5 | 6 | if not exist "%MATRIX_PATH%" ( 7 | 8 | echo ERROR: "matrix.scr" not found. 9 | pause 10 | 11 | ) else ( 12 | 13 | reg add hklm /f>nul 2>&1 14 | 15 | if errorlevel 1 ( 16 | 17 | echo ERROR: Please run this script with admin rights... 18 | pause 19 | 20 | ) else ( 21 | 22 | rem Copy required files... 23 | copy /y "%MATRIX_PATH%" "%MATRIX_PATH_DEST%" 24 | 25 | rem Set as default screensaver... 26 | if exist "%MATRIX_PATH_DEST%" ( 27 | 28 | reg add "HKCU\Control Panel\Desktop" /v "ScreenSaveActive" /t REG_SZ /d "1" /f 29 | reg add "HKCU\Control Panel\Desktop" /v "SCRNSAVE.EXE" /t REG_SZ /d "%MATRIX_PATH_DEST%" /f 30 | 31 | ) 32 | 33 | rem Open screesaver dialog... 34 | rundll32.exe shell32.dll,Control_RunDLL desk.cpl,ScreenSaver,@ScreenSaver 35 | ) 36 | 37 | ) 38 | -------------------------------------------------------------------------------- /bin/uninstall.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | 3 | reg add hklm /f>nul 2>&1 4 | 5 | if errorlevel 1 ( 6 | 7 | echo ERROR: Please run this script with admin rights... 8 | pause 9 | 10 | 11 | ) else ( 12 | 13 | if exist "%windir%\system32\matrix.scr" ( 14 | del /f /q "%windir%\system32\matrix.scr" 15 | ) 16 | 17 | if exist "%windir%\system32\matrix.ini" ( 18 | del /f /q "%windir%\system32\matrix.ini" 19 | ) 20 | 21 | if exist "%appdata%\henry++\matrix screensaver" ( 22 | rmdir /s /q "%appdata%\henry++\matrix screensaver" 23 | ) 24 | 25 | ) 26 | -------------------------------------------------------------------------------- /build.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | 3 | cd ..\builder 4 | call build matrix 1.4 5 | 6 | pause 7 | -------------------------------------------------------------------------------- /build_locale.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | 3 | cd ..\builder 4 | call build_locale matrix 5 | 6 | pause 7 | -------------------------------------------------------------------------------- /build_vc.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | @setlocal enableextensions 3 | rem @cd /d "%~dp0\..\" 4 | 5 | if exist "%ProgramFiles%\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvarsall.bat" ( 6 | call "%ProgramFiles%\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvarsall.bat" amd64_arm64 7 | goto start 8 | ) 9 | 10 | if exist "%ProgramFiles%\Microsoft Visual Studio\2022\Professional\VC\Auxiliary\Build\vcvarsall.bat" ( 11 | call "%ProgramFiles%\Microsoft Visual Studio\2022\Professional\VC\Auxiliary\Build\vcvarsall.bat" amd64_arm64 12 | goto start 13 | ) 14 | 15 | echo VS 2022 not found... 16 | 17 | goto end 18 | 19 | :start 20 | 21 | msbuild matrix.sln -property:Configuration=Release -property:Platform=x86 -verbosity:normal 22 | if %ERRORLEVEL% neq 0 goto end 23 | 24 | msbuild matrix.sln -property:Configuration=Release -property:Platform=x64 -verbosity:normal 25 | if %ERRORLEVEL% neq 0 goto end 26 | 27 | :end 28 | 29 | echo done... 30 | 31 | pause 32 | -------------------------------------------------------------------------------- /images/matrix.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/henrypp/matrix/629d9c65c13656456511c31a451bf1829184c5b0/images/matrix.png -------------------------------------------------------------------------------- /matrix.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 17 4 | VisualStudioVersion = 17.0.31903.59 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "matrix", "matrix.vcxproj", "{4E4BF9FF-76BE-441D-8DB4-19373F95E8DA}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|x64 = Debug|x64 11 | Debug|x86 = Debug|x86 12 | Release|x64 = Release|x64 13 | Release|x86 = Release|x86 14 | EndGlobalSection 15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 16 | {4E4BF9FF-76BE-441D-8DB4-19373F95E8DA}.Debug|x64.ActiveCfg = Debug|x64 17 | {4E4BF9FF-76BE-441D-8DB4-19373F95E8DA}.Debug|x64.Build.0 = Debug|x64 18 | {4E4BF9FF-76BE-441D-8DB4-19373F95E8DA}.Debug|x86.ActiveCfg = Debug|Win32 19 | {4E4BF9FF-76BE-441D-8DB4-19373F95E8DA}.Debug|x86.Build.0 = Debug|Win32 20 | {4E4BF9FF-76BE-441D-8DB4-19373F95E8DA}.Release|x64.ActiveCfg = Release|x64 21 | {4E4BF9FF-76BE-441D-8DB4-19373F95E8DA}.Release|x64.Build.0 = Release|x64 22 | {4E4BF9FF-76BE-441D-8DB4-19373F95E8DA}.Release|x86.ActiveCfg = Release|Win32 23 | {4E4BF9FF-76BE-441D-8DB4-19373F95E8DA}.Release|x86.Build.0 = Release|Win32 24 | EndGlobalSection 25 | GlobalSection(SolutionProperties) = preSolution 26 | HideSolutionNode = FALSE 27 | EndGlobalSection 28 | EndGlobal 29 | -------------------------------------------------------------------------------- /matrix.vcxproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | Win32 7 | 8 | 9 | Release 10 | Win32 11 | 12 | 13 | Debug 14 | x64 15 | 16 | 17 | Release 18 | x64 19 | 20 | 21 | 22 | {4E4BF9FF-76BE-441D-8DB4-19373F95E8DA} 23 | matrix 24 | 10.0 25 | matrix 26 | 27 | 28 | 29 | Application 30 | true 31 | v143 32 | Unicode 33 | 34 | 35 | Application 36 | false 37 | v143 38 | true 39 | Unicode 40 | 41 | 42 | Application 43 | true 44 | v143 45 | Unicode 46 | 47 | 48 | Application 49 | false 50 | v143 51 | true 52 | Unicode 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | $(SolutionDir)bin\$(PlatformArchitecture)\ 74 | $(ProjectName) 75 | $(VC_IncludePath);$(WindowsSDK_IncludePath);.\..\routine\src\;.\src\include\;.\src\ 76 | $(VC_LibraryPath_x86);$(WindowsSDK_LibraryPath_x86);$(NETFXKitsDir)Lib\um\x86;.\src\lib\32\ 77 | false 78 | $(Platform)\$(Configuration)\$(ProjectName)\ 79 | MixedRecommendedRules.ruleset 80 | .scr 81 | 82 | 83 | $(SolutionDir)bin\$(PlatformArchitecture)\ 84 | $(ProjectName) 85 | $(VC_IncludePath);$(WindowsSDK_IncludePath);.\..\routine\src\;.\src\include\;.\src\ 86 | $(VC_LibraryPath_x86);$(WindowsSDK_LibraryPath_x86);$(NETFXKitsDir)Lib\um\x86;.\src\lib\32\ 87 | false 88 | $(Platform)\$(Configuration)\$(ProjectName)\ 89 | MixedRecommendedRules.ruleset 90 | .scr 91 | 92 | 93 | $(SolutionDir)bin\$(PlatformArchitecture)\ 94 | $(ProjectName) 95 | $(VC_IncludePath);$(WindowsSDK_IncludePath);.\..\routine\src\;.\src\include\;.\src\ 96 | $(VC_LibraryPath_x64);$(WindowsSDK_LibraryPath_x64);$(NETFXKitsDir)Lib\um\x64;.\src\lib\64\ 97 | false 98 | $(Platform)\$(Configuration)\$(ProjectName)\ 99 | MixedRecommendedRules.ruleset 100 | .scr 101 | 102 | 103 | $(SolutionDir)bin\$(PlatformArchitecture)\ 104 | $(ProjectName) 105 | $(VC_IncludePath);$(WindowsSDK_IncludePath);.\..\routine\src\;.\src\include\;.\src\ 106 | $(VC_LibraryPath_x64);$(WindowsSDK_LibraryPath_x64);$(NETFXKitsDir)Lib\um\x64;.\src\lib\64\ 107 | false 108 | $(Platform)\$(Configuration)\$(ProjectName)\ 109 | MixedRecommendedRules.ruleset 110 | .scr 111 | 112 | 113 | 114 | Level3 115 | Disabled 116 | Neither 117 | true 118 | StdCall 119 | true 120 | Guard 121 | true 122 | MICROSOFT_WINDOWS_WINBASE_H_DEFINE_INTERLOCKED_CPLUSPLUS_OVERLOADS;_UNICODE;UNICODE;%(PreprocessorDefinitions) 123 | EnableFastChecks 124 | true 125 | ProgramDatabase 126 | true 127 | stdcpplatest 128 | stdc17 129 | true 130 | StreamingSIMDExtensions 131 | true 132 | 133 | 134 | true 135 | UseFastLinkTimeCodeGeneration 136 | true 137 | true 138 | Windows 139 | 6.3 140 | /DEPENDENTLOADFLAG:0x800 /BREPRO %(AdditionalOptions) 141 | true 142 | 143 | 144 | 145 | 146 | Level3 147 | Disabled 148 | Neither 149 | true 150 | StdCall 151 | true 152 | Guard 153 | true 154 | MICROSOFT_WINDOWS_WINBASE_H_DEFINE_INTERLOCKED_CPLUSPLUS_OVERLOADS;_UNICODE;UNICODE;%(PreprocessorDefinitions) 155 | EnableFastChecks 156 | true 157 | ProgramDatabase 158 | true 159 | stdcpplatest 160 | stdc17 161 | true 162 | true 163 | true 164 | 165 | 166 | true 167 | UseFastLinkTimeCodeGeneration 168 | true 169 | true 170 | Windows 171 | /DEPENDENTLOADFLAG:0x800 /BREPRO %(AdditionalOptions) 172 | 6.3 173 | true 174 | 175 | 176 | _UNICODE;UNICODE;_WIN64;%(PreprocessorDefinitions) 177 | 178 | 179 | 180 | 181 | Level3 182 | MaxSpeed 183 | true 184 | true 185 | Speed 186 | Guard 187 | true 188 | StdCall 189 | MultiThreaded 190 | ProgramDatabase 191 | MICROSOFT_WINDOWS_WINBASE_H_DEFINE_INTERLOCKED_CPLUSPLUS_OVERLOADS;_UNICODE;UNICODE;NDEBUG;%(PreprocessorDefinitions) 192 | 193 | 194 | true 195 | true 196 | stdcpplatest 197 | stdc17 198 | true 199 | StreamingSIMDExtensions 200 | true 201 | 202 | 203 | true 204 | true 205 | true 206 | true 207 | UseLinkTimeCodeGeneration 208 | Windows 209 | 6.3 210 | /DEPENDENTLOADFLAG:0x800 /BREPRO %(AdditionalOptions) 211 | true 212 | 213 | 214 | 215 | 216 | Level3 217 | MaxSpeed 218 | true 219 | true 220 | Speed 221 | Guard 222 | true 223 | StdCall 224 | MultiThreaded 225 | ProgramDatabase 226 | MICROSOFT_WINDOWS_WINBASE_H_DEFINE_INTERLOCKED_CPLUSPLUS_OVERLOADS;_UNICODE;UNICODE;NDEBUG;%(PreprocessorDefinitions) 227 | 228 | 229 | true 230 | true 231 | stdcpplatest 232 | stdc17 233 | true 234 | true 235 | true 236 | 237 | 238 | true 239 | true 240 | true 241 | true 242 | UseLinkTimeCodeGeneration 243 | Windows 244 | /DEPENDENTLOADFLAG:0x800 /BREPRO %(AdditionalOptions) 245 | 6.3 246 | true 247 | 248 | 249 | _UNICODE;UNICODE;_WIN64;%(PreprocessorDefinitions) 250 | 251 | 252 | 253 | 254 | 255 | 256 | 257 | 258 | 259 | 260 | 261 | 262 | 263 | 264 | 265 | 266 | 267 | 268 | 269 | 270 | 271 | 272 | 273 | 274 | -------------------------------------------------------------------------------- /matrix.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {E7A57AFB-F225-414D-983C-CB0CD6EB580D} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {168E5B60-241A-46AD-8434-75100E07840F} 10 | h;hh;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {D01AE45A-17CA-416F-92AF-47B6D16BAF56} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | Source Files 20 | 21 | 22 | Source Files 23 | 24 | 25 | Source Files 26 | 27 | 28 | 29 | 30 | Resource Files 31 | 32 | 33 | 34 | 35 | Header Files 36 | 37 | 38 | Header Files 39 | 40 | 41 | Header Files 42 | 43 | 44 | Header Files 45 | 46 | 47 | Header Files 48 | 49 | 50 | Header Files 51 | 52 | 53 | Header Files 54 | 55 | 56 | Header Files 57 | 58 | 59 | Header Files 60 | 61 | 62 | -------------------------------------------------------------------------------- /matrix.vcxproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Auto 5 | 6 | -------------------------------------------------------------------------------- /src/app.h: -------------------------------------------------------------------------------- 1 | // Matrix Screensaver 2 | // Copyright (c) J Brown 2003 (catch22.net) 3 | // Copyright (c) 2011-2025 Henry++ 4 | 5 | #pragma once 6 | 7 | #define APP_NAME L"Matrix Screensaver" 8 | #define APP_NAME_SHORT L"matrix" 9 | #define APP_VERSION L"1.5" 10 | #define APP_VERSION_RES 1,5,0,0 11 | #define APP_AUTHOR L"Henry++" 12 | #define APP_COPYRIGHT L"(c) 2011-2025 " APP_AUTHOR L"\r\n(c) J Brown 2003 (catch22.net). All Rights Reversed." 13 | -------------------------------------------------------------------------------- /src/main.c: -------------------------------------------------------------------------------- 1 | // Matrix Screensaver 2 | // Copyright (c) J Brown 2003 (catch22.net) 3 | // Copyright (c) 2011-2025 Henry++ 4 | 5 | #include "routine.h" 6 | 7 | #include "main.h" 8 | #include "rapp.h" 9 | 10 | #include "resource.h" 11 | 12 | STATIC_DATA config = {0}; 13 | 14 | #define RND_MAX INT_MAX 15 | 16 | VOID ReadSettings () 17 | { 18 | config.speed = _r_config_getlong (L"Speed", SPEED_DEFAULT, NULL); 19 | config.amount = _r_config_getlong (L"NumGlyphs", AMOUNT_DEFAULT, NULL); 20 | config.density = _r_config_getlong (L"Density", DENSITY_DEFAULT, NULL); 21 | config.hue = _r_config_getlong (L"Hue", HUE_DEFAULT, NULL); 22 | 23 | config.is_esc_only = _r_config_getboolean (L"IsEscOnly", FALSE, NULL); 24 | 25 | config.is_random = _r_config_getboolean (L"Random", HUE_RANDOM, NULL); 26 | config.is_smooth = _r_config_getboolean (L"RandomSmoothTransition", HUE_RANDOM_SMOOTHTRANSITION, NULL); 27 | } 28 | 29 | VOID SaveSettings () 30 | { 31 | _r_config_setlong (L"Speed", config.speed, NULL); 32 | _r_config_setlong (L"NumGlyphs", config.amount, NULL); 33 | _r_config_setlong (L"Density", config.density, NULL); 34 | _r_config_setlong (L"Hue", config.hue, NULL); 35 | 36 | _r_config_setboolean (L"IsEscOnly", config.is_esc_only, NULL); 37 | 38 | _r_config_setboolean (L"Random", config.is_random, NULL); 39 | _r_config_setboolean (L"RandomSmoothTransition", config.is_smooth, NULL); 40 | } 41 | 42 | FORCEINLINE COLORREF HSLtoRGB ( 43 | _In_ WORD h, 44 | _In_ WORD s, 45 | _In_ WORD l 46 | ) 47 | { 48 | return ColorHLSToRGB (h, l, s); 49 | } 50 | 51 | FORCEINLINE VOID RGBtoHSL ( 52 | _In_ COLORREF clr, 53 | _Out_ PWORD h, 54 | _Out_ PWORD s, 55 | _Out_ PWORD l 56 | ) 57 | { 58 | ColorRGBToHLS (clr, h, l, s); 59 | } 60 | 61 | FORCEINLINE GLYPH GlyphIntensity ( 62 | _In_ GLYPH glyph 63 | ) 64 | { 65 | return ((glyph & 0x7F00) >> 8); 66 | } 67 | 68 | FORCEINLINE GLYPH RandomGlyph ( 69 | _In_ INT intensity 70 | ) 71 | { 72 | return GLYPH_REDRAW | (intensity << 8) | (_r_math_getrandomrange (0, RND_MAX) % config.amount); 73 | } 74 | 75 | FORCEINLINE GLYPH DarkenGlyph ( 76 | _In_ GLYPH glyph 77 | ) 78 | { 79 | GLYPH intensity; 80 | 81 | intensity = GlyphIntensity (glyph); 82 | 83 | if (intensity > 0) 84 | return GLYPH_REDRAW | ((intensity - 1) << 8) | (glyph & 0x00FF); 85 | 86 | return glyph; 87 | } 88 | 89 | FORCEINLINE VOID DrawGlyph ( 90 | _In_ PMATRIX matrix, 91 | _In_ HDC hdc, 92 | _In_ ULONG xpos, 93 | _In_ ULONG ypos, 94 | _In_ GLYPH glyph 95 | ) 96 | { 97 | GLYPH intensity; 98 | ULONG glyph_idx; 99 | 100 | intensity = GlyphIntensity (glyph); 101 | glyph_idx = glyph & 0xFF; 102 | 103 | BitBlt ( 104 | hdc, 105 | xpos, 106 | ypos, 107 | GLYPH_WIDTH, 108 | GLYPH_HEIGHT, 109 | matrix->hdc, 110 | glyph_idx * GLYPH_WIDTH, 111 | intensity * GLYPH_HEIGHT, 112 | SRCCOPY 113 | ); 114 | } 115 | 116 | FORCEINLINE VOID RedrawBlip ( 117 | _Inout_ PGLYPH glyph_arr, 118 | _In_ INT blip_pos 119 | ) 120 | { 121 | glyph_arr[blip_pos + 0] |= GLYPH_REDRAW; 122 | glyph_arr[blip_pos + 1] |= GLYPH_REDRAW; 123 | glyph_arr[blip_pos + 8] |= GLYPH_REDRAW; 124 | glyph_arr[blip_pos + 9] |= GLYPH_REDRAW; 125 | } 126 | 127 | VOID ScrollMatrixColumn ( 128 | _Inout_ PMATRIX_COLUMN column 129 | ) 130 | { 131 | GLYPH last_glyph; 132 | GLYPH current_glyph; 133 | GLYPH current_glyph_intensity; 134 | LONG density; 135 | 136 | // wait until we are allowed to scroll 137 | if (!column->is_started) 138 | { 139 | if (--column->countdown <= 0) 140 | column->is_started = TRUE; 141 | 142 | return; 143 | } 144 | 145 | // "seed" the glyph-run 146 | last_glyph = column->state ? 0 : (MAX_INTENSITY << 8); 147 | 148 | // 149 | // loop over the entire length of the column, looking for changes 150 | // in intensity/darkness. This change signifies the start/end 151 | // of a run of glyphs. 152 | // 153 | for (ULONG_PTR y = 0; y < (ULONG_PTR)column->length; y++) 154 | { 155 | current_glyph = column->glyph[y]; 156 | 157 | current_glyph_intensity = GlyphIntensity (current_glyph); 158 | 159 | // bottom-most part of "run". Insert a new character (glyph) 160 | // at the end to lengthen the run down the screen..gives the 161 | // impression that the run is "falling" down the screen 162 | if (current_glyph_intensity < GlyphIntensity (last_glyph) && current_glyph_intensity == 0) 163 | { 164 | column->glyph[y] = RandomGlyph (MAX_INTENSITY - 1); 165 | 166 | y += 1; 167 | } 168 | 169 | // top-most part of "run". Delete a character off the top by 170 | // darkening the glyph until it eventually disappears (turns black). 171 | // this gives the effect that the run as dropped downwards 172 | else if (current_glyph_intensity > GlyphIntensity (last_glyph)) 173 | { 174 | column->glyph[y] = DarkenGlyph (current_glyph); 175 | 176 | // if we've just darkened the last bit, skip on so 177 | // the whole run doesn't go dark 178 | if (current_glyph_intensity == MAX_INTENSITY - 1) 179 | y++; 180 | } 181 | 182 | last_glyph = column->glyph[y]; 183 | } 184 | 185 | // change state from blanks <-> runs when the current run as expired 186 | if (--column->run_length <= 0) 187 | { 188 | density = DENSITY_MAX - config.density + DENSITY_MIN; 189 | 190 | if (column->state ^= 1) 191 | { 192 | column->run_length = _r_math_getrandomrange (0, RND_MAX) % (3 * density / 2) + DENSITY_MIN; 193 | } 194 | else 195 | { 196 | column->run_length = _r_math_getrandomrange (0, RND_MAX) % (DENSITY_MAX + 1 - density) + (DENSITY_MIN * 2); 197 | } 198 | } 199 | 200 | // mark current blip as redraw so it gets "erased" 201 | if (column->blip_pos >= 0 && column->blip_pos < column->length) 202 | RedrawBlip (column->glyph, column->blip_pos); 203 | 204 | // advance down screen at double-speed 205 | column->blip_pos += 2; 206 | 207 | // if the blip gets to the end of a run, start it again (for a random 208 | // length so that the blips never get synched together) 209 | if (column->blip_pos >= column->blip_length) 210 | { 211 | column->blip_length = column->length + (_r_math_getrandomrange (0, RND_MAX) % 50); 212 | column->blip_pos = 0; 213 | } 214 | 215 | // now redraw blip at new position 216 | if (column->blip_pos >= 0 && column->blip_pos < column->length) 217 | RedrawBlip (column->glyph, column->blip_pos); 218 | } 219 | 220 | // 221 | // randomly change a small collection glyphs in a column 222 | // 223 | VOID RandomMatrixColumn ( 224 | _Inout_ PMATRIX_COLUMN column 225 | ) 226 | { 227 | ULONG rand; 228 | 229 | for (ULONG_PTR i = 1, y = 0; i < 16; i++) 230 | { 231 | // find a run 232 | while (y < column->length && GlyphIntensity (column->glyph[y]) < (MAX_INTENSITY - 1)) 233 | y += 1; 234 | 235 | if (y >= column->length) 236 | break; 237 | 238 | rand = _r_math_getrandomrange (0, RND_MAX); 239 | 240 | column->glyph[y] = (column->glyph[y] & 0xFF00) | (rand % config.amount); 241 | column->glyph[y] |= GLYPH_REDRAW; 242 | 243 | y += rand % 10; 244 | } 245 | } 246 | 247 | VOID RedrawMatrixColumn ( 248 | _Inout_ PMATRIX_COLUMN column, 249 | _In_ PMATRIX matrix, 250 | _In_ HDC hdc, 251 | _In_ ULONG xpos 252 | ) 253 | { 254 | GLYPH glyph; 255 | 256 | // loop down the length of the column redrawing only what needs doing 257 | for (ULONG_PTR i = 0; i < column->length; i++) 258 | { 259 | glyph = column->glyph[i]; 260 | 261 | // does this glyph (character) need to be redrawn? 262 | if (glyph & GLYPH_REDRAW) 263 | { 264 | if ((GlyphIntensity (glyph) >= MAX_INTENSITY - 1) && (i == column->blip_pos + 0 || i == column->blip_pos + 1 || i == column->blip_pos + 8 || i == column->blip_pos + 9)) 265 | glyph |= MAX_INTENSITY << 8; 266 | 267 | DrawGlyph (matrix, hdc, xpos, (ULONG)i * GLYPH_HEIGHT, glyph); 268 | 269 | // clear redraw state 270 | column->glyph[i] &= ~GLYPH_REDRAW; 271 | } 272 | } 273 | } 274 | 275 | HBITMAP MakeBitmap ( 276 | _In_ HDC hdc, 277 | _In_ HINSTANCE hinst, 278 | _In_ UINT type, 279 | _In_ LONG hue 280 | ) 281 | { 282 | RGBQUAD pal[256] = {0}; 283 | DIBSECTION dib = {0}; 284 | LPBITMAPINFOHEADER lpbih; 285 | PULONG dest = NULL; 286 | PBYTE src; 287 | HDC hdc_c; 288 | HBITMAP hglyph; 289 | HBITMAP hdib; 290 | HANDLE hbitmap_old; 291 | RGBQUAD rgb; 292 | COLORREF clr; 293 | WORD h, s, l; 294 | 295 | // load the 8bit image 296 | hglyph = LoadImageW (hinst, MAKEINTRESOURCE (IDR_GLYPH), IMAGE_BITMAP, 0, 0, LR_CREATEDIBSECTION); 297 | 298 | // extract the colour table 299 | hdc_c = CreateCompatibleDC (hdc); 300 | hbitmap_old = SelectObject (hdc_c, hglyph); 301 | 302 | GetDIBColorTable (hdc_c, 0, RTL_NUMBER_OF (pal), pal); 303 | SelectObject (hdc_c, hbitmap_old); 304 | 305 | GetObjectW (hglyph, sizeof (dib), &dib); 306 | 307 | src = dib.dsBm.bmBits; 308 | lpbih = &dib.dsBmih; 309 | 310 | // change to a 32bit bitmap 311 | dib.dsBm.bmBitsPixel = 32; 312 | dib.dsBm.bmPlanes = 1; 313 | dib.dsBm.bmWidthBytes = dib.dsBm.bmWidth * 4; 314 | dib.dsBmih.biBitCount = 32; 315 | dib.dsBmih.biPlanes = 1; 316 | dib.dsBmih.biCompression = BI_RGB; 317 | dib.dsBmih.biSizeImage = (dib.dsBmih.biWidth * dib.dsBmih.biHeight) * 4; 318 | 319 | // create a new (blank) 32bit DIB section 320 | hdib = CreateDIBSection (hdc_c, (LPBITMAPINFO)&dib.dsBmih, DIB_RGB_COLORS, &dest, 0, 0); 321 | 322 | // copy each pixel 323 | for (LONG i = 0; i < lpbih->biWidth * lpbih->biHeight; i++) 324 | { 325 | // convert 8bit palette entry to 32bit colour 326 | rgb = pal[*src++]; 327 | clr = RGB (rgb.rgbRed, rgb.rgbGreen, rgb.rgbBlue); 328 | 329 | // convert the RGB colour to H,S,L values 330 | RGBtoHSL (clr, &h, &s, &l); 331 | 332 | // create the new colour 333 | *dest++ = HSLtoRGB ((WORD)hue, s, l); 334 | } 335 | 336 | DeleteObject (hglyph); 337 | DeleteDC (hdc_c); 338 | 339 | return hdib; 340 | } 341 | 342 | VOID SetMatrixBitmap ( 343 | _In_ HDC hdc, 344 | _Inout_ PMATRIX matrix, 345 | _In_ INT hue 346 | ) 347 | { 348 | HBITMAP hbitmap; 349 | HBITMAP hbitmap_old; 350 | 351 | hbitmap = MakeBitmap (hdc, _r_sys_getimagebase (), IDR_GLYPH, hue); 352 | 353 | if (!hbitmap) 354 | return; 355 | 356 | hbitmap_old = SelectObject (matrix->hdc, hbitmap); 357 | 358 | if (hbitmap_old) 359 | DeleteObject (hbitmap_old); 360 | 361 | matrix->hbitmap = hbitmap; 362 | 363 | SelectObject (matrix->hdc, matrix->hbitmap); 364 | } 365 | 366 | VOID DecodeMatrix ( 367 | _In_ HWND hwnd, 368 | _In_ PMATRIX matrix 369 | ) 370 | { 371 | static LONG new_hue = 0; 372 | 373 | PMATRIX_COLUMN column; 374 | HDC hdc; 375 | 376 | hdc = GetDC (hwnd); 377 | 378 | if (!hdc) 379 | return; 380 | 381 | if (!new_hue) 382 | new_hue = config.hue; 383 | 384 | for (ULONG_PTR x = 0; x < matrix->numcols; x++) 385 | { 386 | column = &matrix->column[x]; 387 | 388 | RandomMatrixColumn (column); 389 | ScrollMatrixColumn (column); 390 | RedrawMatrixColumn (column, matrix, hdc, (ULONG)x * GLYPH_WIDTH); 391 | } 392 | 393 | if (config.is_random) 394 | { 395 | if (config.is_smooth) 396 | { 397 | new_hue = (new_hue >= HUE_MAX) ? HUE_MIN : new_hue + 1; 398 | } 399 | else 400 | { 401 | if (_r_sys_gettickcount () % 2) 402 | new_hue = _r_math_getrandomrange (HUE_MIN, HUE_MAX); 403 | } 404 | } 405 | else 406 | { 407 | new_hue = config.hue; 408 | } 409 | 410 | SetMatrixBitmap (hdc, matrix, new_hue); 411 | 412 | ReleaseDC (hwnd, hdc); 413 | } 414 | 415 | PMATRIX CreateMatrix ( 416 | _In_ ULONG width, 417 | _In_ ULONG height 418 | ) 419 | { 420 | PMATRIX matrix; 421 | HDC hdc; 422 | ULONG numcols; 423 | ULONG numrows; 424 | 425 | numcols = width / GLYPH_WIDTH + 1; 426 | numrows = height / GLYPH_HEIGHT + 1; 427 | 428 | matrix = _r_mem_allocate (sizeof (MATRIX) + (sizeof (MATRIX_COLUMN) * numcols)); 429 | 430 | matrix->numcols = numcols; 431 | matrix->numrows = numrows; 432 | matrix->width = width; 433 | matrix->height = height; 434 | 435 | for (ULONG x = 0; x < numcols; x++) 436 | { 437 | matrix->column[x].length = numrows; 438 | matrix->column[x].countdown = _r_math_getrandomrange (0, RND_MAX) % 100; 439 | matrix->column[x].state = _r_math_getrandomrange (0, RND_MAX) % 2; 440 | matrix->column[x].run_length = _r_math_getrandomrange (0, RND_MAX) % 20 + 3; 441 | 442 | matrix->column[x].glyph = _r_mem_allocate (sizeof (GLYPH) * (numrows + 16)); 443 | } 444 | 445 | hdc = GetDC (NULL); 446 | 447 | if (hdc) 448 | { 449 | matrix->hdc = CreateCompatibleDC (hdc); 450 | matrix->hbitmap = MakeBitmap (hdc, _r_sys_getimagebase (), IDR_GLYPH, config.hue); 451 | 452 | SelectObject (matrix->hdc, matrix->hbitmap); 453 | 454 | ReleaseDC (NULL, hdc); 455 | } 456 | 457 | return matrix; 458 | } 459 | 460 | VOID DestroyMatrix ( 461 | _Inout_ PMATRIX *matrix 462 | ) 463 | { 464 | PMATRIX old_matrix; 465 | PGLYPH glyph; 466 | 467 | old_matrix = *matrix; 468 | *matrix = NULL; 469 | 470 | DeleteDC (old_matrix->hdc); 471 | DeleteObject (old_matrix->hbitmap); 472 | 473 | for (ULONG_PTR x = 0; x < old_matrix->numcols; x++) 474 | { 475 | glyph = old_matrix->column[x].glyph; 476 | 477 | if (glyph) 478 | { 479 | old_matrix->column[x].glyph = NULL; 480 | 481 | _r_mem_free (glyph); 482 | } 483 | } 484 | 485 | _r_mem_free (old_matrix); 486 | } 487 | 488 | LRESULT CALLBACK ScreensaverProc ( 489 | _In_ HWND hwnd, 490 | _In_ UINT msg, 491 | _In_ WPARAM wparam, 492 | _In_ LPARAM lparam 493 | ) 494 | { 495 | static POINT pt_last = {0}; 496 | static POINT pt_cursor = {0}; 497 | static BOOLEAN is_savecursor = FALSE; 498 | 499 | PMATRIX matrix; 500 | 501 | switch (msg) 502 | { 503 | case WM_NCCREATE: 504 | { 505 | LPCREATESTRUCT pcs; 506 | 507 | pcs = (LPCREATESTRUCT)lparam; 508 | 509 | matrix = CreateMatrix (pcs->cx, pcs->cy); 510 | 511 | if (!matrix) 512 | return FALSE; 513 | 514 | SetWindowLongPtrW (hwnd, GWLP_USERDATA, (LONG_PTR)matrix); 515 | SetTimer (hwnd, UID, ((SPEED_MAX - config.speed) + SPEED_MIN) * 10, 0); 516 | 517 | return TRUE; 518 | } 519 | 520 | case WM_NCDESTROY: 521 | { 522 | KillTimer (hwnd, UID); 523 | is_savecursor = FALSE; 524 | 525 | matrix = (PMATRIX)GetWindowLongPtr (hwnd, GWLP_USERDATA); 526 | 527 | if (matrix) 528 | { 529 | SetWindowLongPtrW (hwnd, GWLP_USERDATA, 0); 530 | 531 | DestroyMatrix (&matrix); 532 | } 533 | 534 | if (config.is_preview && !GetParent (hwnd)) 535 | return FALSE; 536 | 537 | PostQuitMessage (0); 538 | 539 | return FALSE; 540 | } 541 | 542 | case WM_CLOSE: 543 | { 544 | DestroyWindow (hwnd); 545 | 546 | return FALSE; 547 | } 548 | 549 | case WM_TIMER: 550 | { 551 | matrix = (PMATRIX)GetWindowLongPtr (hwnd, GWLP_USERDATA); 552 | 553 | if (matrix) 554 | DecodeMatrix (hwnd, matrix); 555 | 556 | return FALSE; 557 | } 558 | 559 | case WM_KEYDOWN: 560 | case WM_SYSKEYDOWN: 561 | { 562 | if (wparam != VK_ESCAPE && config.is_esc_only) 563 | return FALSE; 564 | 565 | DestroyWindow (hwnd); 566 | 567 | return FALSE; 568 | } 569 | 570 | case WM_MOUSEMOVE: 571 | { 572 | LONG icon_size; 573 | 574 | if (GetParent (hwnd) || config.is_esc_only) 575 | return FALSE; 576 | 577 | if (!is_savecursor) 578 | { 579 | GetCursorPos (&pt_last); 580 | 581 | is_savecursor = TRUE; 582 | } 583 | 584 | GetCursorPos (&pt_cursor); 585 | 586 | icon_size = _r_dc_getsystemmetrics (SM_CXSMICON, _r_dc_getwindowdpi (hwnd)); 587 | 588 | if (abs (pt_cursor.x - pt_last.x) >= (icon_size / 2) || abs (pt_cursor.y - pt_last.y) >= (icon_size / 2)) 589 | { 590 | DestroyWindow (hwnd); 591 | 592 | return FALSE; 593 | } 594 | 595 | pt_last = pt_cursor; 596 | 597 | return FALSE; 598 | } 599 | 600 | case WM_LBUTTONDOWN: 601 | case WM_RBUTTONDOWN: 602 | case WM_MBUTTONDOWN: 603 | { 604 | if (GetParent (hwnd) || config.is_esc_only) 605 | return FALSE; 606 | 607 | DestroyWindow (hwnd); 608 | 609 | break; 610 | } 611 | } 612 | 613 | return DefWindowProc (hwnd, msg, wparam, lparam); 614 | } 615 | 616 | BOOL CALLBACK MonitorEnumProc ( 617 | _In_opt_ HMONITOR hmonitor, 618 | _In_opt_ HDC hdc, 619 | _In_ PRECT rect, 620 | _In_opt_ LPARAM lparam 621 | ) 622 | { 623 | HWND hwnd; 624 | ULONG style; 625 | 626 | style = lparam ? WS_CHILD : WS_POPUP; 627 | 628 | hwnd = CreateWindowEx ( 629 | WS_EX_TOPMOST | WS_EX_TOOLWINDOW, 630 | lparam ? CLASS_PREVIEW : CLASS_FULLSCREEN, 631 | _r_app_getname (), 632 | WS_VISIBLE | style, 633 | rect->left, 634 | rect->top, 635 | _r_calc_rectwidth (rect), 636 | _r_calc_rectheight (rect), 637 | (HWND)lparam, 638 | NULL, 639 | _r_sys_getimagebase (), 640 | NULL 641 | ); 642 | 643 | return TRUE; 644 | } 645 | 646 | VOID StartScreensaver ( 647 | _In_opt_ HWND hparent 648 | ) 649 | { 650 | RECT rect; 651 | UINT state = 0; 652 | 653 | if (hparent) 654 | { 655 | if (GetClientRect (hparent, &rect)) 656 | MonitorEnumProc (NULL, NULL, &rect, (LPARAM)hparent); 657 | } 658 | else 659 | { 660 | EnumDisplayMonitors (NULL, NULL, &MonitorEnumProc, 0); 661 | } 662 | } 663 | 664 | INT_PTR CALLBACK SettingsProc ( 665 | _In_ HWND hwnd, 666 | _In_ UINT msg, 667 | _In_ WPARAM wparam, 668 | _In_ LPARAM lparam 669 | ) 670 | { 671 | switch (msg) 672 | { 673 | case WM_INITDIALOG: 674 | { 675 | HWND hpreview; 676 | 677 | hpreview = GetDlgItem (hwnd, IDC_PREVIEW); 678 | 679 | // localize window 680 | _r_ctrl_setstringformat (hwnd, IDC_AMOUNT_RANGE, L"%d-%d", AMOUNT_MIN, AMOUNT_MAX); 681 | _r_ctrl_setstringformat (hwnd, IDC_DENSITY_RANGE, L"%d-%d", DENSITY_MIN, DENSITY_MAX); 682 | _r_ctrl_setstringformat (hwnd, IDC_SPEED_RANGE, L"%d-%d", SPEED_MIN, SPEED_MAX); 683 | _r_ctrl_setstringformat (hwnd, IDC_HUE_RANGE, L"%d-%d", HUE_MIN, HUE_MAX); 684 | 685 | SendDlgItemMessageW (hwnd, IDC_AMOUNT, UDM_SETRANGE32, AMOUNT_MIN, AMOUNT_MAX); 686 | SendDlgItemMessageW (hwnd, IDC_AMOUNT, UDM_SETPOS32, 0, (LPARAM)config.amount); 687 | 688 | SendDlgItemMessageW (hwnd, IDC_DENSITY, UDM_SETRANGE32, DENSITY_MIN, DENSITY_MAX); 689 | SendDlgItemMessageW (hwnd, IDC_DENSITY, UDM_SETPOS32, 0, (LPARAM)config.density); 690 | 691 | SendDlgItemMessageW (hwnd, IDC_SPEED, UDM_SETRANGE32, SPEED_MIN, SPEED_MAX); 692 | SendDlgItemMessageW (hwnd, IDC_SPEED, UDM_SETPOS32, 0, (LPARAM)config.speed); 693 | 694 | SendDlgItemMessageW (hwnd, IDC_HUE, UDM_SETRANGE32, HUE_MIN, HUE_MAX); 695 | SendDlgItemMessageW (hwnd, IDC_HUE, UDM_SETPOS32, 0, (LPARAM)config.hue); 696 | 697 | CheckDlgButton (hwnd, IDC_RANDOMIZECOLORS_CHK, config.is_random); 698 | CheckDlgButton (hwnd, IDC_RANDOMIZESMOOTH_CHK, config.is_smooth); 699 | CheckDlgButton (hwnd, IDC_ISCLOSEONESC_CHK, config.is_esc_only); 700 | 701 | SendMessage (hwnd, WM_COMMAND, MAKEWPARAM (IDC_RANDOMIZECOLORS_CHK, 0), 0); 702 | SendMessage (hwnd, WM_COMMAND, MAKEWPARAM (IDC_ISCLOSEONESC_CHK, 0), 0); 703 | 704 | _r_ctrl_setstringformat (hwnd, IDC_ABOUT, L"Github", _r_app_getwebsite_url ()); 705 | 706 | StartScreensaver (hpreview); 707 | 708 | break; 709 | } 710 | 711 | case WM_CLOSE: 712 | { 713 | DestroyWindow (hwnd); 714 | break; 715 | } 716 | 717 | case WM_DESTROY: 718 | { 719 | SaveSettings (); 720 | 721 | PostQuitMessage (0); 722 | 723 | break; 724 | } 725 | 726 | case WM_CTLCOLORSTATIC: 727 | { 728 | INT ctrl_id = GetDlgCtrlID ((HWND)lparam); 729 | 730 | if (ctrl_id == IDC_AMOUNT_RANGE || ctrl_id == IDC_DENSITY_RANGE || ctrl_id == IDC_SPEED_RANGE || ctrl_id == IDC_HUE_RANGE) 731 | { 732 | SetBkMode ((HDC)wparam, TRANSPARENT); // background-hack 733 | SetTextColor ((HDC)wparam, GetSysColor (COLOR_GRAYTEXT)); 734 | 735 | return (INT_PTR)GetSysColorBrush (COLOR_BTNFACE); 736 | } 737 | 738 | break; 739 | } 740 | 741 | case WM_VSCROLL: 742 | case WM_HSCROLL: 743 | { 744 | INT ctrl_id = GetDlgCtrlID ((HWND)lparam); 745 | 746 | SendMessage (hwnd, WM_COMMAND, MAKEWORD (ctrl_id - 1, 0), 0); 747 | 748 | break; 749 | } 750 | 751 | case WM_LBUTTONDOWN: 752 | { 753 | PostMessageW (hwnd, WM_SYSCOMMAND, SC_MOVE | HTCAPTION, 0); 754 | break; 755 | } 756 | 757 | case WM_ENTERSIZEMOVE: 758 | case WM_EXITSIZEMOVE: 759 | case WM_CAPTURECHANGED: 760 | { 761 | LONG_PTR exstyle = GetWindowLongPtr (hwnd, GWL_EXSTYLE); 762 | 763 | if ((exstyle & WS_EX_LAYERED) == 0) 764 | SetWindowLongPtrW (hwnd, GWL_EXSTYLE, exstyle | WS_EX_LAYERED); 765 | 766 | SetLayeredWindowAttributes (hwnd, 0, (msg == WM_ENTERSIZEMOVE) ? 100 : 255, LWA_ALPHA); 767 | SetCursor (LoadCursor (NULL, (msg == WM_ENTERSIZEMOVE) ? IDC_SIZEALL : IDC_ARROW)); 768 | 769 | break; 770 | } 771 | 772 | case WM_NOTIFY: 773 | { 774 | LPNMHDR nmlp = (LPNMHDR)lparam; 775 | 776 | switch (nmlp->code) 777 | { 778 | case NM_CLICK: 779 | case NM_RETURN: 780 | { 781 | PNMLINK nmlink = (PNMLINK)lparam; 782 | 783 | if (!_r_str_isempty (nmlink->item.szUrl)) 784 | _r_shell_opendefault (nmlink->item.szUrl); 785 | 786 | break; 787 | } 788 | } 789 | 790 | break; 791 | } 792 | 793 | case WM_COMMAND: 794 | { 795 | INT ctrl_id = LOWORD (wparam); 796 | 797 | switch (ctrl_id) 798 | { 799 | //case IDCANCEL: // process Esc key 800 | case IDC_CLOSE: 801 | { 802 | PostMessageW (hwnd, WM_CLOSE, 0, 0); 803 | break; 804 | } 805 | 806 | case IDC_RESET: 807 | { 808 | if (_r_show_message (hwnd, MB_YESNO | MB_ICONEXCLAMATION | MB_DEFBUTTON2, NULL, L"Are you really sure you want to reset all application settings?") != IDYES) 809 | break; 810 | 811 | ReadSettings (); 812 | 813 | CheckDlgButton (hwnd, IDC_RANDOMIZECOLORS_CHK, config.is_random ? BST_CHECKED : BST_UNCHECKED); 814 | CheckDlgButton (hwnd, IDC_RANDOMIZESMOOTH_CHK, config.is_smooth ? BST_CHECKED : BST_UNCHECKED); 815 | CheckDlgButton (hwnd, IDC_ISCLOSEONESC_CHK, config.is_esc_only ? BST_CHECKED : BST_UNCHECKED); 816 | 817 | SendDlgItemMessageW (hwnd, IDC_AMOUNT, UDM_SETPOS32, 0, AMOUNT_DEFAULT); 818 | SendDlgItemMessageW (hwnd, IDC_DENSITY, UDM_SETPOS32, 0, DENSITY_DEFAULT); 819 | SendDlgItemMessageW (hwnd, IDC_SPEED, UDM_SETPOS32, 0, SPEED_DEFAULT); 820 | SendDlgItemMessageW (hwnd, IDC_HUE, UDM_SETPOS32, 0, HUE_DEFAULT); 821 | 822 | PostMessageW (hwnd, WM_COMMAND, MAKEWPARAM (IDC_RANDOMIZECOLORS_CHK, 0), 0); 823 | PostMessageW (hwnd, WM_COMMAND, MAKEWPARAM (IDC_ISCLOSEONESC_CHK, 0), 0); 824 | 825 | break; 826 | } 827 | 828 | case IDC_SHOW: 829 | { 830 | StartScreensaver (NULL); 831 | break; 832 | } 833 | 834 | case IDC_AMOUNT_CTRL: 835 | { 836 | config.amount = (LONG)SendDlgItemMessageW (hwnd, IDC_AMOUNT, UDM_GETPOS32, 0, 0); 837 | break; 838 | } 839 | 840 | case IDC_DENSITY_CTRL: 841 | { 842 | config.density = (LONG)SendDlgItemMessageW (hwnd, IDC_DENSITY, UDM_GETPOS32, 0, 0); 843 | break; 844 | } 845 | 846 | case IDC_SPEED_CTRL: 847 | { 848 | LONG new_value; 849 | 850 | new_value = (LONG)SendDlgItemMessageW (hwnd, IDC_SPEED, UDM_GETPOS32, 0, 0); 851 | 852 | config.speed = new_value; 853 | 854 | break; 855 | } 856 | 857 | case IDC_HUE_CTRL: 858 | { 859 | LONG new_value; 860 | 861 | new_value = (LONG)SendDlgItemMessageW (hwnd, IDC_HUE, UDM_GETPOS32, 0, 0); 862 | 863 | config.hue = new_value; 864 | 865 | break; 866 | } 867 | 868 | case IDC_RANDOMIZECOLORS_CHK: 869 | { 870 | BOOLEAN is_enabled; 871 | 872 | is_enabled = _r_ctrl_isbuttonchecked (hwnd, ctrl_id); 873 | 874 | _r_ctrl_enable (hwnd, IDC_HUE_CTRL, !is_enabled); 875 | _r_ctrl_enable (hwnd, IDC_HUE, !is_enabled); 876 | _r_ctrl_enable (hwnd, IDC_RANDOMIZESMOOTH_CHK, is_enabled); 877 | 878 | config.is_random = is_enabled; 879 | 880 | break; 881 | } 882 | 883 | case IDC_RANDOMIZESMOOTH_CHK: 884 | { 885 | config.is_smooth = _r_ctrl_isbuttonchecked (hwnd, ctrl_id); 886 | break; 887 | } 888 | 889 | case IDC_ISCLOSEONESC_CHK: 890 | { 891 | config.is_esc_only = _r_ctrl_isbuttonchecked (hwnd, ctrl_id); 892 | break; 893 | } 894 | } 895 | 896 | break; 897 | } 898 | } 899 | 900 | return FALSE; 901 | } 902 | 903 | BOOLEAN RegisterClasses ( 904 | _In_ HINSTANCE hinst 905 | ) 906 | { 907 | WNDCLASSEX wcex = {0}; 908 | 909 | wcex.cbSize = sizeof (wcex); 910 | wcex.hInstance = hinst; 911 | wcex.style = CS_VREDRAW | CS_HREDRAW | CS_SAVEBITS | CS_PARENTDC; 912 | wcex.lpfnWndProc = &ScreensaverProc; 913 | wcex.hbrBackground = GetStockObject (BLACK_BRUSH); 914 | wcex.cbWndExtra = sizeof (PMATRIX); 915 | 916 | wcex.lpszClassName = CLASS_PREVIEW; 917 | wcex.hCursor = LoadCursorW (NULL, IDC_ARROW); 918 | 919 | if (!RegisterClassExW (&wcex)) 920 | { 921 | _r_show_errormessage (NULL, NULL, NtLastError (), NULL, FALSE); 922 | 923 | return FALSE; 924 | } 925 | 926 | wcex.lpszClassName = CLASS_FULLSCREEN; 927 | wcex.hCursor = LoadCursorW (hinst, MAKEINTRESOURCE (IDR_CURSOR)); 928 | 929 | if (!RegisterClassExW (&wcex)) 930 | { 931 | _r_show_errormessage (NULL, NULL, NtLastError (), NULL, FALSE); 932 | 933 | return FALSE; 934 | } 935 | 936 | return TRUE; 937 | } 938 | 939 | INT APIENTRY wWinMain ( 940 | _In_ HINSTANCE hinst, 941 | _In_opt_ HINSTANCE prev_hinst, 942 | _In_ LPWSTR cmdline, 943 | _In_ INT show_cmd 944 | ) 945 | { 946 | R_STRINGREF sr; 947 | HWND hwnd = NULL; 948 | MSG msg; 949 | 950 | if (!_r_app_initialize (NULL)) 951 | return ERROR_NOT_READY; 952 | 953 | // read settings 954 | ReadSettings (); 955 | 956 | // register classes 957 | if (!RegisterClasses (hinst)) 958 | goto CleanupExit; 959 | 960 | _r_obj_initializestringref (&sr, cmdline); 961 | 962 | // parse arguments 963 | if (_r_str_isstartswith2 (&sr, L"/s", TRUE)) 964 | { 965 | StartScreensaver (NULL); 966 | } 967 | else if (_r_str_isstartswith2 (&sr, L"/p", TRUE)) 968 | { 969 | _r_str_skiplength (&sr, 3 * sizeof (WCHAR)); 970 | 971 | hwnd = (HWND)_r_str_tolong_ptr (&sr); 972 | 973 | if (!hwnd) 974 | goto CleanupExit; 975 | 976 | StartScreensaver (hwnd); 977 | } 978 | else 979 | { 980 | config.is_preview = TRUE; 981 | 982 | hwnd = _r_app_createwindow (hinst, MAKEINTRESOURCE (IDD_SETTINGS), MAKEINTRESOURCE (IDI_MAIN), &SettingsProc); 983 | 984 | if (!hwnd) 985 | goto CleanupExit; 986 | } 987 | 988 | if (hwnd) 989 | _r_wnd_message_callback (hwnd, NULL); 990 | 991 | while (GetMessageW (&msg, NULL, 0, 0) > 0) 992 | { 993 | if (config.is_preview && hwnd && IsDialogMessageW (hwnd, &msg)) 994 | continue; 995 | 996 | TranslateMessage (&msg); 997 | DispatchMessageW (&msg); 998 | } 999 | 1000 | CleanupExit: 1001 | 1002 | UnregisterClassW (CLASS_PREVIEW, hinst); 1003 | UnregisterClassW (CLASS_FULLSCREEN, hinst); 1004 | 1005 | return ERROR_SUCCESS; 1006 | } 1007 | -------------------------------------------------------------------------------- /src/main.h: -------------------------------------------------------------------------------- 1 | // Matrix Screensaver 2 | // Copyright (c) J Brown 2003 (catch22.net) 3 | // Copyright (c) 2011-2025 Henry++ 4 | 5 | #pragma once 6 | 7 | #include "routine.h" 8 | 9 | #include "resource.h" 10 | #include "app.h" 11 | 12 | // config 13 | #define UID 0xDEADBEEF 14 | 15 | #define CLASS_FULLSCREEN APP_NAME_SHORT L"_Fullscreen" 16 | #define CLASS_PREVIEW APP_NAME_SHORT L"_Preview" 17 | 18 | #define GLYPH_REDRAW 0x8000 19 | #define GLYPH_BLANK 0x4000 20 | #define RND_MASK 0xB400 21 | 22 | #define AMOUNT_MIN 1 23 | #define AMOUNT_MAX 26 24 | #define AMOUNT_DEFAULT 26 25 | 26 | #define DENSITY_MIN 5 27 | #define DENSITY_MAX 50 28 | #define DENSITY_DEFAULT 30 29 | 30 | #define SPEED_MIN 1 31 | #define SPEED_MAX 10 32 | #define SPEED_DEFAULT 6 33 | 34 | #define HUE_MIN 1 35 | #define HUE_MAX 255 36 | #define HUE_DEFAULT 85 37 | 38 | #define HUE_RANDOM FALSE 39 | #define HUE_RANDOM_SMOOTHTRANSITION TRUE 40 | 41 | // constants inferred from matrix.bmp 42 | #define MAX_INTENSITY 5 // number of intensity levels 43 | #define GLYPH_WIDTH 14 // width of each glyph (pixels) 44 | #define GLYPH_HEIGHT 14 // height of each glyph (pixels) 45 | 46 | typedef struct _STATIC_DATA 47 | { 48 | LONG amount; 49 | LONG density; 50 | LONG speed; 51 | LONG hue; 52 | BOOLEAN is_esc_only; 53 | BOOLEAN is_random; 54 | BOOLEAN is_smooth; 55 | BOOLEAN is_preview; 56 | } STATIC_DATA, *PSTATIC_DATA; 57 | 58 | typedef ULONG GLYPH; 59 | typedef PULONG PGLYPH; 60 | 61 | // 62 | // The "matrix" is basically an array of these 63 | // column structures, positioned side-by-side 64 | // 65 | typedef struct _MATRIX_COLUMN 66 | { 67 | PGLYPH glyph; 68 | 69 | LONG state; 70 | LONG countdown; 71 | 72 | ULONG blip_pos; 73 | ULONG blip_length; 74 | 75 | ULONG length; 76 | ULONG run_length; 77 | 78 | BOOLEAN is_started; 79 | } MATRIX_COLUMN, *PMATRIX_COLUMN; 80 | 81 | typedef struct _MATRIX 82 | { 83 | // bitmap containing glyphs. 84 | HDC hdc; 85 | HBITMAP hbitmap; 86 | 87 | ULONG width; 88 | ULONG height; 89 | ULONG numcols; 90 | ULONG numrows; 91 | 92 | MATRIX_COLUMN column[1]; 93 | } MATRIX, *PMATRIX; 94 | -------------------------------------------------------------------------------- /src/res/100.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/henrypp/matrix/629d9c65c13656456511c31a451bf1829184c5b0/src/res/100.ico -------------------------------------------------------------------------------- /src/res/blank.cur: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/henrypp/matrix/629d9c65c13656456511c31a451bf1829184c5b0/src/res/blank.cur -------------------------------------------------------------------------------- /src/res/glyph.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/henrypp/matrix/629d9c65c13656456511c31a451bf1829184c5b0/src/res/glyph.bmp -------------------------------------------------------------------------------- /src/res/manifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | true 30 | PerMonitorV2, PerMonitor 31 | true 32 | true 33 | true 34 | UTF-8 35 | SegmentHeap 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /src/resource.h: -------------------------------------------------------------------------------- 1 | #ifndef __RESOURCE_H__ 2 | #define __RESOURCE_H__ 3 | 4 | #ifndef IDC_STATIC 5 | #define IDC_STATIC (-1) 6 | #endif 7 | 8 | // Dialogs 9 | #define IDD_SETTINGS 100 10 | 11 | // Settings Dlg 12 | #define IDC_PREVIEW 100 13 | #define IDC_SHOW 101 14 | #define IDC_NAV 102 15 | #define IDC_ABOUT 103 16 | #define IDC_RESET 104 17 | #define IDC_CLOSE 105 18 | 19 | #define IDC_DENSITY_CTRL 106 20 | #define IDC_DENSITY 107 21 | #define IDC_DENSITY_RANGE 108 22 | #define IDC_AMOUNT_CTRL 109 23 | #define IDC_AMOUNT 110 24 | #define IDC_AMOUNT_RANGE 111 25 | #define IDC_SPEED_CTRL 112 26 | #define IDC_SPEED 113 27 | #define IDC_SPEED_RANGE 114 28 | #define IDC_HUE_CTRL 115 29 | #define IDC_HUE 116 30 | #define IDC_HUE_RANGE 117 31 | #define IDC_RANDOMIZECOLORS_CHK 118 32 | #define IDC_RANDOMIZESMOOTH_CHK 119 33 | #define IDC_ISCLOSEONESC_CHK 120 34 | 35 | // Bitmaps 36 | #define IDR_GLYPH 1 37 | 38 | // Cursors 39 | #define IDR_CURSOR 2 40 | 41 | // Icons 42 | #define IDI_MAIN 100 43 | 44 | #endif // __RESOURCE_H__ 45 | -------------------------------------------------------------------------------- /src/resource.rc: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #include "resource.h" 6 | #include "rconfig.h" 7 | #include "app.h" 8 | 9 | LANGUAGE LANG_ENGLISH, SUBLANG_DEFAULT 10 | 11 | // 12 | // Dialog resources 13 | // 14 | IDD_SETTINGS DIALOGEX 0, 0, 384, 280 15 | STYLE DS_SHELLFONT | DS_MODALFRAME | DS_CENTER | WS_POPUPWINDOW | WS_CAPTION | NOT WS_VISIBLE 16 | CAPTION "" 17 | FONT 8, "Ms Shell Dlg" 18 | { 19 | CONTROL "", IDC_PREVIEW, WC_STATIC, SS_NOTIFY, 8, 8, 368, 110, WS_EX_CLIENTEDGE 20 | 21 | GROUPBOX "General:", IDC_STATIC, 8, 126, 180, 64 22 | 23 | LTEXT "Number of glyphs in each level:", IDC_STATIC, 202, 138, 104, 12, SS_CENTERIMAGE 24 | EDITTEXT IDC_AMOUNT_CTRL, 322, 138, 44, 12, ES_AUTOHSCROLL | ES_NUMBER | ES_MULTILINE 25 | CONTROL "", IDC_AMOUNT, UPDOWN_CLASS, UDS_ALIGNRIGHT | UDS_ARROWKEYS | UDS_AUTOBUDDY | UDS_HOTTRACK | UDS_SETBUDDYINT, 0, 0, 0, 0 26 | 27 | LTEXT "Cyphers density:", IDC_STATIC, 202, 154, 104, 12, SS_CENTERIMAGE 28 | EDITTEXT IDC_DENSITY_CTRL, 322, 154, 44, 12, ES_AUTOHSCROLL | ES_NUMBER | ES_MULTILINE 29 | CONTROL "", IDC_DENSITY, UPDOWN_CLASS, UDS_ALIGNRIGHT | UDS_ARROWKEYS | UDS_AUTOBUDDY | UDS_HOTTRACK | UDS_SETBUDDYINT, 0, 0, 0, 0 30 | 31 | LTEXT "Glyphs speed:", IDC_STATIC, 202, 170, 104, 12, SS_CENTERIMAGE 32 | EDITTEXT IDC_SPEED_CTRL, 322, 170, 44, 12, ES_AUTOHSCROLL | ES_NUMBER | ES_MULTILINE 33 | CONTROL "", IDC_SPEED, UPDOWN_CLASS, UDS_ALIGNRIGHT | UDS_ARROWKEYS | UDS_AUTOBUDDY | UDS_HOTTRACK | UDS_SETBUDDYINT, 0, 0, 0, 0 34 | 35 | GROUPBOX "Appearance:", IDC_STATIC, 194, 126, 180, 64 36 | 37 | LTEXT "Color hue:", IDC_STATIC, 16, 138, 104, 12, SS_CENTERIMAGE 38 | EDITTEXT IDC_HUE_CTRL, 136, 138, 44, 12, ES_AUTOHSCROLL | ES_NUMBER | ES_MULTILINE 39 | CONTROL "", IDC_HUE, UPDOWN_CLASS, UDS_ALIGNRIGHT | UDS_ARROWKEYS | UDS_AUTOBUDDY | UDS_HOTTRACK | UDS_SETBUDDYINT, 0, 0, 0, 0 40 | 41 | AUTOCHECKBOX "Randomize colors", IDC_RANDOMIZECOLORS_CHK, 16, 154, 164, 10 42 | AUTOCHECKBOX "Smooth transition", IDC_RANDOMIZESMOOTH_CHK, 16, 166, 164, 10 43 | AUTOCHECKBOX "Close on ""Escape"" only", IDC_ISCLOSEONESC_CHK, 16, 178, 164, 10 44 | 45 | CONTROL "", IDC_ABOUT, WC_LINK, WS_TABSTOP, 68, 262, 100, 10 46 | 47 | PUSHBUTTON "Reset", IDC_RESET, 8, 260, 50, 14 48 | 49 | PUSHBUTTON "Preview", IDC_SHOW, 268, 260, 50, 14 50 | PUSHBUTTON "Close", IDC_CLOSE, 322, 260, 50, 14 51 | } 52 | 53 | // 54 | // String resources 55 | // 56 | STRINGTABLE 57 | { 58 | 1 APP_NAME 59 | } 60 | 61 | // 62 | // Bitmap resources 63 | // 64 | IDR_GLYPH BITMAP DISCARDABLE "res\\glyph.bmp" 65 | 66 | // 67 | // Cursor resources 68 | // 69 | IDR_CURSOR CURSOR "res\\blank.cur" 70 | 71 | // 72 | // Icon resources 73 | // 74 | IDI_MAIN ICON "res\\100.ico" 75 | 76 | // 77 | // Manifest resource 78 | // 79 | 1 RT_MANIFEST "res\\manifest.xml" 80 | 81 | // 82 | // Version Information resources 83 | // 84 | 1 VERSIONINFO 85 | FILEVERSION APP_VERSION_RES 86 | PRODUCTVERSION APP_VERSION_RES 87 | FILEOS VOS__WINDOWS32 88 | FILETYPE VFT_APP 89 | FILESUBTYPE VFT2_UNKNOWN 90 | FILEFLAGSMASK 0x00000000 91 | FILEFLAGS VS_FF_PATCHED | VS_FF_PRERELEASE 92 | { 93 | BLOCK "StringFileInfo" 94 | { 95 | BLOCK "040904E4" 96 | { 97 | VALUE "Comments", APP_COMMENT 98 | VALUE "CompanyName", APP_AUTHOR 99 | VALUE "FileDescription", APP_NAME 100 | VALUE "FileVersion", APP_VERSION 101 | VALUE "InternalName", APP_NAME_SHORT 102 | VALUE "LegalCopyright", APP_COPYRIGHT 103 | VALUE "OriginalFilename", APP_NAME_SHORT ".scr" 104 | VALUE "ProductName", APP_NAME 105 | VALUE "ProductVersion", APP_VERSION 106 | } 107 | } 108 | BLOCK "VarFileInfo" 109 | { 110 | VALUE "Translation", 0x0409, 1252 111 | } 112 | } 113 | --------------------------------------------------------------------------------