Repository: henrypp/memreduct Branch: master Commit: 942c2474d38a Files: 60 Total size: 215.3 KB Directory structure: gitextract_s1we0p34/ ├── .gitattributes ├── .github/ │ ├── FUNDING.yml │ └── ISSUE_TEMPLATE/ │ ├── bug_report.yml │ ├── config.yml │ ├── feature_request.yml │ └── question.md ├── .gitignore ├── .gitmodules ├── CHANGELOG.md ├── LICENSE ├── README.md ├── VERSION ├── bin/ │ ├── History.txt │ ├── License.txt │ ├── Readme.txt │ ├── i18n/ │ │ ├── !example.txt │ │ ├── Arabic.ini │ │ ├── Bulgarian.ini │ │ ├── Catalan.ini │ │ ├── Chinese (Simplified).ini │ │ ├── Chinese (Traditional).ini │ │ ├── Czech.ini │ │ ├── Dutch.ini │ │ ├── French.ini │ │ ├── German.ini │ │ ├── Hebrew.ini │ │ ├── Hungarian.ini │ │ ├── Indonesian.ini │ │ ├── Italian.ini │ │ ├── Japanese.ini │ │ ├── Kazakh.ini │ │ ├── Korean.ini │ │ ├── Persian.ini │ │ ├── Polish.ini │ │ ├── Portuguese (Brazil).ini │ │ ├── Portuguese.ini │ │ ├── Romanian.ini │ │ ├── Russian.ini │ │ ├── Serbian (Cyrillic).ini │ │ ├── Serbian (Latin).ini │ │ ├── Slovak.ini │ │ ├── Spanish.ini │ │ ├── Swedish.ini │ │ ├── Turkish.ini │ │ ├── Ukrainian.ini │ │ └── Vietnamese.ini │ └── memreduct.lng ├── build.bat ├── build_locale.bat ├── build_vc.bat ├── memreduct.sln ├── memreduct.vcxproj ├── memreduct.vcxproj.filters ├── memreduct.vcxproj.user └── src/ ├── app.h ├── main.c ├── main.h ├── res/ │ └── manifest.xml ├── resource.h └── resource.rc ================================================ FILE CONTENTS ================================================ ================================================ FILE: .gitattributes ================================================ *.c diff *.cpp diff *.h diff *.rc diff *.ini diff *.txt diff *.xml diff *.lng diff ================================================ FILE: .github/FUNDING.yml ================================================ 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"] ================================================ FILE: .github/ISSUE_TEMPLATE/bug_report.yml ================================================ name: Bug report title: "[Bug]" description: Let me know about crash or existing functionality not working like it should. labels: [ "bug" ] body: - type: markdown attributes: value: Thanks for taking the time to fill out this bug report! - type: checkboxes id: checklist attributes: label: Checklist options: - label: I have used the search function to see if someone else has already submitted the same bug report. required: true - label: I will describe the problem with as much detail as possible. required: true - type: input id: version attributes: label: App version description: What the application version do you use. placeholder: x.y.z validations: required: true - type: input id: windows_version attributes: label: Windows version description: What Windows version do you use. validations: required: true - type: textarea id: steps attributes: label: Steps to reproduce placeholder: | 1. Go to '…' 2. Click on '…' 3. Scroll down to '…' 4. etc. validations: required: true - type: textarea id: expected attributes: label: Expected behavior description: After following the steps, what did you think application would do? validations: required: false - type: textarea id: actual attributes: label: Actual behavior description: What did application do instead? Screenshots might help. validations: required: true - type: textarea id: logs attributes: label: Logs description: | - If application have debug log insert it here. - If application have crash dump please attach it here. Tip: You can attach images, log files or crash dumps by clicking this area to highlight it and then dragging files in. ================================================ FILE: .github/ISSUE_TEMPLATE/config.yml ================================================ blank_issues_enabled: false ================================================ FILE: .github/ISSUE_TEMPLATE/feature_request.yml ================================================ name: Feature request title: "[Feature]" description: Suggest an idea for this project. labels: [ "feature" ] body: - type: checkboxes id: checklist attributes: label: Checklist options: - label: I have used the search function to see if someone else has already submitted the same feature request. required: true - label: I will describe the problem with as much detail as possible. required: true - label: This issue only contains a request for one single feature, **not** multiple (related) features. required: true - type: input id: version attributes: label: App version description: What the application version do you use. placeholder: x.y.z validations: required: true - type: textarea id: problem attributes: label: Problem you are trying to solve description: Give a brief explanation of the problem you are trying to solve. validations: required: true - type: textarea id: solution attributes: label: Suggested solution description: Describe how you would like the app to help you solve that problem. Try to be as specific as possible. validations: required: true - type: textarea id: screenshots attributes: label: Screenshots / Drawings / Technical details description: | 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. Tip: You can attach images or log files by clicking this area to highlight it and then dragging files in. ================================================ FILE: .github/ISSUE_TEMPLATE/question.md ================================================ --- name: Question about: Ask a question about application. title: '[Question]' labels: [ "question" ] assignees: '' --- Describe the question with as much detail as possible. --- App version: Windows version: ================================================ FILE: .gitignore ================================================ .vs/ .vscode/ temp/ packages/ bin/32/ bin/64/ bin/arm64/ x64/ win32/ arm64/ __pycache__ thumbs.db ehthumbs.db desktop.ini *.cab *.msi *.msm *.msp *.lnk *.jpg *.zip *.log *.pdb *.exp *.sdf *.opensdf *.db *.opendb *.suo *.exp *.iobj *.ipch *.ipdb *.ilk *.obj *.res *.tlog *PVS-Studio* ================================================ FILE: .gitmodules ================================================ [submodule "routine"] path = ../routine url = https://github.com/henrypp/routine.git [submodule "builder"] path = ../builder url = https://github.com/henrypp/builder.git ================================================ FILE: CHANGELOG.md ================================================ v3.5.2 (1 April 2025) - added modified file cache clean - fixed pagefile displays wrong information (issue #262) - improved dark theme support - updated localization - updated project sdk v3.5.1 (27 December 2024) - now percentage displays as float numbers - fixed option for round window corners (issue #252) - fixed pagefile obtaining information (issue #243) v3.5 (17 December 2024) - added registry cache clean (win 8.1+) - added mitigations (win10+) - added dark theme support - stability improvements - updated translations - updated project sdk - fixed command line interface (issue #204) - fixed pagefile information display - fixed cosmetics bugs - fixed bugs v3.4 (25 January 2022) - security code improvements - improved windows 10 support - added arm64 binaries (portable only) - added option to opt-out cleanup standby list restriction (issue #92) - added dropdown menu for button to clean specified memory region - added log cleanup results into a file feature (issue #76) - added option to disable tray balloon sound - added command line support (issue #82) - added single-click tray icon option - added per-monitor dpi support - changed default ranges for up-down controls (issue #107) - fixed wrong unit in notification (issue #112) - fixed update installation in some cases - fixed winxp font selection - updated translations - updated project sdk - fixed cosmetics bugs - fixed bugs v3.3.5 (10 February 2019) - updated project sdk - fixed running as admin on every startup - fixed cosmetics bugs - fixed bugs v3.3.4 (20 October 2018) - fixed tray icon bug on windows xp v3.3.3 (19 October 2018) - updated project sdk - stability improvements - fixed saving autoreduct option in tray menu - fixed windows xp support - fixed bugs v3.3.2 (9 February 2018) - revert "start minimized" option (issue #39) - updated project sdk - cosmetic fixes v3.3.1 (5 January 2018) - disable auto-reduct by default - updated translations - updated project sdk - cosmetic fixes v3.3 (20 October 2017) - new settings dialog - added "combine memory lists" area (win10 and above) - added warning message for "standby list" & "modified page list" about freezes (issue #17) - updated translations - updated project sdk - fixed freezes after auto-reduct - fixed ui bugs - fixed bugs v3.2.2 (9 September 2017) - added set default language as in system - more precise cleaning result - fixed cleaning result crash - updated translations - updated project sdk v3.2.1 (9 May 2017) - show clean result even if it's empty - fixed settings window tabstop - updated project sdk v3.2 (30 October 2016) - fixed skip uac doesn't worked - fixed footer postition - updated translations v3.1.1454 (19 August 2016) - updated translations - updated project sdk v3.1.1453 (26 February 2016) - now locale applied without restart - fixed critical bug in locale engine - fixed muted messagebox v3.1.1452 (12 February 2016) - fixed uac incorrect checking when spaces in path - stability fixes (now compiled with "treat warning as errors" key) v3.1.1451 (11 February 2016) - fixed transparent background with antialiased font v3.1.1450 (10 February 2016) - added windows xp (64-bit) support - small ui fixes - fixed bugs v3.1.1310 (20 November 2015) - added tray menu for configure clean areas - fixed tray menu incorrect range calculation bug - returned the "reductconfirmation" config [issue #9] v3.1.1262 (31 October 2015) - added option to disable balloon tips - fixed hotkey settings - fixed windows xp support v3.1.1201 (28 October 2015) - added french localization - added hungarian localization - fixed cleaning by timeout doesn't triggered due optimizations v3.1.1186 (27 October 2015) - added antialiasing - added memory cleaning by timeout - added middle click tray icon action customization - new localization model (plain text) - changed default tray icon style - improved settings window - skip uac sometimes doesn't work - small ui fixes v3.0.436 (1 May 2015) - updated greek localization - updated polish localization - fixed tray icon incorrect memory value - fixed memory reduction behaviour under non-admin account (windows xp) - fixed main window footer incorrect size (windows xp) - fixed update checking request cached incorrect - fixed installer script - fixed bugs v3.0.377 (26 April 2015) - added spanish (argentina) localization - updated french localization - updated korean localization - updated russian localization - fixed bugs v3.0.305 (21 April 2015) - added french localization - added german localization - added cleaning confirmation switch - added cleaning on tray icon double click feature - fixed transparency & color indication compatibility - fixed bugs v3.0.277 (19 April 2015) - added icon animation - added greek localization - added slovak localization - added spanish localization - fixed critical bug in korean localization - fixed bug when application prevent restart (windows xp) v3.0.206 (17 April 2015) - added russian localization - added korean localization - fixed auto-reduct doesn't clean normally - fixed bugs v3.0.187 (14 April 2015) - windows 10 support - x64 support - added "standby list without priority" cleaning - added icon transparency - skip uac prompt feature - improved uac/uipi/dpi compatibility - fixed tray icon disappear when explorer restart - now process priority set to "high" - i/o operations optimization - fixed ui & bugs v2.4 (17 September 2013) - added tray icon customization - uac compatibility improved - x64 compatibility improved - changed application icon - fixed ui & bugs v2.3 (14 July 2012) - windows 8 support - added "bulgarian" localization (by nahalnik) - added "chinese (simplified)" localization (by hsxz) - added "chinese (traditional)" translation (by hsxz) - listview color indication - removed admin rights requirement (shown only if necessary) - fixed ui & bugs v2.2 (24 May 2012) - added on double-click option "start memory reduction (silently)" - fixed auto cleaning configuration v2.1 (23 May 2012) - added "portuguese" localization (by lucas macedo) - added auto cleaning configuration - added balloon tips - added "system working set" usage - fixed percentage calculation - fixed memory leak - fixed ui & bugs v2.0 (2 April 2012) - program worked in the background now - windows xp partial support - localization support - more new settings - fixed ui & bugs v1.1 (10 November 2011) - memory clening region configuration - added "working set" cleaning - added "page list" information - fixed ui & bugs v1.0 (27 October 2011) - first public version ================================================ FILE: LICENSE ================================================ GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 Copyright (C) 2007 Free Software Foundation, Inc. Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The GNU General Public License is a free, copyleft license for software and other kinds of works. The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software for all its users. We, the Free Software Foundation, use the GNU General Public License for most of our software; it applies also to any other work released this way by its authors. You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things. To protect your rights, we need to prevent others from denying you these rights or asking you to surrender the rights. Therefore, you have certain responsibilities if you distribute copies of the software, or if you modify it: responsibilities to respect the freedom of others. For example, if you distribute copies of such a program, whether gratis or for a fee, you must pass on to the recipients the same freedoms that you received. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. Developers that use the GNU GPL protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License giving you legal permission to copy, distribute and/or modify it. For the developers' and authors' protection, the GPL clearly explains that there is no warranty for this free software. For both users' and authors' sake, the GPL requires that modified versions be marked as changed, so that their problems will not be attributed erroneously to authors of previous versions. Some devices are designed to deny users access to install or run modified versions of the software inside them, although the manufacturer can do so. This is fundamentally incompatible with the aim of protecting users' freedom to change the software. The systematic pattern of such abuse occurs in the area of products for individuals to use, which is precisely where it is most unacceptable. Therefore, we have designed this version of the GPL to prohibit the practice for those products. If such problems arise substantially in other domains, we stand ready to extend this provision to those domains in future versions of the GPL, as needed to protect the freedom of users. Finally, every program is threatened constantly by software patents. States should not allow patents to restrict development and use of software on general-purpose computers, but in those that do, we wish to avoid the special danger that patents applied to a free program could make it effectively proprietary. To prevent this, the GPL assures that patents cannot be used to render the program non-free. The precise terms and conditions for copying, distribution and modification follow. TERMS AND CONDITIONS 0. Definitions. "This License" refers to version 3 of the GNU General Public License. "Copyright" also means copyright-like laws that apply to other kinds of works, such as semiconductor masks. "The Program" refers to any copyrightable work licensed under this License. Each licensee is addressed as "you". "Licensees" and "recipients" may be individuals or organizations. To "modify" a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a "modified version" of the earlier work or a work "based on" the earlier work. A "covered work" means either the unmodified Program or a work based on the Program. To "propagate" a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well. To "convey" a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying. An interactive user interface displays "Appropriate Legal Notices" to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion. 1. Source Code. The "source code" for a work means the preferred form of the work for making modifications to it. "Object code" means any non-source form of a work. A "Standard Interface" means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language. The "System Libraries" of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A "Major Component", in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it. The "Corresponding Source" for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms and other parts of the work. The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source. The Corresponding Source for a work in source code form is that same work. 2. Basic Permissions. All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law. You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you. Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary. 3. Protecting Users' Legal Rights From Anti-Circumvention Law. No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures. When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures. 4. Conveying Verbatim Copies. You may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program. You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee. 5. Conveying Modified Source Versions. You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions: a) The work must carry prominent notices stating that you modified it, and giving a relevant date. b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to "keep intact all notices". c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it. d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so. A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an "aggregate" if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate. 6. Conveying Non-Source Forms. You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways: a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange. b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge. c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b. d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements. e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d. A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work. A "User Product" is either (1) a "consumer product", which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, "normally used" refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product. "Installation Information" for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made. If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM). The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network. Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying. 7. Additional Terms. "Additional permissions" are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions. When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission. Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms: a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or d) Limiting the use for publicity purposes of names of licensors or authors of the material; or e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or f) Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors. All other non-permissive additional terms are considered "further restrictions" within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying. If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms. Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way. 8. Termination. You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11). However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation. Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice. Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10. 9. Acceptance Not Required for Having Copies. You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so. 10. Automatic Licensing of Downstream Recipients. Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License. An "entity transaction" is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts. You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it. 11. Patents. A "contributor" is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's "contributor version". A contributor's "essential patent claims" are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, "control" includes the right to grant patent sublicenses in a manner consistent with the requirements of this License. Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version. In the following three paragraphs, a "patent license" is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To "grant" such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party. If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent license to downstream recipients. "Knowingly relying" means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid. If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it. A patent license is "discriminatory" if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007. Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law. 12. No Surrender of Others' Freedom. If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program. 13. Use with the GNU Affero General Public License. Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU Affero General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the special requirements of the GNU Affero General Public License, section 13, concerning interaction through a network will apply to the combination as such. 14. Revised Versions of this License. The Free Software Foundation may publish revised and/or new versions of the GNU General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies that a certain numbered version of the GNU General Public License "or any later version" applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU General Public License, you may choose any version ever published by the Free Software Foundation. If the Program specifies that a proxy can decide which future versions of the GNU General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program. Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version. 15. Disclaimer of Warranty. THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. Limitation of Liability. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 17. Interpretation of Sections 15 and 16. If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively state the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . Also add information on how to contact you by electronic and paper mail. If the program does terminal interaction, make it output a short notice like this when it starts in an interactive mode: Copyright (C) This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, your program's commands might be different; for a GUI interface, you would use an "about box". You should also get your employer (if you work as a programmer) or school, if any, to sign a "copyright disclaimer" for the program, if necessary. For more information on this, and how to apply and follow the GNU GPL, see . The GNU General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read . ================================================ FILE: README.md ================================================

Mem Reduct

-------

### Description: Lightweight real-time memory management application to monitor and clean system memory on your computer. The program used undocumented internal system features (Native API) to clear system cache (system working set, working set, standby page lists, modified page lists) with variable result ~10-50%. Application it is compatible with Windows XP SP3 and higher operating systems, but some general features available only since Windows Vista. You can download either the installer or portable version. For correct working you are require administrator rights. ``` To activate portable mode, create "memreduct.ini" in application folder, or move it from "%APPDATA%\Henry++\Mem Reduct". ``` ### System requirements: - Windows 7, 8, 8.1, 10, 11 64-bit/ARM64 - An SSE2-capable CPU - KB2533623 [KB3063858](https://www.microsoft.com/en-us/download/details.aspx?id=47442) update for Windows 7 was required ### Donate: - [Bitcoin](https://www.blockchain.com/btc/address/1LrRTXPsvHcQWCNZotA9RcwjsGcRghG96c) (BTC) - [Ethereum](https://www.blockchain.com/explorer/addresses/eth/0xe2C84A62eb2a4EF154b19bec0c1c106734B95960) (ETH) - [Yandex Money](https://yoomoney.ru/to/4100115776040583) (RUB) - [Paypal](https://paypal.me/henrypp) (USD) ### GPG Signature: Binaries have GPG signature `memreduct.exe.sig` in application folder. - 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)) - Key ID: 0x5635B5FD - Fingerprint: D985 2361 1524 AB29 BE73 30AC 2881 20A7 5635 B5FD --- - Website: [github.com/henrypp](https://github.com/henrypp) - Support: sforce5@mail.ru --- (c) 2011-2026 Henry++ ================================================ FILE: VERSION ================================================ memreduct=3.5.2|https://github.com/henrypp/memreduct/releases/download/v.3.5.2/memreduct-3.5.2-setup.exe; language=1771152107|https://raw.githubusercontent.com/henrypp/memreduct/master/bin/memreduct.lng; ================================================ FILE: bin/History.txt ================================================ v3.5.2 (1 April 2025) - added modified file cache clean - fixed pagefile displays wrong information (issue #262) - improved dark theme support - updated localization - updated project sdk v3.5.1 (27 December 2024) - now percentage displays as float numbers - fixed option for round window corners (issue #252) - fixed pagefile obtaining information (issue #243) v3.5 (17 December 2024) - added registry cache clean (win 8.1+) - added mitigations (win10+) - added dark theme support - stability improvements - updated translations - updated project sdk - fixed command line interface (issue #204) - fixed pagefile information display - fixed cosmetics bugs - fixed bugs v3.4 (25 January 2022) - security code improvements - improved windows 10 support - added arm64 binaries (portable only) - added option to opt-out cleanup standby list restriction (issue #92) - added dropdown menu for button to clean specified memory region - added log cleanup results into a file feature (issue #76) - added option to disable tray balloon sound - added command line support (issue #82) - added single-click tray icon option - added per-monitor dpi support - changed default ranges for up-down controls (issue #107) - fixed wrong unit in notification (issue #112) - fixed update installation in some cases - fixed winxp font selection - updated translations - updated project sdk - fixed cosmetics bugs - fixed bugs v3.3.5 (10 February 2019) - updated project sdk - fixed running as admin on every startup - fixed cosmetics bugs - fixed bugs v3.3.4 (20 October 2018) - fixed tray icon bug on windows xp v3.3.3 (19 October 2018) - updated project sdk - stability improvements - fixed saving autoreduct option in tray menu - fixed windows xp support - fixed bugs v3.3.2 (9 February 2018) - revert "start minimized" option (issue #39) - updated project sdk - cosmetic fixes v3.3.1 (5 January 2018) - disable auto-reduct by default - updated translations - updated project sdk - cosmetic fixes v3.3 (20 October 2017) - new settings dialog - added "combine memory lists" area (win10 and above) - added warning message for "standby list" & "modified page list" about freezes (issue #17) - updated translations - updated project sdk - fixed freezes after auto-reduct - fixed ui bugs - fixed bugs v3.2.2 (9 September 2017) - added set default language as in system - more precise cleaning result - fixed cleaning result crash - updated translations - updated project sdk v3.2.1 (9 May 2017) - show clean result even if it's empty - fixed settings window tabstop - updated project sdk v3.2 (30 October 2016) - fixed skip uac doesn't worked - fixed footer postition - updated translations v3.1.1454 (19 August 2016) - updated translations - updated project sdk v3.1.1453 (26 February 2016) - now locale applied without restart - fixed critical bug in locale engine - fixed muted messagebox v3.1.1452 (12 February 2016) - fixed uac incorrect checking when spaces in path - stability fixes (now compiled with "treat warning as errors" key) v3.1.1451 (11 February 2016) - fixed transparent background with antialiased font v3.1.1450 (10 February 2016) - added windows xp (64-bit) support - small ui fixes - fixed bugs v3.1.1310 (20 November 2015) - added tray menu for configure clean areas - fixed tray menu incorrect range calculation bug - returned the "reductconfirmation" config [issue #9] v3.1.1262 (31 October 2015) - added option to disable balloon tips - fixed hotkey settings - fixed windows xp support v3.1.1201 (28 October 2015) - added french localization - added hungarian localization - fixed cleaning by timeout doesn't triggered due optimizations v3.1.1186 (27 October 2015) - added antialiasing - added memory cleaning by timeout - added middle click tray icon action customization - new localization model (plain text) - changed default tray icon style - improved settings window - skip uac sometimes doesn't work - small ui fixes v3.0.436 (1 May 2015) - updated greek localization - updated polish localization - fixed tray icon incorrect memory value - fixed memory reduction behaviour under non-admin account (windows xp) - fixed main window footer incorrect size (windows xp) - fixed update checking request cached incorrect - fixed installer script - fixed bugs v3.0.377 (26 April 2015) - added spanish (argentina) localization - updated french localization - updated korean localization - updated russian localization - fixed bugs v3.0.305 (21 April 2015) - added french localization - added german localization - added cleaning confirmation switch - added cleaning on tray icon double click feature - fixed transparency & color indication compatibility - fixed bugs v3.0.277 (19 April 2015) - added icon animation - added greek localization - added slovak localization - added spanish localization - fixed critical bug in korean localization - fixed bug when application prevent restart (windows xp) v3.0.206 (17 April 2015) - added russian localization - added korean localization - fixed auto-reduct doesn't clean normally - fixed bugs v3.0.187 (14 April 2015) - windows 10 support - x64 support - added "standby list without priority" cleaning - added icon transparency - skip uac prompt feature - improved uac/uipi/dpi compatibility - fixed tray icon disappear when explorer restart - now process priority set to "high" - i/o operations optimization - fixed ui & bugs v2.4 (17 September 2013) - added tray icon customization - uac compatibility improved - x64 compatibility improved - changed application icon - fixed ui & bugs v2.3 (14 July 2012) - windows 8 support - added "bulgarian" localization (by nahalnik) - added "chinese (simplified)" localization (by hsxz) - added "chinese (traditional)" translation (by hsxz) - listview color indication - removed admin rights requirement (shown only if necessary) - fixed ui & bugs v2.2 (24 May 2012) - added on double-click option "start memory reduction (silently)" - fixed auto cleaning configuration v2.1 (23 May 2012) - added "portuguese" localization (by lucas macedo) - added auto cleaning configuration - added balloon tips - added "system working set" usage - fixed percentage calculation - fixed memory leak - fixed ui & bugs v2.0 (2 April 2012) - program worked in the background now - windows xp partial support - localization support - more new settings - fixed ui & bugs v1.1 (10 November 2011) - memory clening region configuration - added "working set" cleaning - added "page list" information - fixed ui & bugs v1.0 (27 October 2011) - first public version ================================================ FILE: bin/License.txt ================================================ GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 Copyright (C) 2007 Free Software Foundation, Inc. Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The GNU General Public License is a free, copyleft license for software and other kinds of works. The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software for all its users. We, the Free Software Foundation, use the GNU General Public License for most of our software; it applies also to any other work released this way by its authors. You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things. To protect your rights, we need to prevent others from denying you these rights or asking you to surrender the rights. Therefore, you have certain responsibilities if you distribute copies of the software, or if you modify it: responsibilities to respect the freedom of others. For example, if you distribute copies of such a program, whether gratis or for a fee, you must pass on to the recipients the same freedoms that you received. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. Developers that use the GNU GPL protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License giving you legal permission to copy, distribute and/or modify it. For the developers' and authors' protection, the GPL clearly explains that there is no warranty for this free software. For both users' and authors' sake, the GPL requires that modified versions be marked as changed, so that their problems will not be attributed erroneously to authors of previous versions. Some devices are designed to deny users access to install or run modified versions of the software inside them, although the manufacturer can do so. This is fundamentally incompatible with the aim of protecting users' freedom to change the software. The systematic pattern of such abuse occurs in the area of products for individuals to use, which is precisely where it is most unacceptable. Therefore, we have designed this version of the GPL to prohibit the practice for those products. If such problems arise substantially in other domains, we stand ready to extend this provision to those domains in future versions of the GPL, as needed to protect the freedom of users. Finally, every program is threatened constantly by software patents. States should not allow patents to restrict development and use of software on general-purpose computers, but in those that do, we wish to avoid the special danger that patents applied to a free program could make it effectively proprietary. To prevent this, the GPL assures that patents cannot be used to render the program non-free. The precise terms and conditions for copying, distribution and modification follow. TERMS AND CONDITIONS 0. Definitions. "This License" refers to version 3 of the GNU General Public License. "Copyright" also means copyright-like laws that apply to other kinds of works, such as semiconductor masks. "The Program" refers to any copyrightable work licensed under this License. Each licensee is addressed as "you". "Licensees" and "recipients" may be individuals or organizations. To "modify" a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a "modified version" of the earlier work or a work "based on" the earlier work. A "covered work" means either the unmodified Program or a work based on the Program. To "propagate" a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well. To "convey" a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying. An interactive user interface displays "Appropriate Legal Notices" to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion. 1. Source Code. The "source code" for a work means the preferred form of the work for making modifications to it. "Object code" means any non-source form of a work. A "Standard Interface" means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language. The "System Libraries" of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A "Major Component", in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it. The "Corresponding Source" for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms and other parts of the work. The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source. The Corresponding Source for a work in source code form is that same work. 2. Basic Permissions. All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law. You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you. Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary. 3. Protecting Users' Legal Rights From Anti-Circumvention Law. No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures. When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures. 4. Conveying Verbatim Copies. You may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program. You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee. 5. Conveying Modified Source Versions. You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions: a) The work must carry prominent notices stating that you modified it, and giving a relevant date. b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to "keep intact all notices". c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it. d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so. A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an "aggregate" if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate. 6. Conveying Non-Source Forms. You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways: a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange. b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge. c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b. d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements. e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d. A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work. A "User Product" is either (1) a "consumer product", which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, "normally used" refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product. "Installation Information" for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made. If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM). The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network. Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying. 7. Additional Terms. "Additional permissions" are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions. When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission. Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms: a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or d) Limiting the use for publicity purposes of names of licensors or authors of the material; or e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or f) Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors. All other non-permissive additional terms are considered "further restrictions" within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying. If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms. Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way. 8. Termination. You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11). However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation. Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice. Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10. 9. Acceptance Not Required for Having Copies. You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so. 10. Automatic Licensing of Downstream Recipients. Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License. An "entity transaction" is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts. You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it. 11. Patents. A "contributor" is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's "contributor version". A contributor's "essential patent claims" are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, "control" includes the right to grant patent sublicenses in a manner consistent with the requirements of this License. Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version. In the following three paragraphs, a "patent license" is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To "grant" such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party. If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent license to downstream recipients. "Knowingly relying" means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid. If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it. A patent license is "discriminatory" if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007. Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law. 12. No Surrender of Others' Freedom. If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program. 13. Use with the GNU Affero General Public License. Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU Affero General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the special requirements of the GNU Affero General Public License, section 13, concerning interaction through a network will apply to the combination as such. 14. Revised Versions of this License. The Free Software Foundation may publish revised and/or new versions of the GNU General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies that a certain numbered version of the GNU General Public License "or any later version" applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU General Public License, you may choose any version ever published by the Free Software Foundation. If the Program specifies that a proxy can decide which future versions of the GNU General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program. Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version. 15. Disclaimer of Warranty. THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. Limitation of Liability. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 17. Interpretation of Sections 15 and 16. If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively state the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . Also add information on how to contact you by electronic and paper mail. If the program does terminal interaction, make it output a short notice like this when it starts in an interactive mode: Copyright (C) This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, your program's commands might be different; for a GUI interface, you would use an "about box". You should also get your employer (if you work as a programmer) or school, if any, to sign a "copyright disclaimer" for the program, if necessary. For more information on this, and how to apply and follow the GNU GPL, see . The GNU General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read . ================================================ FILE: bin/Readme.txt ================================================ Mem Reduct Description: Lightweight real-time memory management application to monitor and clean system memory on your computer. The program used undocumented internal system features (Native API) to clear system cache (system working set, working set, standby page lists, modified page lists) with variable result ~10-50%. Application it is compatible with Windows XP SP3 and higher operating systems, but some general features available only since Windows Vista. System requirements: - Windows 7, 8, 8.1, 10, 11 64-bit/ARM64 - An SSE2-capable CPU To activate portable mode, create "memreduct.ini" in application folder, or move it from "%APPDATA%\Henry++\Mem Reduct". Website: https://github.com/henrypp Support: sforce5@mail.ru (c) 2011-2026 Henry++ ================================================ FILE: build.bat ================================================ @echo off cd ..\builder call build memreduct 3.5.3 "Mem Reduct" pause ================================================ FILE: build_locale.bat ================================================ @echo off cd ..\builder call build_locale memreduct pause ================================================ FILE: build_vc.bat ================================================ @echo off @setlocal enableextensions rem @cd /d "%~dp0\..\" rem VS 2026 if exist "%ProgramFiles%\Microsoft Visual Studio\18\Community\VC\Auxiliary\Build\vcvarsall.bat" ( call "%ProgramFiles%\Microsoft Visual Studio\18\Community\VC\Auxiliary\Build\vcvarsall.bat" amd64_arm64 goto start ) if exist "%ProgramFiles%\Microsoft Visual Studio\18\Professional\VC\Auxiliary\Build\vcvarsall.bat" ( call "%ProgramFiles%\Microsoft Visual Studio\18\Professional\VC\Auxiliary\Build\vcvarsall.bat" amd64_arm64 goto start ) echo VS 2026 was not found... goto end :start msbuild memreduct.sln -property:Configuration=Release -property:Platform=x86 -verbosity:normal if %ERRORLEVEL% neq 0 goto end msbuild memreduct.sln -property:Configuration=Release -property:Platform=x64 -verbosity:normal if %ERRORLEVEL% neq 0 goto end msbuild memreduct.sln -property:Configuration=Release -property:Platform=ARM64 -verbosity:normal if %ERRORLEVEL% neq 0 goto end :end echo done... pause ================================================ FILE: memreduct.sln ================================================  Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 17 VisualStudioVersion = 17.0.31903.59 MinimumVisualStudioVersion = 10.0.40219.1 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "memreduct", "memreduct.vcxproj", "{7FB76828-A353-4113-82D7-CD728EED81DF}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|ARM64 = Debug|ARM64 Debug|x64 = Debug|x64 Debug|x86 = Debug|x86 Release|ARM64 = Release|ARM64 Release|x64 = Release|x64 Release|x86 = Release|x86 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {7FB76828-A353-4113-82D7-CD728EED81DF}.Debug|ARM64.ActiveCfg = Debug|ARM64 {7FB76828-A353-4113-82D7-CD728EED81DF}.Debug|ARM64.Build.0 = Debug|ARM64 {7FB76828-A353-4113-82D7-CD728EED81DF}.Debug|x64.ActiveCfg = Debug|x64 {7FB76828-A353-4113-82D7-CD728EED81DF}.Debug|x64.Build.0 = Debug|x64 {7FB76828-A353-4113-82D7-CD728EED81DF}.Debug|x86.ActiveCfg = Debug|Win32 {7FB76828-A353-4113-82D7-CD728EED81DF}.Debug|x86.Build.0 = Debug|Win32 {7FB76828-A353-4113-82D7-CD728EED81DF}.Release|ARM64.ActiveCfg = Release|ARM64 {7FB76828-A353-4113-82D7-CD728EED81DF}.Release|ARM64.Build.0 = Release|ARM64 {7FB76828-A353-4113-82D7-CD728EED81DF}.Release|x64.ActiveCfg = Release|x64 {7FB76828-A353-4113-82D7-CD728EED81DF}.Release|x64.Build.0 = Release|x64 {7FB76828-A353-4113-82D7-CD728EED81DF}.Release|x86.ActiveCfg = Release|Win32 {7FB76828-A353-4113-82D7-CD728EED81DF}.Release|x86.Build.0 = Release|Win32 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {16BA10E8-DF2A-45BB-B676-2F73AD51107A} EndGlobalSection EndGlobal ================================================ FILE: memreduct.vcxproj ================================================  Debug ARM64 Debug Win32 Release ARM64 Release Win32 Debug x64 Release x64 {7FB76828-A353-4113-82D7-CD728EED81DF} memreduct memreduct Application Unicode v145 Application true Unicode v145 Application true Unicode v145 Application true Unicode v145 Application true Unicode v145 Application true Unicode v145 $(SolutionDir)bin\$(PlatformArchitecture)\ $(VC_IncludePath);$(WindowsSDK_IncludePath);.\..\routine\src\;.\src\include\;.\src\ false $(Platform)\$(Configuration)\$(ProjectName)\ MixedRecommendedRules.ruleset $(SolutionDir)bin\$(PlatformArchitecture)\ $(VC_IncludePath);$(WindowsSDK_IncludePath);.\..\routine\src\;.\src\include\;.\src\ false $(Platform)\$(Configuration)\$(ProjectName)\ MixedRecommendedRules.ruleset $(SolutionDir)bin\$(PlatformArchitecture)\ $(ProjectName) $(VC_IncludePath);$(WindowsSDK_IncludePath);.\..\routine\src\;.\src\include\;.\src\ false $(Platform)\$(Configuration)\$(ProjectName)\ MixedRecommendedRules.ruleset $(ProjectName) $(VC_IncludePath);$(WindowsSDK_IncludePath);.\..\routine\src\;.\src\include\;.\src\ false $(Platform)\$(Configuration)\$(ProjectName)\ MixedRecommendedRules.ruleset $(SolutionDir)bin\$(PlatformArchitecture)\ $(SolutionDir)bin\$(PlatformArchitecture)\ $(ProjectName) $(VC_IncludePath);$(WindowsSDK_IncludePath);.\..\routine\src\;.\src\include\;.\src\ false $(Platform)\$(Configuration)\$(ProjectName)\ MixedRecommendedRules.ruleset $(ProjectName) $(VC_IncludePath);$(WindowsSDK_IncludePath);.\..\routine\src\;.\src\include\;.\src\ false $(Platform)\$(Configuration)\$(ProjectName)\ MixedRecommendedRules.ruleset $(SolutionDir)bin\$(PlatformArchitecture)\ Level3 true StdCall true Guard true MICROSOFT_WINDOWS_WINBASE_H_DEFINE_INTERLOCKED_CPLUSPLUS_OVERLOADS;_UNICODE;UNICODE;WIN32_LEAN_AND_MEAN;APP_HAVE_AUTORUN;APP_HAVE_SKIPUAC;APP_HAVE_TRAY;APP_HAVE_UPDATES;NDEBUG;%(PreprocessorDefinitions) EnableFastChecks true ProgramDatabase true stdcpplatest true true stdclatest StreamingSIMDExtensions2 AnySuitable true true true true true true Windows 6.1 /DEPENDENTLOADFLAG:0x800 /BREPRO %(AdditionalOptions) true Level3 true StdCall true Guard true MICROSOFT_WINDOWS_WINBASE_H_DEFINE_INTERLOCKED_CPLUSPLUS_OVERLOADS;_UNICODE;UNICODE;WIN32_LEAN_AND_MEAN;APP_HAVE_AUTORUN;APP_HAVE_SKIPUAC;APP_HAVE_TRAY;APP_HAVE_UPDATES;NDEBUG;%(PreprocessorDefinitions) EnableFastChecks true ProgramDatabase true stdcpplatest true true stdclatest true StreamingSIMDExtensions2 AnySuitable true true true true true true Windows /DEPENDENTLOADFLAG:0x800 /BREPRO %(AdditionalOptions) 6.1 true _UNICODE;UNICODE;_WIN64;%(PreprocessorDefinitions) Level3 true true Guard true MICROSOFT_WINDOWS_WINBASE_H_DEFINE_INTERLOCKED_CPLUSPLUS_OVERLOADS;_UNICODE;UNICODE;WIN32_LEAN_AND_MEAN;APP_HAVE_AUTORUN;APP_HAVE_SKIPUAC;APP_HAVE_TRAY;APP_HAVE_UPDATES;NDEBUG;%(PreprocessorDefinitions) EnableFastChecks true ProgramDatabase true stdcpplatest true stdclatest true true AnySuitable true true true true true Windows /DEPENDENTLOADFLAG:0x800 /BREPRO %(AdditionalOptions) 10.0 _UNICODE;UNICODE;_WIN64;%(PreprocessorDefinitions) Level3 MaxSpeed true true Guard true StdCall ProgramDatabase MICROSOFT_WINDOWS_WINBASE_H_DEFINE_INTERLOCKED_CPLUSPLUS_OVERLOADS;_UNICODE;UNICODE;WIN32_LEAN_AND_MEAN;APP_HAVE_AUTORUN;APP_HAVE_SKIPUAC;APP_HAVE_TRAY;APP_HAVE_UPDATES;NDEBUG;%(PreprocessorDefinitions) true true stdcpplatest true true stdclatest StreamingSIMDExtensions2 MultiThreaded AnySuitable true true true true true true true Windows 6.1 /DEPENDENTLOADFLAG:0x800 /BREPRO %(AdditionalOptions) true UseLinkTimeCodeGeneration Level3 MaxSpeed true true Guard true StdCall ProgramDatabase MICROSOFT_WINDOWS_WINBASE_H_DEFINE_INTERLOCKED_CPLUSPLUS_OVERLOADS;_UNICODE;UNICODE;WIN32_LEAN_AND_MEAN;APP_HAVE_AUTORUN;APP_HAVE_SKIPUAC;APP_HAVE_TRAY;APP_HAVE_UPDATES;NDEBUG;%(PreprocessorDefinitions) true true stdcpplatest true true stdclatest true MultiThreaded StreamingSIMDExtensions2 AnySuitable true true true true true true true Windows /DEPENDENTLOADFLAG:0x800 /BREPRO %(AdditionalOptions) 6.1 true UseLinkTimeCodeGeneration _UNICODE;UNICODE;_WIN64;%(PreprocessorDefinitions) Level3 MaxSpeed true true Guard true ProgramDatabase MICROSOFT_WINDOWS_WINBASE_H_DEFINE_INTERLOCKED_CPLUSPLUS_OVERLOADS;_UNICODE;UNICODE;WIN32_LEAN_AND_MEAN;APP_HAVE_AUTORUN;APP_HAVE_SKIPUAC;APP_HAVE_TRAY;APP_HAVE_UPDATES;NDEBUG;%(PreprocessorDefinitions) true true stdcpplatest true stdclatest true true MultiThreaded AnySuitable true true true true true true Windows /DEPENDENTLOADFLAG:0x800 /BREPRO %(AdditionalOptions) UseLinkTimeCodeGeneration 10.0 _UNICODE;UNICODE;_WIN64;%(PreprocessorDefinitions) ================================================ FILE: memreduct.vcxproj.filters ================================================  {B43C75CA-B7CD-42CD-AECE-B5C726B07DCB} h;hh;hpp;hxx;hm;inl;inc;xsd {25752297-5400-478B-818B-6DCD36C71575} rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms {8CAE5BF2-376B-44EB-A3D5-0CF790228D11} cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx Source Files Source Files Source Files Header Files Header Files Header Files Header Files Header Files Header Files Header Files Header Files Header Files Resource Files ================================================ FILE: memreduct.vcxproj.user ================================================  ================================================ FILE: src/app.h ================================================ // Mem Reduct // Copyright (c) 2011-2026 Henry++ #pragma once #define APP_NAME L"Mem Reduct" #define APP_NAME_SHORT L"memreduct" #define APP_VERSION L"3.5.3" #define APP_VERSION_RES 3,5,3,0 #define APP_AUTHOR L"Henry++" #define APP_COPYRIGHT L"(c) 2011-2026 " APP_AUTHOR L". All Rights Reversed." ================================================ FILE: src/main.c ================================================ // Mem Reduct // Copyright (c) 2011-2025 Henry++ #include "routine.h" #include "main.h" #include "rapp.h" #include "resource.h" STATIC_DATA config = {0}; ULONG limits_arr[13] = {0}; ULONG intervals_arr[13] = {0}; INT WINAPIV compare_numbers ( _In_opt_ PVOID context, _In_ LPCVOID ptr1, _In_ LPCVOID ptr2 ) { ULONG val1; ULONG val2; val1 = PtrToUlong (ptr1); val2 = PtrToUlong (ptr2); if (val1 < val2) return -1; if (val1 > val2) return 1; return 0; } VOID _app_generate_array ( _Out_ _Writable_elements_ (count) PULONG integers, _In_ ULONG_PTR count, _In_ ULONG value ) { PR_HASHTABLE hashtable; ULONG_PTR enum_key = 0; ULONG hash_code; ULONG index = 0; RtlSecureZeroMemory (integers, sizeof (ULONG) * count); hashtable = _r_obj_createhashtable (sizeof (BOOLEAN), 16, NULL); for (index = 1; index < 9; index++) { _r_obj_addhashtableitem (hashtable, index * 10, NULL); } for (index = value - 2; index <= (value + 2); index++) { if (index >= 5) _r_obj_addhashtableitem (hashtable, index, NULL); } while (_r_obj_enumhashtable (hashtable, NULL, &hash_code, &enum_key)) { if (hash_code <= 99) *(PULONG_PTR)PTR_ADD_OFFSET (integers, index * sizeof (ULONG)) = hash_code; if (++index >= count) break; } qsort_s (integers, count, sizeof (ULONG), &compare_numbers, NULL); _r_obj_dereference (hashtable); } VOID _app_generate_menu ( _In_ HMENU hsubmenu, _In_ ULONG menu_idx, _Out_ _Writable_elements_ (count) PULONG integers, _In_ ULONG_PTR count, _In_ LPCWSTR format, _In_ ULONG value, _In_ BOOLEAN is_enabled ) { WCHAR buffer[64]; LONG64 menu_value; ULONG menu_items = 0; ULONG menu_id; BOOLEAN is_checked = FALSE; _r_menu_setitemtext (hsubmenu, 0, TRUE, _r_locale_getstring (IDS_TRAY_DISABLE)); _app_generate_array (integers, count, value); for (ULONG i = 0; i < count; i++) { menu_value = integers[i]; if (!menu_value) continue; menu_id = (menu_idx + i); _r_str_printf (buffer, RTL_NUMBER_OF (buffer), format, menu_value); _r_menu_additem (hsubmenu, menu_id, buffer); if (!_r_sys_iselevated ()) _r_menu_enableitem (hsubmenu, menu_id, FALSE, FALSE); if (value == menu_value) { _r_menu_checkitem (hsubmenu, menu_id, menu_id, MF_BYCOMMAND, menu_id); is_checked = TRUE; } menu_items += 1; } if (!is_enabled || !is_checked) _r_menu_checkitem (hsubmenu, 0, menu_items + 2, MF_BYPOSITION, 0); } ULONG _app_getlimitvalue () { ULONG value; value = _r_config_getulong (L"AutoreductValue", DEFAULT_AUTOREDUCT_VAL, NULL); return _r_calc_clamp (value, 1, 99); } ULONG _app_getintervalvalue () { ULONG value; value = _r_config_getulong (L"AutoreductIntervalValue", DEFAULT_AUTOREDUCTINTERVAL_VAL, NULL); return _r_calc_clamp (value, 1, 1440); } ULONG _app_getdangervalue () { ULONG value; value = _r_config_getulong (L"TrayLevelDanger", DEFAULT_DANGER_LEVEL, NULL); return _r_calc_clamp (value, 1, 99); } ULONG _app_getwarningvalue () { ULONG value; value = _r_config_getulong (L"TrayLevelWarning", DEFAULT_WARNING_LEVEL, NULL); return _r_calc_clamp (value, 1, 99); } ULONG64 _app_getmemoryinfo ( _Out_ PR_MEMORY_INFO mem_info ) { _r_sys_getmemoryinfo (mem_info); return mem_info->physical_memory.used_bytes; } FORCEINLINE LPCWSTR _app_getcleanupreason ( _In_ CLEANUP_SOURCE_ENUM src ) { switch (src) { case SOURCE_AUTO: { return L"Cleanup (Auto)"; } case SOURCE_MANUAL: { return L"Cleanup (Manual)"; } case SOURCE_HOTKEY: { return L"Cleanup (Hotkey)"; } case SOURCE_CMDLINE: { return L"Cleanup (Command-line)"; } default: { return L"Unknown"; } } } NTSTATUS _app_flushvolumecache () { PMOUNTMGR_MOUNT_POINTS object_mountpoints; PMOUNTMGR_MOUNT_POINT mountpoint; OBJECT_ATTRIBUTES oa = {0}; IO_STATUS_BLOCK isb; UNICODE_STRING us; HANDLE hdevice; HANDLE hvolume; NTSTATUS status; RtlInitUnicodeString (&us, MOUNTMGR_DEVICE_NAME); InitializeObjectAttributes (&oa, &us, OBJ_CASE_INSENSITIVE, NULL, NULL); status = NtCreateFile ( &hdevice, FILE_READ_ATTRIBUTES | SYNCHRONIZE, &oa, &isb, NULL, FILE_ATTRIBUTE_NORMAL, FILE_SHARE_READ | FILE_SHARE_WRITE, FILE_OPEN, FILE_NON_DIRECTORY_FILE | FILE_SYNCHRONOUS_IO_NONALERT, NULL, 0 ); if (!NT_SUCCESS (status)) return status; status = _r_fs_getvolumemountpoints (hdevice, &object_mountpoints); if (!NT_SUCCESS (status)) goto CleanupExit; for (ULONG i = 0; i < object_mountpoints->NumberOfMountPoints; i++) { mountpoint = &object_mountpoints->MountPoints[i]; us.Length = mountpoint->SymbolicLinkNameLength; us.MaximumLength = mountpoint->SymbolicLinkNameLength + sizeof (UNICODE_NULL); us.Buffer = PTR_ADD_OFFSET (object_mountpoints, mountpoint->SymbolicLinkNameOffset); if (MOUNTMGR_IS_VOLUME_NAME (&us)) // \\??\\Volume{1111-2222} { InitializeObjectAttributes (&oa, &us, OBJ_CASE_INSENSITIVE, NULL, NULL); status = NtCreateFile ( &hvolume, FILE_WRITE_DATA | SYNCHRONIZE, &oa, &isb, NULL, FILE_ATTRIBUTE_NORMAL, FILE_SHARE_READ | FILE_SHARE_WRITE, FILE_OPEN, FILE_NON_DIRECTORY_FILE | FILE_SYNCHRONOUS_IO_NONALERT, NULL, 0 ); if (NT_SUCCESS (status)) { status = _r_fs_flushfile (hvolume); NtClose (hvolume); } } } _r_mem_free (object_mountpoints); CleanupExit: NtClose (hdevice); return status; } VOID _app_memoryclean ( _In_opt_ HWND hwnd, _In_ CLEANUP_SOURCE_ENUM src, _In_opt_ ULONG mask ) { MEMORY_COMBINE_INFORMATION_EX combine_info_ex = {0}; SYSTEM_FILECACHE_INFORMATION sfci = {0}; SYSTEM_MEMORY_LIST_COMMAND command; R_MEMORY_INFO mem_info; WCHAR buffer1[256] = {0}; WCHAR buffer2[256] = {0}; LPCWSTR error_text; ULONG64 reduct_before; ULONG64 reduct_after; ULONG flags = NIIF_WARNING; NTSTATUS status; if (!_r_config_getboolean (L"IsNotificationsSound", TRUE, NULL)) flags |= NIIF_NOSOUND; if (!_r_sys_iselevated ()) { error_text = _r_locale_getstring (IDS_STATUS_NOPRIVILEGES); if (_r_app_runasadmin ()) { if (hwnd) DestroyWindow (hwnd); } else { if (src == SOURCE_CMDLINE) { if (hwnd) _r_show_message (hwnd, MB_OK | MB_ICONSTOP, NULL, error_text); } else { if (hwnd) _r_tray_popup (hwnd, &GUID_TrayIcon, flags, _r_app_getname (), error_text); } } return; } if (!mask) mask = _r_config_getulong (L"ReductMask2", REDUCT_MASK_DEFAULT, NULL); if (src == SOURCE_AUTO) { if (!_r_config_getboolean (L"IsAllowStandbyListCleanup", FALSE, NULL)) mask &= ~REDUCT_MASK_FREEZES; // exclude freezes from autoclean feature ;) } else if (src == SOURCE_MANUAL) { if ((mask & REDUCT_WORKING_SET) == REDUCT_WORKING_SET) _r_str_append (buffer1, RTL_NUMBER_OF (buffer1), L"- " TITLE_WORKINGSET L"\r\n"); if ((mask & REDUCT_SYSTEM_FILE_CACHE) == REDUCT_SYSTEM_FILE_CACHE) _r_str_append (buffer1, RTL_NUMBER_OF (buffer1), L"- " TITLE_SYSTEMFILECACHE L"\r\n"); if ((mask & REDUCT_MODIFIED_FILE_CACHE) == REDUCT_MODIFIED_FILE_CACHE) _r_str_append (buffer1, RTL_NUMBER_OF (buffer1), L"- " TITLE_MODIFIEDFILECACHE L"\r\n"); if ((mask & REDUCT_MODIFIED_LIST) == REDUCT_MODIFIED_LIST) _r_str_append (buffer1, RTL_NUMBER_OF (buffer1), L"- " TITLE_MODIFIEDLIST L"\r\n"); if ((mask & REDUCT_STANDBY_LIST) == REDUCT_STANDBY_LIST) _r_str_append (buffer1, RTL_NUMBER_OF (buffer1), L"- " TITLE_STANDBYLIST L"\r\n"); if ((mask & REDUCT_STANDBY_PRIORITY0_LIST) == REDUCT_STANDBY_PRIORITY0_LIST) _r_str_append (buffer1, RTL_NUMBER_OF (buffer1), L"- " TITLE_STANDBYLISTPRIORITY0 L"\r\n"); if ((mask & REDUCT_REGISTRY_CACHE) == REDUCT_REGISTRY_CACHE) _r_str_append (buffer1, RTL_NUMBER_OF (buffer1), L"- " TITLE_REGISTRYCACHE L"\r\n"); if ((mask & REDUCT_COMBINE_MEMORY_LISTS) == REDUCT_COMBINE_MEMORY_LISTS) _r_str_append (buffer1, RTL_NUMBER_OF (buffer1), L"- " TITLE_COMBINEMEMORYLISTS L"\r\n"); StrTrimW (buffer1, L"\r\n"); if (!_r_show_confirmmessage (hwnd, _r_locale_getstring (IDS_QUESTION), buffer1, L"IsShowReductConfirmation", FALSE)) return; } SetCursor (LoadCursorW (NULL, IDC_WAIT)); // difference (before) reduct_before = _app_getmemoryinfo (&mem_info); // Working set (vista+) if ((mask & REDUCT_WORKING_SET) == REDUCT_WORKING_SET) { command = MemoryEmptyWorkingSets; status = NtSetSystemInformation (SystemMemoryListInformation, &command, sizeof (SYSTEM_MEMORY_LIST_COMMAND)); if (!NT_SUCCESS (status)) _r_log (LOG_LEVEL_ERROR, NULL, L"NtSetSystemInformation", status, L"MemoryEmptyWorkingSets"); } // System file cache if ((mask & REDUCT_SYSTEM_FILE_CACHE) == REDUCT_SYSTEM_FILE_CACHE) { sfci.MinimumWorkingSet = MAXSIZE_T; sfci.MaximumWorkingSet = MAXSIZE_T; status = NtSetSystemInformation (SystemFileCacheInformationEx, &sfci, sizeof (SYSTEM_FILECACHE_INFORMATION)); if (!NT_SUCCESS (status)) _r_log (LOG_LEVEL_ERROR, NULL, L"NtSetSystemInformation", status, L"SystemFileCacheInformation"); } // Flush volume cache if ((mask & REDUCT_MODIFIED_FILE_CACHE) == REDUCT_MODIFIED_FILE_CACHE) _app_flushvolumecache (); // Modified page list (vista+) if ((mask & REDUCT_MODIFIED_LIST) == REDUCT_MODIFIED_LIST) { command = MemoryFlushModifiedList; status = NtSetSystemInformation (SystemMemoryListInformation, &command, sizeof (SYSTEM_MEMORY_LIST_COMMAND)); if (!NT_SUCCESS (status)) _r_log (LOG_LEVEL_ERROR, NULL, L"NtSetSystemInformation", status, L"MemoryFlushModifiedList"); } // Standby list (vista+) if ((mask & REDUCT_STANDBY_LIST) == REDUCT_STANDBY_LIST) { command = MemoryPurgeStandbyList; status = NtSetSystemInformation (SystemMemoryListInformation, &command, sizeof (SYSTEM_MEMORY_LIST_COMMAND)); if (!NT_SUCCESS (status)) _r_log (LOG_LEVEL_ERROR, NULL, L"NtSetSystemInformation", status, L"MemoryPurgeStandbyList"); } // Standby priority-0 list (vista+) if ((mask & REDUCT_STANDBY_PRIORITY0_LIST) == REDUCT_STANDBY_PRIORITY0_LIST) { command = MemoryPurgeLowPriorityStandbyList; status = NtSetSystemInformation (SystemMemoryListInformation, &command, sizeof (SYSTEM_MEMORY_LIST_COMMAND)); if (!NT_SUCCESS (status)) _r_log (LOG_LEVEL_ERROR, NULL, L"NtSetSystemInformation", status, L"MemoryPurgeLowPriorityStandbyList"); } // Flush registry cache (win8.1+) if (_r_sys_isosversiongreaterorequal (WINDOWS_8_1)) { if ((mask & REDUCT_REGISTRY_CACHE) == REDUCT_REGISTRY_CACHE) { status = NtSetSystemInformation (SystemRegistryReconciliationInformation, NULL, 0); if (!NT_SUCCESS (status)) _r_log (LOG_LEVEL_ERROR, NULL, L"NtSetSystemInformation", status, L"SystemRegistryReconciliationInformation"); } } // Combine memory lists (win10+) if (_r_sys_isosversiongreaterorequal (WINDOWS_10)) { if ((mask & REDUCT_COMBINE_MEMORY_LISTS) == REDUCT_COMBINE_MEMORY_LISTS) { status = NtSetSystemInformation (SystemCombinePhysicalMemoryInformation, &combine_info_ex, sizeof (MEMORY_COMBINE_INFORMATION_EX)); if (!NT_SUCCESS (status)) _r_log (LOG_LEVEL_ERROR, NULL, L"NtSetSystemInformation", status, L"SystemCombinePhysicalMemoryInformation"); } } SetCursor (LoadCursorW (NULL, IDC_ARROW)); // difference (after) reduct_after = _app_getmemoryinfo (&mem_info); if (reduct_after < reduct_before) { reduct_after = (reduct_before - reduct_after); } else { reduct_after = 0; } // time of last cleaning _r_config_setlong64 (L"StatisticLastReduct", _r_unixtime_now (), NULL); _r_format_bytesize64 (buffer1, RTL_NUMBER_OF (buffer1), reduct_after); _r_str_printf (buffer2, RTL_NUMBER_OF (buffer2), _r_locale_getstring (IDS_STATUS_CLEANED), buffer1); if (src == SOURCE_CMDLINE) { if (_r_config_getboolean (L"BalloonCleanResults", TRUE, NULL)) { if (!_r_tray_popup (hwnd, &GUID_TrayIcon, flags, _r_app_getname (), buffer2)) _r_show_message (hwnd, MB_OK | MB_ICONINFORMATION, NULL, buffer2); } else { _r_show_message (hwnd, MB_OK | MB_ICONINFORMATION, NULL, buffer2); } } else { if (hwnd && _r_config_getboolean (L"BalloonCleanResults", TRUE, NULL)) _r_tray_popup (hwnd, &GUID_TrayIcon, flags, _r_app_getname (), buffer2); } if (_r_config_getboolean (L"LogCleanResults", FALSE, NULL)) _r_log_v (LOG_LEVEL_INFO, 0, _app_getcleanupreason (src), 0, buffer1); } VOID _app_fontinit ( _Out_ PLOGFONT logfont, _In_ LONG dpi_value ) { RtlZeroMemory (logfont, sizeof (LOGFONT)); _r_str_copy (logfont->lfFaceName, LF_FACESIZE, L"Lucida Console"); logfont->lfHeight = _r_dc_fontsizetoheight (8, dpi_value); logfont->lfWeight = FW_NORMAL; _r_config_getfont (L"TrayFont", logfont, dpi_value, NULL); logfont->lfCharSet = DEFAULT_CHARSET; logfont->lfQuality = CLEARTYPE_QUALITY; } VOID _app_drawbackground ( _In_ HDC hdc, _In_ COLORREF bg_clr, _In_ COLORREF pen_clr, _In_ COLORREF brush_clr, _In_ LPCRECT rect, _In_ BOOLEAN is_round ) { HGDIOBJ prev_brush; HGDIOBJ prev_pen; COLORREF prev_clr; prev_brush = SelectObject (hdc, GetStockObject (DC_BRUSH)); prev_pen = SelectObject (hdc, GetStockObject (DC_PEN)); prev_clr = SetBkColor (hdc, bg_clr); SetDCPenColor (hdc, pen_clr); SetDCBrushColor (hdc, brush_clr); _r_dc_fillrect (hdc, rect, bg_clr); if (is_round) { RoundRect (hdc, rect->left, rect->top, rect->right, rect->bottom, rect->right - 2, rect->right / 2); } else { Rectangle (hdc, rect->left, rect->top, rect->right, rect->bottom); } SelectObject (hdc, prev_brush); SelectObject (hdc, prev_pen); SetBkColor (hdc, prev_clr); } HICON _app_iconcreate ( _In_opt_ ULONG percent ) { static HICON hicon = NULL; R_MEMORY_INFO mem_info; R_STRINGREF sr; ICONINFO ii = {0}; WCHAR icon_text[8]; HGDIOBJ prev_font; HGDIOBJ prev_bmp; HICON hicon_new; COLORREF text_color; COLORREF bg_color; LONG prev_mode; BOOLEAN is_transparent; BOOLEAN is_border; BOOLEAN is_round; BOOLEAN has_warning; BOOLEAN has_danger; text_color = _r_config_getulong (L"TrayColorText", TRAY_COLOR_TEXT, NULL); bg_color = _r_config_getulong (L"TrayColorBg", TRAY_COLOR_BG, NULL); is_transparent = _r_config_getboolean (L"TrayUseTransparency", FALSE, NULL); is_border = _r_config_getboolean (L"TrayShowBorder", FALSE, NULL); is_round = _r_config_getboolean (L"TrayRoundCorners", FALSE, NULL); if (!percent) { _app_getmemoryinfo (&mem_info); percent = mem_info.physical_memory.percent; } has_danger = percent >= _app_getdangervalue (); has_warning = !has_danger && percent >= _app_getwarningvalue (); if (has_danger || has_warning) { if (_r_config_getboolean (L"TrayChangeBg", TRUE, NULL)) { if (has_danger) { bg_color = _r_config_getulong (L"TrayColorDanger", TRAY_COLOR_DANGER, NULL); } else { bg_color = _r_config_getulong (L"TrayColorWarning", TRAY_COLOR_WARNING, NULL); } is_transparent = FALSE; } else { if (has_danger) { text_color = _r_config_getulong (L"TrayColorDanger", TRAY_COLOR_DANGER, NULL); } else { text_color = _r_config_getulong (L"TrayColorWarning", TRAY_COLOR_WARNING, NULL); } } } // set tray text _r_str_fromulong (icon_text, RTL_NUMBER_OF (icon_text), percent); _r_obj_initializestringref (&sr, icon_text); // draw main device context prev_bmp = SelectObject (config.hdc, config.hbitmap); prev_font = SelectObject (config.hdc, config.hfont); prev_mode = SetBkMode (config.hdc, TRANSPARENT); _app_drawbackground (config.hdc, bg_color, is_border ? text_color : bg_color, is_transparent ? text_color : bg_color, &config.icon_size, is_round); _r_dc_drawtext (NULL, config.hdc, &sr, &config.icon_size, 0, 0, DT_VCENTER | DT_CENTER | DT_SINGLELINE | DT_NOCLIP | DT_NOPREFIX, text_color); SetBkMode (config.hdc, prev_mode); SelectObject (config.hdc, prev_font); SelectObject (config.hdc, prev_bmp); // draw mask device context prev_bmp = SelectObject (config.hdc_mask, config.hbitmap_mask); prev_font = SelectObject (config.hdc_mask, config.hfont); prev_mode = SetBkMode (config.hdc_mask, TRANSPARENT); _app_drawbackground ( config.hdc_mask, TRAY_COLOR_WHITE, is_border ? TRAY_COLOR_BLACK : TRAY_COLOR_WHITE, is_transparent ? TRAY_COLOR_WHITE : TRAY_COLOR_BLACK, &config.icon_size, is_round ); _r_dc_drawtext (NULL, config.hdc_mask, &sr, &config.icon_size, 0, 0, DT_VCENTER | DT_CENTER | DT_SINGLELINE | DT_NOCLIP | DT_NOPREFIX, TRAY_COLOR_BLACK); SetBkMode (config.hdc, prev_mode); SelectObject (config.hdc_mask, prev_bmp); SelectObject (config.hdc_mask, prev_font); // create icon ii.fIcon = TRUE; ii.hbmColor = config.hbitmap; ii.hbmMask = config.hbitmap_mask; hicon_new = CreateIconIndirect (&ii); if (hicon) DestroyIcon (hicon); hicon = hicon_new; return hicon; } VOID CALLBACK _app_timercallback ( _In_ HWND hwnd, _In_ UINT msg, _In_ UINT_PTR id_event, _In_ ULONG time ) { R_MEMORY_INFO mem_info; WCHAR buffer[128]; HICON hicon = NULL; LONG64 timestamp; ULONG percent; BOOLEAN is_clean = FALSE; if (id_event != UID) return; _app_getmemoryinfo (&mem_info); // autocleanup functional if (_r_sys_iselevated ()) { if (_r_config_getboolean (L"AutoreductEnable", FALSE, NULL)) { if (mem_info.physical_memory.percent >= _app_getlimitvalue ()) is_clean = TRUE; } if (!is_clean && _r_config_getboolean (L"AutoreductIntervalEnable", FALSE, NULL)) { timestamp = _r_unixtime_now () - _r_config_getlong64 (L"StatisticLastReduct", 0, NULL); if (timestamp >= (_app_getintervalvalue () * 60)) is_clean = TRUE; } if (is_clean) _app_memoryclean (hwnd, SOURCE_AUTO, 0); } // check previous percent to prevent icon redraw if (!config.ms_prev || config.ms_prev != mem_info.physical_memory.percent) { config.ms_prev = mem_info.physical_memory.percent; // store last percentage value (required!) hicon = _app_iconcreate (config.ms_prev); } _r_tray_setinfoformat ( hwnd, &GUID_TrayIcon, hicon, L"%s: %" TEXT (PR_DOUBLE) L"%%\r\n%s: %" TEXT (PR_DOUBLE) L"%%\r\n%s: %" TEXT (PR_DOUBLE) L"%%", _r_locale_getstring (IDS_GROUP_1), mem_info.physical_memory.percent_f, _r_locale_getstring (IDS_GROUP_2), mem_info.page_file.percent_f, _r_locale_getstring (IDS_GROUP_3), mem_info.system_cache.percent_f ); if (!_r_wnd_isvisible (hwnd, FALSE)) return; // set item lparam information for (INT i = 0; i < _r_listview_getitemcount (hwnd, IDC_LISTVIEW); i++) { if (i < 3) { percent = mem_info.physical_memory.percent; } else if (i < 6) { percent = mem_info.page_file.percent; } else if (i < 9) { percent = mem_info.system_cache.percent; } _r_listview_setitem (hwnd, IDC_LISTVIEW, i, 0, NULL, I_DEFAULT, I_DEFAULT, (LPARAM)percent); } // physical memory _r_str_printf (buffer, RTL_NUMBER_OF (buffer), L"%" TEXT (PR_DOUBLE) L"%%", mem_info.physical_memory.percent_f); _r_listview_setitem (hwnd, IDC_LISTVIEW, 0, 1, buffer, I_DEFAULT, I_DEFAULT, I_DEFAULT); _r_format_bytesize64 (buffer, RTL_NUMBER_OF (buffer), mem_info.physical_memory.free_bytes); _r_listview_setitem (hwnd, IDC_LISTVIEW, 1, 1, buffer, I_DEFAULT, I_DEFAULT, I_DEFAULT); _r_format_bytesize64 (buffer, RTL_NUMBER_OF (buffer), mem_info.physical_memory.total_bytes); _r_listview_setitem (hwnd, IDC_LISTVIEW, 2, 1, buffer, I_DEFAULT, I_DEFAULT, I_DEFAULT); // virtual memory _r_str_printf (buffer, RTL_NUMBER_OF (buffer), L"%" TEXT (PR_DOUBLE) L"%%", mem_info.page_file.percent_f); _r_listview_setitem (hwnd, IDC_LISTVIEW, 3, 1, buffer, I_DEFAULT, I_DEFAULT, I_DEFAULT); _r_format_bytesize64 (buffer, RTL_NUMBER_OF (buffer), mem_info.page_file.free_bytes); _r_listview_setitem (hwnd, IDC_LISTVIEW, 4, 1, buffer, I_DEFAULT, I_DEFAULT, I_DEFAULT); _r_format_bytesize64 (buffer, RTL_NUMBER_OF (buffer), mem_info.page_file.total_bytes); _r_listview_setitem (hwnd, IDC_LISTVIEW, 5, 1, buffer, I_DEFAULT, I_DEFAULT, I_DEFAULT); // system cache _r_str_printf (buffer, RTL_NUMBER_OF (buffer), L"%" TEXT (PR_DOUBLE) L"%%", mem_info.system_cache.percent_f); _r_listview_setitem (hwnd, IDC_LISTVIEW, 6, 1, buffer, I_DEFAULT, I_DEFAULT, I_DEFAULT); _r_format_bytesize64 (buffer, RTL_NUMBER_OF (buffer), mem_info.system_cache.free_bytes); _r_listview_setitem (hwnd, IDC_LISTVIEW, 7, 1, buffer, I_DEFAULT, I_DEFAULT, I_DEFAULT); _r_format_bytesize64 (buffer, RTL_NUMBER_OF (buffer), mem_info.system_cache.total_bytes); _r_listview_setitem (hwnd, IDC_LISTVIEW, 8, 1, buffer, I_DEFAULT, I_DEFAULT, I_DEFAULT); if (_r_wnd_isvisible (hwnd, FALSE)) _r_listview_redraw (hwnd, IDC_LISTVIEW); } VOID _app_iconredraw ( _In_opt_ HWND hwnd ) { config.ms_prev = 0; if (hwnd) _app_timercallback (hwnd, 0, UID, 0); } VOID _app_iconinit ( _In_ LONG dpi_value ) { LOGFONT logfont; PVOID bits; HDC hdc; SAFE_DELETE_OBJECT (config.hbitmap_mask); SAFE_DELETE_OBJECT (config.hbitmap); SAFE_DELETE_OBJECT (config.hfont); SAFE_DELETE_DC (config.hdc_mask); SAFE_DELETE_DC (config.hdc); // init font _app_fontinit (&logfont, dpi_value); config.hfont = CreateFontIndirectW (&logfont); // init rect SetRect (&config.icon_size, 0, 0, _r_dc_getsystemmetrics (SM_CXSMICON, dpi_value), _r_dc_getsystemmetrics (SM_CYSMICON, dpi_value)); // init dc hdc = GetDC (NULL); if (!hdc) return; config.hdc = CreateCompatibleDC (hdc); config.hdc_mask = CreateCompatibleDC (hdc); // init bitmap config.hbitmap = _r_dc_createbitmap (hdc, config.icon_size.right, config.icon_size.bottom, &bits); config.hbitmap_mask = CreateBitmap (config.icon_size.right, config.icon_size.bottom, 1, 1, NULL); ReleaseDC (NULL, hdc); } VOID _app_hotkeyinit ( _In_ HWND hwnd ) { LONG hk; UnregisterHotKey (hwnd, UID); if (!_r_config_getboolean (L"HotkeyCleanEnable", FALSE, NULL)) return; hk = _r_config_getlong (L"HotkeyClean", MAKEWORD (VK_F1, HOTKEYF_CONTROL), NULL); if (!hk) return; if (!RegisterHotKey (hwnd, UID, (HIBYTE (hk) & 2) | ((HIBYTE (hk) & 4) >> 2) | ((HIBYTE (hk) & 1) << 2), LOBYTE (hk))) _r_show_errormessage (hwnd, NULL, NtLastError (), NULL, ET_WINDOWS); } VOID _app_setfontcontrol ( _In_ HWND hwnd, _In_ INT ctrl_id, _In_ PLOGFONT logfont, _In_ LONG dpi_value ) { _r_ctrl_setstringformat ( hwnd, IDC_FONT, L"%s, %" TEXT (PR_LONG) L"px, %" TEXT (PR_LONG), logfont->lfFaceName, _r_dc_fontheighttosize (logfont->lfHeight, dpi_value), logfont->lfWeight ); } INT_PTR CALLBACK SettingsProc ( _In_ HWND hwnd, _In_ UINT msg, _In_ WPARAM wparam, _In_ LPARAM lparam ) { switch (msg) { case RM_INITIALIZE: { INT dialog_id; dialog_id = (INT)wparam; switch (dialog_id) { case IDD_SETTINGS_GENERAL: { _r_ctrl_checkbutton (hwnd, IDC_ALWAYSONTOP_CHK, _r_config_getboolean (L"AlwaysOnTop", FALSE, NULL)); _r_ctrl_checkbutton (hwnd, IDC_LOADONSTARTUP_CHK, _r_autorun_isenabled ()); _r_ctrl_checkbutton (hwnd, IDC_STARTMINIMIZED_CHK, _r_config_getboolean (L"IsStartMinimized", FALSE, NULL)); _r_ctrl_checkbutton (hwnd, IDC_REDUCTCONFIRMATION_CHK, _r_config_getboolean (L"IsShowReductConfirmation", TRUE, NULL)); if (!_r_sys_iselevated ()) _r_ctrl_enable (hwnd, IDC_SKIPUACWARNING_CHK, FALSE); _r_ctrl_checkbutton (hwnd, IDC_SKIPUACWARNING_CHK, _r_skipuac_isenabled ()); _r_ctrl_checkbutton (hwnd, IDC_CHECKUPDATES_CHK, _r_update_isenabled (FALSE)); _r_locale_enum (hwnd, IDC_LANGUAGE, 0); break; } case IDD_SETTINGS_MEMORY: { ULONG mask; _r_listview_setstyle (hwnd, IDC_REGIONS, LVS_EX_CHECKBOXES | LVS_EX_DOUBLEBUFFER | LVS_EX_FULLROWSELECT | LVS_EX_INFOTIP | LVS_EX_LABELTIP, FALSE); _r_wnd_setcontext (hwnd, IDC_REGIONS, INVALID_HANDLE_VALUE); // fix by @XakerTwo _r_listview_deleteallcolumns (hwnd, IDC_REGIONS); _r_listview_deleteallitems (hwnd, IDC_REGIONS); _r_listview_addcolumn (hwnd, IDC_REGIONS, 0, NULL, 10, LVCFMT_LEFT); _r_listview_additem (hwnd, IDC_REGIONS, 0, TITLE_WORKINGSET, I_DEFAULT, I_DEFAULT, REDUCT_WORKING_SET); _r_listview_additem (hwnd, IDC_REGIONS, 1, TITLE_SYSTEMFILECACHE, I_DEFAULT, I_DEFAULT, REDUCT_SYSTEM_FILE_CACHE); _r_listview_additem (hwnd, IDC_REGIONS, 2, TITLE_MODIFIEDLIST, I_DEFAULT, I_DEFAULT, REDUCT_MODIFIED_LIST); _r_listview_additem (hwnd, IDC_REGIONS, 3, TITLE_STANDBYLIST, I_DEFAULT, I_DEFAULT, REDUCT_STANDBY_LIST); _r_listview_additem (hwnd, IDC_REGIONS, 4, TITLE_STANDBYLISTPRIORITY0, I_DEFAULT, I_DEFAULT, REDUCT_STANDBY_PRIORITY0_LIST); _r_listview_additem (hwnd, IDC_REGIONS, 5, TITLE_MODIFIEDFILECACHE, I_DEFAULT, I_DEFAULT, REDUCT_MODIFIED_FILE_CACHE); _r_listview_additem (hwnd, IDC_REGIONS, 6, TITLE_REGISTRYCACHE, I_DEFAULT, I_DEFAULT, REDUCT_REGISTRY_CACHE); _r_listview_additem (hwnd, IDC_REGIONS, 7, TITLE_COMBINEMEMORYLISTS, I_DEFAULT, I_DEFAULT, REDUCT_COMBINE_MEMORY_LISTS); _r_listview_setcolumn (hwnd, IDC_REGIONS, 0, NULL, -100); mask = _r_config_getulong (L"ReductMask2", REDUCT_MASK_DEFAULT, NULL); _r_listview_setitemcheck (hwnd, IDC_REGIONS, 0, (mask & REDUCT_WORKING_SET) == REDUCT_WORKING_SET); _r_listview_setitemcheck (hwnd, IDC_REGIONS, 1, (mask & REDUCT_SYSTEM_FILE_CACHE) == REDUCT_SYSTEM_FILE_CACHE); _r_listview_setitemcheck (hwnd, IDC_REGIONS, 2, (mask & REDUCT_MODIFIED_LIST) == REDUCT_MODIFIED_LIST); _r_listview_setitemcheck (hwnd, IDC_REGIONS, 3, (mask & REDUCT_STANDBY_LIST) == REDUCT_STANDBY_LIST); _r_listview_setitemcheck (hwnd, IDC_REGIONS, 4, (mask & REDUCT_STANDBY_PRIORITY0_LIST) == REDUCT_STANDBY_PRIORITY0_LIST); _r_listview_setitemcheck (hwnd, IDC_REGIONS, 5, (mask & REDUCT_MODIFIED_FILE_CACHE) == REDUCT_MODIFIED_FILE_CACHE); _r_listview_setitemcheck (hwnd, IDC_REGIONS, 6, (mask & REDUCT_REGISTRY_CACHE) == REDUCT_REGISTRY_CACHE); _r_listview_setitemcheck (hwnd, IDC_REGIONS, 7, (mask & REDUCT_COMBINE_MEMORY_LISTS) == REDUCT_COMBINE_MEMORY_LISTS); _r_wnd_removecontext (hwnd, IDC_REGIONS); if (!_r_sys_iselevated ()) { _r_ctrl_enable (hwnd, IDC_REGIONS, FALSE); _r_ctrl_enable (hwnd, IDC_AUTOREDUCTENABLE_CHK, FALSE); _r_ctrl_enable (hwnd, IDC_AUTOREDUCTINTERVALENABLE_CHK, FALSE); _r_ctrl_enable (hwnd, IDC_HOTKEY_CLEAN_CHK, FALSE); _r_ctrl_enable (hwnd, IDC_HOTKEY_CLEAN, FALSE); } _r_ctrl_checkbutton (hwnd, IDC_AUTOREDUCTENABLE_CHK, _r_config_getboolean (L"AutoreductEnable", FALSE, NULL)); _r_updown_setrange (hwnd, IDC_AUTOREDUCTVALUE, 1, 99); _r_updown_setvalue (hwnd, IDC_AUTOREDUCTVALUE, _app_getlimitvalue ()); _r_ctrl_checkbutton (hwnd, IDC_AUTOREDUCTINTERVALENABLE_CHK, _r_config_getboolean (L"AutoreductIntervalEnable", FALSE, NULL)); _r_updown_setrange (hwnd, IDC_AUTOREDUCTINTERVALVALUE, 1, 1440); _r_updown_setvalue (hwnd, IDC_AUTOREDUCTINTERVALVALUE, _app_getintervalvalue ()); _r_ctrl_checkbutton (hwnd, IDC_HOTKEY_CLEAN_CHK, _r_config_getboolean (L"HotkeyCleanEnable", FALSE, NULL)); if (!_r_ctrl_isbuttonchecked (hwnd, IDC_HOTKEY_CLEAN_CHK)) _r_ctrl_enable (hwnd, IDC_HOTKEY_CLEAN, FALSE); _r_hotkey_set (hwnd, IDC_HOTKEY_CLEAN, _r_config_getlong (L"HotkeyClean", MAKEWORD (VK_F1, HOTKEYF_CONTROL), NULL)); _r_ctrl_sendcommand (hwnd, IDC_AUTOREDUCTENABLE_CHK, 0); _r_ctrl_sendcommand (hwnd, IDC_AUTOREDUCTINTERVALENABLE_CHK, 0); _r_ctrl_sendcommand (hwnd, IDC_HOTKEY_CLEAN_CHK, 0); break; } case IDD_SETTINGS_APPEARANCE: { LOGFONT logfont; LONG dpi_value; _r_ctrl_checkbutton (hwnd, IDC_TRAYUSETRANSPARENCY_CHK, _r_config_getboolean (L"TrayUseTransparency", FALSE, NULL)); _r_ctrl_checkbutton (hwnd, IDC_TRAYSHOWBORDER_CHK, _r_config_getboolean (L"TrayShowBorder", FALSE, NULL)); _r_ctrl_checkbutton (hwnd, IDC_TRAYROUNDCORNERS_CHK, _r_config_getboolean (L"TrayRoundCorners", FALSE, NULL)); _r_ctrl_checkbutton (hwnd, IDC_TRAYCHANGEBG_CHK, _r_config_getboolean (L"TrayChangeBg", TRUE, NULL)); _r_ctrl_checkbutton (hwnd, IDC_TRAYUSEANTIALIASING_CHK, _r_config_getboolean (L"TrayUseAntialiasing", FALSE, NULL)); dpi_value = _r_dc_gettaskbardpi (); _app_fontinit (&logfont, dpi_value); _app_setfontcontrol (hwnd, IDC_FONT, &logfont, dpi_value); _r_listview_setstyle (hwnd, IDC_COLORS, LVS_EX_DOUBLEBUFFER | LVS_EX_FULLROWSELECT | LVS_EX_INFOTIP | LVS_EX_LABELTIP, FALSE); // fix by @XakerTwo _r_listview_deleteallcolumns (hwnd, IDC_COLORS); _r_listview_deleteallitems (hwnd, IDC_COLORS); _r_listview_addcolumn (hwnd, IDC_COLORS, 0, NULL, -100, LVCFMT_LEFT); _r_listview_additem ( hwnd, IDC_COLORS, 0, _r_locale_getstring (IDS_COLOR_TEXT_HINT), I_DEFAULT, I_DEFAULT, _r_config_getulong (L"TrayColorText", TRAY_COLOR_TEXT, NULL) ); _r_listview_additem ( hwnd, IDC_COLORS, 1, _r_locale_getstring (IDS_COLOR_BACKGROUND_HINT), I_DEFAULT, I_DEFAULT, _r_config_getulong (L"TrayColorBg", TRAY_COLOR_BG, NULL) ); _r_listview_additem ( hwnd, IDC_COLORS, 2, _r_locale_getstring (IDS_COLOR_WARNING_HINT), I_DEFAULT, I_DEFAULT, _r_config_getulong (L"TrayColorWarning", TRAY_COLOR_WARNING, NULL) ); _r_listview_additem ( hwnd, IDC_COLORS, 3, _r_locale_getstring (IDS_COLOR_DANGER_HINT), I_DEFAULT, I_DEFAULT, _r_config_getulong (L"TrayColorDanger", TRAY_COLOR_DANGER, NULL) ); break; } case IDD_SETTINGS_TRAY: { _r_updown_setrange (hwnd, IDC_TRAYLEVELWARNING, 1, 99); _r_updown_setvalue (hwnd, IDC_TRAYLEVELWARNING, _app_getwarningvalue ()); _r_updown_setrange (hwnd, IDC_TRAYLEVELDANGER, 1, 99); _r_updown_setvalue (hwnd, IDC_TRAYLEVELDANGER, _app_getdangervalue ()); _r_combobox_setcurrentitem (hwnd, IDC_TRAYACTIONSC, _r_config_getlong (L"TrayActionDc", 0, NULL)); _r_combobox_setcurrentitem (hwnd, IDC_TRAYACTIONMC, _r_config_getlong (L"TrayActionMc", 1, NULL)); _r_ctrl_checkbutton (hwnd, IDC_SHOW_CLEAN_RESULT_CHK, _r_config_getboolean (L"BalloonCleanResults", TRUE, NULL)); _r_ctrl_checkbutton (hwnd, IDC_NOTIFICATIONSOUND_CHK, _r_config_getboolean (L"IsNotificationsSound", TRUE, NULL)); break; } case IDD_SETTINGS_ADVANCED: { _r_ctrl_checkbutton (hwnd, IDC_ALLOWSTANDBYLISTCLEANUP_CHK, _r_config_getboolean (L"IsAllowStandbyListCleanup", FALSE, NULL)); _r_ctrl_checkbutton (hwnd, IDC_LOGRESULTS_CHK, _r_config_getboolean (L"LogCleanResults", FALSE, NULL)); break; } } break; } case RM_LOCALIZE: { INT dialog_id; dialog_id = (INT)wparam; // localize titles _r_ctrl_setstringformat (hwnd, IDC_TITLE_1, L"%s:", _r_locale_getstring (IDS_TITLE_1)); _r_ctrl_setstringformat (hwnd, IDC_TITLE_2, L"%s: (Language)", _r_locale_getstring (IDS_TITLE_2)); _r_ctrl_setstringformat (hwnd, IDC_TITLE_3, L"%s:", _r_locale_getstring (IDS_TITLE_3)); _r_ctrl_setstringformat (hwnd, IDC_TITLE_4, L"%s:", _r_locale_getstring (IDS_TITLE_4)); _r_ctrl_setstringformat (hwnd, IDC_TITLE_5, L"%s:", _r_locale_getstring (IDS_TITLE_5)); _r_ctrl_setstringformat (hwnd, IDC_TITLE_6, L"%s:", _r_locale_getstring (IDS_TITLE_6)); _r_ctrl_setstringformat (hwnd, IDC_TITLE_7, L"%s:", _r_locale_getstring (IDS_TITLE_7)); _r_ctrl_setstringformat (hwnd, IDC_TITLE_8, L"%s:", _r_locale_getstring (IDS_TITLE_8)); _r_ctrl_setstringformat (hwnd, IDC_TITLE_9, L"%s:", _r_locale_getstring (IDS_TITLE_9)); switch (dialog_id) { case IDD_SETTINGS_GENERAL: { _r_ctrl_setstring (hwnd, IDC_ALWAYSONTOP_CHK, _r_locale_getstring (IDS_ALWAYSONTOP_CHK)); _r_ctrl_setstring (hwnd, IDC_LOADONSTARTUP_CHK, _r_locale_getstring (IDS_LOADONSTARTUP_CHK)); _r_ctrl_setstring (hwnd, IDC_STARTMINIMIZED_CHK, _r_locale_getstring (IDS_STARTMINIMIZED_CHK)); _r_ctrl_setstring (hwnd, IDC_REDUCTCONFIRMATION_CHK, _r_locale_getstring (IDS_REDUCTCONFIRMATION_CHK)); _r_ctrl_setstring (hwnd, IDC_SKIPUACWARNING_CHK, _r_locale_getstring (IDS_SKIPUACWARNING_CHK)); _r_ctrl_setstring (hwnd, IDC_CHECKUPDATES_CHK, _r_locale_getstring (IDS_CHECKUPDATES_CHK)); _r_ctrl_setstring (hwnd, IDC_LANGUAGE_HINT, _r_locale_getstring (IDS_LANGUAGE_HINT)); break; } case IDD_SETTINGS_MEMORY: { _r_ctrl_setstring (hwnd, IDC_AUTOREDUCTENABLE_CHK, _r_locale_getstring (IDS_AUTOREDUCTENABLE_CHK)); _r_ctrl_setstring (hwnd, IDC_AUTOREDUCTINTERVALENABLE_CHK, _r_locale_getstring (IDS_AUTOREDUCTINTERVALENABLE_CHK)); _r_ctrl_setstring (hwnd, IDC_HOTKEY_CLEAN_CHK, _r_locale_getstring (IDS_HOTKEY_CLEAN_CHK)); break; } case IDD_SETTINGS_APPEARANCE: { _r_ctrl_setstring (hwnd, IDC_TRAYUSETRANSPARENCY_CHK, _r_locale_getstring (IDS_TRAYUSETRANSPARENCY_CHK)); _r_ctrl_setstring (hwnd, IDC_TRAYSHOWBORDER_CHK, _r_locale_getstring (IDS_TRAYSHOWBORDER_CHK)); _r_ctrl_setstring (hwnd, IDC_TRAYROUNDCORNERS_CHK, _r_locale_getstring (IDS_TRAYROUNDCORNERS_CHK)); _r_ctrl_setstring (hwnd, IDC_TRAYCHANGEBG_CHK, _r_locale_getstring (IDS_TRAYCHANGEBG_CHK)); _r_ctrl_setstring (hwnd, IDC_TRAYUSEANTIALIASING_CHK, _r_locale_getstring (IDS_TRAYUSEANTIALIASING_CHK)); _r_ctrl_setstring (hwnd, IDC_FONT_HINT, _r_locale_getstring (IDS_FONT_HINT)); _r_listview_setitem (hwnd, IDC_COLORS, 0, 0, _r_locale_getstring (IDS_COLOR_TEXT_HINT), I_DEFAULT, I_DEFAULT, I_DEFAULT); _r_listview_setitem (hwnd, IDC_COLORS, 1, 0, _r_locale_getstring (IDS_COLOR_BACKGROUND_HINT), I_DEFAULT, I_DEFAULT, I_DEFAULT); _r_listview_setitem (hwnd, IDC_COLORS, 2, 0, _r_locale_getstring (IDS_COLOR_WARNING_HINT), I_DEFAULT, I_DEFAULT, I_DEFAULT); _r_listview_setitem (hwnd, IDC_COLORS, 3, 0, _r_locale_getstring (IDS_COLOR_DANGER_HINT), I_DEFAULT, I_DEFAULT, I_DEFAULT); break; } case IDD_SETTINGS_TRAY: { LPCWSTR string; _r_ctrl_setstring (hwnd, IDC_TRAYLEVELWARNING_HINT, _r_locale_getstring (IDS_TRAYLEVELWARNING_HINT)); _r_ctrl_setstring (hwnd, IDC_TRAYLEVELDANGER_HINT, _r_locale_getstring (IDS_TRAYLEVELDANGER_HINT)); _r_ctrl_setstring (hwnd, IDC_TRAYACTIONSC_HINT, _r_locale_getstring (IDS_TRAYACTIONSC_HINT)); _r_ctrl_setstring (hwnd, IDC_TRAYACTIONMC_HINT, _r_locale_getstring (IDS_TRAYACTIONMC_HINT)); _r_combobox_clear (hwnd, IDC_TRAYACTIONSC); _r_combobox_clear (hwnd, IDC_TRAYACTIONMC); for (INT i = 0; i < 3; i++) { string = _r_locale_getstring (IDS_TRAY_ACTION_1 + i); _r_combobox_insertitem (hwnd, IDC_TRAYACTIONSC, i, string, i); _r_combobox_insertitem (hwnd, IDC_TRAYACTIONMC, i, string, i); } _r_combobox_setcurrentitembylparam (hwnd, IDC_TRAYACTIONSC, _r_config_getlong (L"TrayActionDc", 0, NULL)); _r_combobox_setcurrentitembylparam (hwnd, IDC_TRAYACTIONMC, _r_config_getlong (L"TrayActionMc", 1, NULL)); _r_ctrl_setstring (hwnd, IDC_SHOW_CLEAN_RESULT_CHK, _r_locale_getstring (IDS_SHOW_CLEAN_RESULT_CHK)); _r_ctrl_setstring (hwnd, IDC_NOTIFICATIONSOUND_CHK, _r_locale_getstring (IDS_NOTIFICATIONSOUND_CHK)); break; } case IDD_SETTINGS_ADVANCED: { _r_ctrl_setstring (hwnd, IDC_ALLOWSTANDBYLISTCLEANUP_CHK, L"Allow \"Standby lists\" and \"Modified page list\" cleanup on autoreduct"); _r_ctrl_setstring (hwnd, IDC_LOGRESULTS_CHK, L"Log cleaning results into a debug log"); break; } } break; } case WM_NOTIFY: { LPNMHDR nmlp; nmlp = (LPNMHDR)lparam; switch (nmlp->code) { case NM_CUSTOMDRAW: { LPNMLVCUSTOMDRAW lpnmlv; COLORREF clr; lpnmlv = (LPNMLVCUSTOMDRAW)lparam; switch (lpnmlv->nmcd.dwDrawStage) { case CDDS_PREPAINT: { SetWindowLongPtrW (hwnd, DWLP_MSGRESULT, CDRF_NOTIFYITEMDRAW); return CDRF_NOTIFYITEMDRAW; } case CDDS_ITEMPREPAINT: { if (lpnmlv->nmcd.hdr.idFrom == IDC_REGIONS) { if (_r_sys_isosversionlower (WINDOWS_8_1) && (lpnmlv->nmcd.lItemlParam & REDUCT_REGISTRY_CACHE) == REDUCT_REGISTRY_CACHE) { clr = _r_theme_isenabled () ? WND_GRAYTEXT_CLR : GetSysColor (COLOR_GRAYTEXT); lpnmlv->clrText = _r_dc_getcolorbrightness (clr); lpnmlv->clrTextBk = clr; return CDRF_NEWFONT; } if (_r_sys_isosversionlower (WINDOWS_10) && (lpnmlv->nmcd.lItemlParam & REDUCT_COMBINE_MEMORY_LISTS) == REDUCT_COMBINE_MEMORY_LISTS) { clr = _r_theme_isenabled () ? WND_GRAYTEXT_CLR : GetSysColor (COLOR_GRAYTEXT); lpnmlv->clrText = _r_dc_getcolorbrightness (clr); lpnmlv->clrTextBk = clr; return CDRF_NEWFONT; } } else if (lpnmlv->nmcd.hdr.idFrom == IDC_COLORS) { clr = (COLORREF)lpnmlv->nmcd.lItemlParam; lpnmlv->clrText = _r_dc_getcolorbrightness (clr); lpnmlv->clrTextBk = clr; _r_dc_fillrect (lpnmlv->nmcd.hdc, &lpnmlv->nmcd.rc, clr); SetWindowLongPtrW (hwnd, DWLP_MSGRESULT, CDRF_NEWFONT); return CDRF_NEWFONT; } } } break; } case NM_DBLCLK: { LPNMITEMACTIVATE lpnmlv; CHOOSECOLOR cc = {0}; COLORREF cust[16] = {TRAY_COLOR_DANGER, TRAY_COLOR_WARNING, TRAY_COLOR_BG, TRAY_COLOR_TEXT}; COLORREF clr; LONG dpi_value; INT listview_id; lpnmlv = (LPNMITEMACTIVATE)lparam; listview_id = (INT)(INT_PTR)lpnmlv->hdr.idFrom; if (lpnmlv->iItem == INT_ERROR || listview_id != IDC_COLORS) break; clr = (COLORREF)_r_listview_getitemlparam (hwnd, listview_id, lpnmlv->iItem); if (!clr) break; cc.lStructSize = sizeof (CHOOSECOLOR); cc.Flags = CC_RGBINIT | CC_FULLOPEN; cc.hwndOwner = hwnd; cc.lpCustColors = cust; cc.rgbResult = clr; if (ChooseColorW (&cc)) { if (lpnmlv->iItem == 0) { _r_config_setulong (L"TrayColorText", cc.rgbResult, NULL); } else if (lpnmlv->iItem == 1) { _r_config_setulong (L"TrayColorBg", cc.rgbResult, NULL); } else if (lpnmlv->iItem == 2) { _r_config_setulong (L"TrayColorWarning", cc.rgbResult, NULL); } else if (lpnmlv->iItem == 3) { _r_config_setulong (L"TrayColorDanger", cc.rgbResult, NULL); } _r_listview_setitem (hwnd, IDC_COLORS, lpnmlv->iItem, lpnmlv->iSubItem, NULL, I_DEFAULT, I_DEFAULT, cc.rgbResult); _r_listview_redraw (hwnd, IDC_COLORS); dpi_value = _r_dc_gettaskbardpi (); _app_iconinit (dpi_value); _app_iconredraw (_r_app_gethwnd ()); } break; } case LVN_ITEMCHANGED: { LPNMLISTVIEW lpnmlv; INT listview_id; ULONG value; ULONG mask; lpnmlv = (LPNMLISTVIEW)lparam; listview_id = (INT)(INT_PTR)lpnmlv->hdr.idFrom; if (listview_id != IDC_REGIONS) break; if (_r_wnd_getcontext (hwnd, listview_id)) break; if ((lpnmlv->uChanged & LVIF_STATE) == 0) break; if ((lpnmlv->uNewState & LVIS_STATEIMAGEMASK) == INDEXTOSTATEIMAGEMASK (1) || ((lpnmlv->uNewState & LVIS_STATEIMAGEMASK) == INDEXTOSTATEIMAGEMASK (2))) { value = (ULONG)lpnmlv->lParam; mask = _r_config_getulong (L"ReductMask2", REDUCT_MASK_DEFAULT, NULL); if ((lpnmlv->uNewState & LVIS_STATEIMAGEMASK) == INDEXTOSTATEIMAGEMASK (2)) { if ((value & REDUCT_MASK_FREEZES) != 0) { if (!_r_show_confirmmessage (hwnd, NULL, _r_locale_getstring (IDS_QUESTION_WARNING), L"IsShowWarningConfirmation", FALSE)) { _r_listview_setitemcheck (hwnd, listview_id, lpnmlv->iItem, FALSE); return FALSE; } } } if (_r_sys_isosversionlower (WINDOWS_8_1) && (value & REDUCT_REGISTRY_CACHE) == REDUCT_REGISTRY_CACHE) { _r_listview_setitemcheck (hwnd, listview_id, lpnmlv->iItem, (mask & REDUCT_REGISTRY_CACHE) == REDUCT_REGISTRY_CACHE); return FALSE; } if (_r_sys_isosversionlower (WINDOWS_10) && (value & REDUCT_COMBINE_MEMORY_LISTS) == REDUCT_COMBINE_MEMORY_LISTS) { _r_listview_setitemcheck (hwnd, listview_id, lpnmlv->iItem, (mask & REDUCT_COMBINE_MEMORY_LISTS) == REDUCT_COMBINE_MEMORY_LISTS); return FALSE; } if ((lpnmlv->uNewState & LVIS_STATEIMAGEMASK) == INDEXTOSTATEIMAGEMASK (2)) { mask |= value; } else { mask &= ~value; } _r_config_setulong (L"ReductMask2", mask, NULL); } break; } } break; } case WM_VSCROLL: case WM_HSCROLL: { LONG value; INT ctrl_id; BOOLEAN is_stylechanged = FALSE; ctrl_id = GetDlgCtrlID ((HWND)lparam); if (ctrl_id == IDC_AUTOREDUCTVALUE) { value = _r_updown_getvalue (hwnd, ctrl_id); _r_config_setlong (L"AutoreductValue", value, NULL); } else if (ctrl_id == IDC_AUTOREDUCTINTERVALVALUE) { value = _r_updown_getvalue (hwnd, ctrl_id); _r_config_setlong (L"AutoreductIntervalValue", value, NULL); } else if (ctrl_id == IDC_TRAYLEVELWARNING) { value = _r_updown_getvalue (hwnd, ctrl_id); _r_config_setlong (L"TrayLevelWarning", value, NULL); is_stylechanged = TRUE; } else if (ctrl_id == IDC_TRAYLEVELDANGER) { value = _r_updown_getvalue (hwnd, ctrl_id); _r_config_setlong (L"TrayLevelDanger", value, NULL); is_stylechanged = TRUE; } if (is_stylechanged) { _app_iconredraw (_r_app_gethwnd ()); _r_listview_redraw (_r_app_gethwnd (), IDC_LISTVIEW); } break; } case WM_COMMAND: { INT ctrl_id = LOWORD (wparam); INT notify_code = HIWORD (wparam); switch (ctrl_id) { case IDC_AUTOREDUCTVALUE_CTRL: { LONG value; if (notify_code == EN_CHANGE) { value = _r_updown_getvalue (hwnd, IDC_AUTOREDUCTVALUE); _r_config_setlong (L"AutoreductValue", value, NULL); } break; } case IDC_AUTOREDUCTINTERVALVALUE_CTRL: { LONG value; if (notify_code == EN_CHANGE) { value = _r_updown_getvalue (hwnd, IDC_AUTOREDUCTINTERVALVALUE); _r_config_setlong (L"AutoreductIntervalValue", value, NULL); } break; } case IDC_TRAYLEVELWARNING_CTRL: case IDC_TRAYLEVELDANGER_CTRL: { LONG value; if (notify_code == EN_CHANGE) { if (ctrl_id == IDC_TRAYLEVELWARNING_CTRL) { value = _r_updown_getvalue (hwnd, IDC_TRAYLEVELWARNING); _r_config_setlong (L"TrayLevelWarning", value, NULL); } else if (ctrl_id == IDC_TRAYLEVELDANGER_CTRL) { value = _r_updown_getvalue (hwnd, IDC_TRAYLEVELDANGER); _r_config_setlong (L"TrayLevelDanger", value, NULL); } _app_iconredraw (_r_app_gethwnd ()); _r_listview_redraw (_r_app_gethwnd (), IDC_LISTVIEW); } break; } case IDC_ALWAYSONTOP_CHK: { BOOLEAN is_enable; is_enable = _r_ctrl_isbuttonchecked (hwnd, ctrl_id); _r_config_setboolean (L"AlwaysOnTop", is_enable, NULL); _r_menu_checkitem (GetMenu (_r_app_gethwnd ()), IDM_ALWAYSONTOP_CHK, 0, MF_BYCOMMAND, is_enable); break; } case IDC_LOADONSTARTUP_CHK: { BOOLEAN is_enable; is_enable = _r_ctrl_isbuttonchecked (hwnd, ctrl_id); _r_autorun_enable (hwnd, is_enable); is_enable = _r_autorun_isenabled (); _r_menu_checkitem (GetMenu (_r_app_gethwnd ()), IDM_LOADONSTARTUP_CHK, 0, MF_BYCOMMAND, is_enable); _r_ctrl_checkbutton (hwnd, ctrl_id, is_enable); break; } case IDC_STARTMINIMIZED_CHK: { BOOLEAN is_enable; is_enable = _r_ctrl_isbuttonchecked (hwnd, ctrl_id); _r_config_setboolean (L"IsStartMinimized", is_enable, NULL); _r_menu_checkitem (GetMenu (_r_app_gethwnd ()), IDM_STARTMINIMIZED_CHK, 0, MF_BYCOMMAND, is_enable); break; } case IDC_REDUCTCONFIRMATION_CHK: { BOOLEAN is_enable; is_enable = _r_ctrl_isbuttonchecked (hwnd, ctrl_id); _r_config_setboolean (L"IsShowReductConfirmation", is_enable, NULL); _r_menu_checkitem (GetMenu (_r_app_gethwnd ()), IDM_REDUCTCONFIRMATION_CHK, 0, MF_BYCOMMAND, is_enable); break; } case IDC_SKIPUACWARNING_CHK: { BOOLEAN is_enable; is_enable = _r_ctrl_isbuttonchecked (hwnd, ctrl_id); _r_skipuac_enable (hwnd, is_enable); is_enable = _r_skipuac_isenabled (); _r_menu_checkitem (GetMenu (_r_app_gethwnd ()), IDM_SKIPUACWARNING_CHK, 0, MF_BYCOMMAND, is_enable); _r_ctrl_checkbutton (hwnd, ctrl_id, is_enable); break; } case IDC_CHECKUPDATES_CHK: { BOOLEAN is_enable; is_enable = _r_ctrl_isbuttonchecked (hwnd, ctrl_id); _r_update_enable (is_enable); is_enable = _r_update_isenabled (FALSE); _r_menu_checkitem (GetMenu (_r_app_gethwnd ()), IDM_CHECKUPDATES_CHK, 0, MF_BYCOMMAND, is_enable); break; } case IDC_LANGUAGE: { if (notify_code == CBN_SELCHANGE) _r_locale_apply (hwnd, ctrl_id, 0); break; } case IDC_AUTOREDUCTENABLE_CHK: { HWND hbuddy; BOOLEAN is_enabled; is_enabled = _r_ctrl_isenabled (hwnd, ctrl_id); hbuddy = _r_updown_getbuddy (hwnd, IDC_AUTOREDUCTVALUE); if (hbuddy) _r_ctrl_enable (hbuddy, 0, is_enabled); if (is_enabled) { is_enabled = (_r_ctrl_isbuttonchecked (hwnd, ctrl_id)); _r_config_setboolean (L"AutoreductEnable", is_enabled, NULL); } break; } case IDC_AUTOREDUCTINTERVALENABLE_CHK: { HWND hbuddy; BOOLEAN is_enabled; is_enabled = _r_ctrl_isenabled (hwnd, ctrl_id); hbuddy = _r_updown_getbuddy (hwnd, IDC_AUTOREDUCTINTERVALVALUE); if (hbuddy) _r_ctrl_enable (hbuddy, 0, is_enabled); if (is_enabled) { is_enabled = (_r_ctrl_isbuttonchecked (hwnd, ctrl_id)); _r_config_setboolean (L"AutoreductIntervalEnable", is_enabled, NULL); } break; } case IDC_HOTKEY_CLEAN_CHK: { BOOLEAN is_checked; is_checked = _r_ctrl_isbuttonchecked (hwnd, ctrl_id); _r_ctrl_enable (hwnd, IDC_HOTKEY_CLEAN, is_checked); _r_config_setboolean (L"HotkeyCleanEnable", is_checked, NULL); _app_hotkeyinit (_r_app_gethwnd ()); break; } case IDC_HOTKEY_CLEAN: { if (!_r_ctrl_isbuttonchecked (hwnd, IDC_HOTKEY_CLEAN_CHK)) break; if (notify_code == EN_CHANGE) { _r_config_setlong (L"HotkeyClean", _r_hotkey_get (hwnd, ctrl_id), NULL); _app_hotkeyinit (_r_app_gethwnd ()); } break; } case IDC_TRAYUSETRANSPARENCY_CHK: case IDC_TRAYSHOWBORDER_CHK: case IDC_TRAYROUNDCORNERS_CHK: case IDC_TRAYCHANGEBG_CHK: case IDC_TRAYUSEANTIALIASING_CHK: { BOOLEAN is_enabled; LONG dpi_value; is_enabled = _r_ctrl_isbuttonchecked (hwnd, ctrl_id); switch (ctrl_id) { case IDC_TRAYUSETRANSPARENCY_CHK: { _r_config_setboolean (L"TrayUseTransparency", is_enabled, NULL); break; } case IDC_TRAYSHOWBORDER_CHK: { _r_config_setboolean (L"TrayShowBorder", is_enabled, NULL); break; } case IDC_TRAYROUNDCORNERS_CHK: { _r_config_setboolean (L"TrayRoundCorners", is_enabled, NULL); break; } case IDC_TRAYCHANGEBG_CHK: { _r_config_setboolean (L"TrayChangeBg", is_enabled, NULL); break; } case IDC_TRAYUSEANTIALIASING_CHK: { _r_config_setboolean (L"TrayUseAntialiasing", is_enabled, NULL); break; } } dpi_value = _r_dc_gettaskbardpi (); _app_iconinit (dpi_value); _app_iconredraw (_r_app_gethwnd ()); break; } case IDC_TRAYACTIONSC: { if (notify_code == CBN_SELCHANGE) _r_config_setlong (L"TrayActionDc", _r_combobox_getcurrentitem (hwnd, ctrl_id), NULL); break; } case IDC_TRAYACTIONMC: { if (notify_code == CBN_SELCHANGE) _r_config_setlong (L"TrayActionMc", _r_combobox_getcurrentitem (hwnd, ctrl_id), NULL); break; } case IDC_SHOW_CLEAN_RESULT_CHK: { BOOLEAN is_enabled; is_enabled = _r_ctrl_isbuttonchecked (hwnd, ctrl_id); _r_config_setboolean (L"BalloonCleanResults", is_enabled, NULL); break; } case IDC_NOTIFICATIONSOUND_CHK: { BOOLEAN is_enabled; is_enabled = _r_ctrl_isbuttonchecked (hwnd, ctrl_id); _r_config_setboolean (L"IsNotificationsSound", is_enabled, NULL); break; } case IDC_FONT: { CHOOSEFONT cf = {0}; LOGFONT logfont; LONG dpi_value; cf.lStructSize = sizeof (CHOOSEFONT); cf.hwndOwner = hwnd; cf.Flags = CF_INITTOLOGFONTSTRUCT | CF_FORCEFONTEXIST | CF_SCREENFONTS; dpi_value = _r_dc_gettaskbardpi (); _app_fontinit (&logfont, dpi_value); cf.lpLogFont = &logfont; if (ChooseFontW (&cf)) { _r_config_setfont (L"TrayFont", &logfont, dpi_value, NULL); _app_setfontcontrol (hwnd, IDC_FONT, &logfont, dpi_value); _app_iconinit (dpi_value); _app_iconredraw (_r_app_gethwnd ()); } break; } case IDC_ALLOWSTANDBYLISTCLEANUP_CHK: { BOOLEAN is_enabled; is_enabled = _r_ctrl_isbuttonchecked (hwnd, ctrl_id); _r_config_setboolean (L"IsAllowStandbyListCleanup", is_enabled, NULL); break; } case IDC_LOGRESULTS_CHK: { BOOLEAN is_enabled; is_enabled = _r_ctrl_isbuttonchecked (hwnd, ctrl_id); _r_config_setboolean (L"LogCleanResults", is_enabled, NULL); break; } } break; } } return FALSE; } VOID _app_resizecolumns ( _In_ HWND hwnd ) { _r_listview_setcolumn (hwnd, IDC_LISTVIEW, 0, NULL, -50); _r_listview_setcolumn (hwnd, IDC_LISTVIEW, 1, NULL, -50); } VOID _app_initialize ( _In_opt_ HWND hwnd ) { ULONG privileges[] = { SE_PROF_SINGLE_PROCESS_PRIVILEGE, SE_INCREASE_QUOTA_PRIVILEGE, }; LONG dpi_value; if (_r_sys_iselevated ()) { _r_sys_setprocessprivilege (NtCurrentProcess (), privileges, RTL_NUMBER_OF (privileges), TRUE); } else { if (hwnd) _r_ctrl_setbuttonshield (hwnd, IDC_CLEAN, TRUE); } if (!hwnd) return; dpi_value = _r_dc_getwindowdpi (hwnd); _r_ctrl_setbuttonmargins (hwnd, IDC_CLEAN, dpi_value); // configure listview _r_listview_setstyle ( hwnd, IDC_LISTVIEW, LVS_EX_DOUBLEBUFFER | LVS_EX_FULLROWSELECT | LVS_EX_INFOTIP | LVS_EX_LABELTIP, TRUE ); _r_listview_addcolumn (hwnd, IDC_LISTVIEW, 1, NULL, 10, LVCFMT_RIGHT); _r_listview_addcolumn (hwnd, IDC_LISTVIEW, 2, NULL, 10, LVCFMT_LEFT); // configure listview for (INT i = 0, k = 0; i < 3; i++) { _r_listview_addgroup (hwnd, IDC_LISTVIEW, i, _r_locale_getstring (IDS_GROUP_1 + i), 0, LVGS_COLLAPSIBLE, LVGS_COLLAPSIBLE); for (INT j = 0; j < 3; j++) { _r_listview_additem (hwnd, IDC_LISTVIEW, k++, _r_locale_getstring (IDS_ITEM_1 + j), I_DEFAULT, i, 0); } } // settings _r_settings_addpage (IDD_SETTINGS_GENERAL, IDS_SETTINGS_GENERAL); _r_settings_addpage (IDD_SETTINGS_MEMORY, IDS_SETTINGS_MEMORY); _r_settings_addpage (IDD_SETTINGS_APPEARANCE, IDS_SETTINGS_APPEARANCE); _r_settings_addpage (IDD_SETTINGS_TRAY, IDS_SETTINGS_TRAY); _r_settings_addpage (IDD_SETTINGS_ADVANCED, IDS_TITLE_ADVANCED); _app_resizecolumns (hwnd); } INT_PTR CALLBACK DlgProc ( _In_ HWND hwnd, _In_ UINT msg, _In_ WPARAM wparam, _In_ LPARAM lparam ) { switch (msg) { case WM_INITDIALOG: { _r_app_sethwnd (hwnd); // HACK!!! _app_initialize (hwnd); SetTimer (hwnd, UID, TIMER, &_app_timercallback); break; } case WM_DESTROY: { KillTimer (hwnd, UID); _r_tray_destroy (hwnd, &GUID_TrayIcon); PostQuitMessage (0); break; } case RM_INITIALIZE: { HMENU hmenu; LONG dpi_value; hmenu = GetMenu (hwnd); if (hmenu) { _r_menu_checkitem (hmenu, IDM_ALWAYSONTOP_CHK, 0, MF_BYCOMMAND, _r_config_getboolean (L"AlwaysOnTop", FALSE, NULL)); _r_menu_checkitem (hmenu, IDM_USEDARKTHEME, 0, MF_BYCOMMAND, _r_theme_isenabled ()); _r_menu_checkitem (hmenu, IDM_LOADONSTARTUP_CHK, 0, MF_BYCOMMAND, _r_autorun_isenabled ()); _r_menu_checkitem (hmenu, IDM_STARTMINIMIZED_CHK, 0, MF_BYCOMMAND, _r_config_getboolean (L"IsStartMinimized", FALSE, NULL)); _r_menu_checkitem (hmenu, IDM_REDUCTCONFIRMATION_CHK, 0, MF_BYCOMMAND, _r_config_getboolean (L"IsShowReductConfirmation", TRUE, NULL)); _r_menu_checkitem (hmenu, IDM_SKIPUACWARNING_CHK, 0, MF_BYCOMMAND, _r_skipuac_isenabled ()); _r_menu_checkitem (hmenu, IDM_CHECKUPDATES_CHK, 0, MF_BYCOMMAND, _r_update_isenabled (FALSE)); if (!_r_sys_iselevated ()) _r_menu_enableitem (hmenu, IDM_SKIPUACWARNING_CHK, FALSE, FALSE); } dpi_value = _r_dc_gettaskbardpi (); _app_iconinit (dpi_value); _r_tray_create (hwnd, &GUID_TrayIcon, RM_TRAYICON, _app_iconcreate (0), _r_app_getname (), FALSE); _app_iconredraw (hwnd); break; } case RM_INITIALIZE_POST: { if (_r_sys_iselevated ()) _app_hotkeyinit (hwnd); break; } case RM_TASKBARCREATED: { LONG dpi_value; dpi_value = _r_dc_gettaskbardpi (); _app_iconinit (dpi_value); _r_tray_create (hwnd, &GUID_TrayIcon, RM_TRAYICON, _app_iconcreate (0), _r_app_getname (), FALSE); _app_iconredraw (hwnd); break; } case RM_LOCALIZE: { // localize menu HMENU hmenu; hmenu = GetMenu (hwnd); if (hmenu) { _r_menu_setitemtext (hmenu, 0, TRUE, _r_locale_getstring (IDS_FILE)); _r_menu_setitemtext (hmenu, 1, TRUE, _r_locale_getstring (IDS_VIEW)); _r_menu_setitemtext (hmenu, 2, TRUE, _r_locale_getstring (IDS_SETTINGS)); _r_menu_setitemtext (hmenu, 3, TRUE, _r_locale_getstring (IDS_HELP)); _r_menu_setitemtextformat (hmenu, IDM_SETTINGS, FALSE, L"%s...\tF2", _r_locale_getstring (IDS_SETTINGS)); _r_menu_setitemtext (hmenu, IDM_EXIT, FALSE, _r_locale_getstring (IDS_EXIT)); _r_menu_setitemtext (hmenu, IDM_ALWAYSONTOP_CHK, FALSE, _r_locale_getstring (IDS_ALWAYSONTOP_CHK)); _r_menu_setitemtext (hmenu, IDM_LOADONSTARTUP_CHK, FALSE, _r_locale_getstring (IDS_LOADONSTARTUP_CHK)); _r_menu_setitemtext (hmenu, IDM_USEDARKTHEME, FALSE, _r_locale_getstring (IDS_USEDARKTHEME)); _r_menu_setitemtext (hmenu, IDM_STARTMINIMIZED_CHK, FALSE, _r_locale_getstring (IDS_STARTMINIMIZED_CHK)); _r_menu_setitemtext (hmenu, IDM_REDUCTCONFIRMATION_CHK, FALSE, _r_locale_getstring (IDS_REDUCTCONFIRMATION_CHK)); _r_menu_setitemtext (hmenu, IDM_SKIPUACWARNING_CHK, FALSE, _r_locale_getstring (IDS_SKIPUACWARNING_CHK)); _r_menu_setitemtext (hmenu, IDM_CHECKUPDATES_CHK, FALSE, _r_locale_getstring (IDS_CHECKUPDATES_CHK)); _r_menu_setitemtextformat (GetSubMenu (hmenu, LANG_SUBMENU), LANG_MENU, TRUE, L"%s (Language)", _r_locale_getstring (IDS_LANGUAGE)); _r_menu_setitemtext (hmenu, IDM_WEBSITE, FALSE, _r_locale_getstring (IDS_WEBSITE)); _r_menu_setitemtext (hmenu, IDM_CHECKUPDATES, FALSE, _r_locale_getstring (IDS_CHECKUPDATES)); _r_menu_setitemtextformat (hmenu, IDM_ABOUT, FALSE, L"%s\tF1", _r_locale_getstring (IDS_ABOUT)); } // configure listview for (INT i = 0, k = 0; i < 3; i++) { _r_listview_setgroup (hwnd, IDC_LISTVIEW, i, _r_locale_getstring (IDS_GROUP_1 + i), 0, 0); for (INT j = 0; j < 3; j++) { _r_listview_setitem (hwnd, IDC_LISTVIEW, k++, 0, _r_locale_getstring (IDS_ITEM_1 + j), I_DEFAULT, I_DEFAULT, I_DEFAULT); } } // configure button _r_ctrl_setstring (hwnd, IDC_CLEAN, _r_locale_getstring (IDS_CLEAN)); // enum localizations if (hmenu) _r_locale_enum (GetSubMenu (hmenu, LANG_SUBMENU), LANG_MENU, IDX_LANGUAGE); break; } case WM_DPICHANGED: { LONG dpi_value; dpi_value = _r_dc_gettaskbardpi (); _app_iconinit (dpi_value); _app_iconredraw (hwnd); _app_resizecolumns (hwnd); if (!_r_sys_iselevated ()) { dpi_value = LOWORD (wparam); _r_ctrl_setbuttonmargins (hwnd, IDC_CLEAN, dpi_value); } break; } case WM_PAINT: { PAINTSTRUCT ps; HDC hdc; hdc = BeginPaint (hwnd, &ps); if (!hdc) break; _r_dc_drawwindow (hdc, hwnd, TRUE); EndPaint (hwnd, &ps); break; } case WM_HOTKEY: { if (wparam == UID) _app_memoryclean (hwnd, SOURCE_HOTKEY, 0); break; } case WM_SHOWWINDOW: { if (wparam) _app_iconredraw (hwnd); break; } case WM_NOTIFY: { LPNMHDR nmlp; nmlp = (LPNMHDR)lparam; switch (nmlp->code) { case BCN_DROPDOWN: { R_RECTANGLE rectangle; RECT rect; HMENU hsubmenu; hsubmenu = CreatePopupMenu (); if (!hsubmenu) break; _r_menu_additem (hsubmenu, IDM_CLEAN_WORKINGSET, TITLE_WORKINGSET); _r_menu_additem (hsubmenu, IDM_CLEAN_SYSTEMFILECACHE, TITLE_SYSTEMFILECACHE); _r_menu_additem (hsubmenu, IDM_CLEAN_MODIFIEDFILECACHE, TITLE_MODIFIEDFILECACHE); _r_menu_additem (hsubmenu, IDM_CLEAN_MODIFIEDLIST, TITLE_MODIFIEDLIST); _r_menu_additem (hsubmenu, IDM_CLEAN_STANDBYLIST, TITLE_STANDBYLIST); _r_menu_additem (hsubmenu, IDM_CLEAN_STANDBYLISTPRIORITY0, TITLE_STANDBYLISTPRIORITY0); _r_menu_additem (hsubmenu, IDM_CLEAN_REGISTRYCACHE, TITLE_REGISTRYCACHE); _r_menu_additem (hsubmenu, IDM_CLEAN_COMBINEMEMORYLISTS, TITLE_COMBINEMEMORYLISTS); if (_r_sys_isosversionlower (WINDOWS_8_1)) _r_menu_enableitem (hsubmenu, IDM_CLEAN_REGISTRYCACHE, FALSE, FALSE); if (_r_sys_isosversionlower (WINDOWS_10)) _r_menu_enableitem (hsubmenu, IDM_CLEAN_COMBINEMEMORYLISTS, FALSE, FALSE); if (GetClientRect (nmlp->hwndFrom, &rect)) { ClientToScreen (nmlp->hwndFrom, (PPOINT)&rect); _r_wnd_recttorectangle (&rectangle, &rect); _r_wnd_adjustrectangletoworkingarea (nmlp->hwndFrom, &rectangle); _r_wnd_rectangletorect (&rect, &rectangle); _r_menu_popup (hsubmenu, hwnd, (PPOINT)&rect, TRUE); } DestroyMenu (hsubmenu); break; } case NM_CUSTOMDRAW: { LPNMLVCUSTOMDRAW lpnmlv; LONG_PTR result; ULONG value; lpnmlv = (LPNMLVCUSTOMDRAW)lparam; result = CDRF_DODEFAULT; if (nmlp->idFrom != IDC_LISTVIEW) break; switch (lpnmlv->nmcd.dwDrawStage) { case CDDS_PREPAINT: { result = (CDRF_NOTIFYPOSTPAINT | CDRF_NOTIFYITEMDRAW); break; } case CDDS_ITEMPREPAINT: { value = (ULONG)lpnmlv->nmcd.lItemlParam; if (value >= _app_getdangervalue ()) { lpnmlv->clrText = _r_config_getulong (L"TrayColorDanger", TRAY_COLOR_DANGER, NULL); result = (CDRF_NOTIFYPOSTPAINT | CDRF_NEWFONT); } else if (value >= _app_getwarningvalue ()) { lpnmlv->clrText = _r_config_getulong (L"TrayColorWarning", TRAY_COLOR_WARNING, NULL); result = (CDRF_NOTIFYPOSTPAINT | CDRF_NEWFONT); } break; } } SetWindowLongPtrW (hwnd, DWLP_MSGRESULT, result); return result; } } break; } case RM_TRAYICON: { switch (LOWORD (lparam)) { case NIN_KEYSELECT: { if (GetForegroundWindow () != hwnd) _r_wnd_toggle (hwnd, TRUE); break; } case WM_LBUTTONDOWN: case WM_MBUTTONDOWN: { LONG action; if (LOWORD (lparam) == WM_MBUTTONDOWN) { action = _r_config_getlong (L"TrayActionMc", 1, NULL); } else { action = _r_config_getlong (L"TrayActionDc", 0, NULL); } switch (action) { case 1: { _app_memoryclean (hwnd, SOURCE_MANUAL, 0); break; } case 2: { _r_sys_createprocess (L"taskmgr.exe", NULL, NULL, FALSE); break; } default: { _r_wnd_toggle (hwnd, FALSE); break; } } SetForegroundWindow (hwnd); break; } case WM_CONTEXTMENU: { HMENU hmenu; HMENU hsubmenu; HMENU hsubmenu_region; HMENU hsubmenu_limit; HMENU hsubmenu_interval; ULONG mask; BOOLEAN is_enabled; SetForegroundWindow (hwnd); // don't touch hmenu = LoadMenuW (NULL, MAKEINTRESOURCEW (IDM_TRAY)); if (!hmenu) break; hsubmenu = GetSubMenu (hmenu, 0); if (!hsubmenu) break; hsubmenu_region = GetSubMenu (hsubmenu, TRAY_SUBMENU_1); hsubmenu_limit = GetSubMenu (hsubmenu, TRAY_SUBMENU_2); hsubmenu_interval = GetSubMenu (hsubmenu, TRAY_SUBMENU_3); // localize _r_menu_setitemtext (hsubmenu, IDM_TRAY_SHOW, FALSE, _r_locale_getstring (IDS_TRAY_SHOW)); _r_menu_setitemtextformat (hsubmenu, IDM_TRAY_CLEAN, FALSE, L"%s...", _r_locale_getstring (IDS_CLEAN)); _r_menu_setitemtext (hsubmenu, TRAY_SUBMENU_1, TRUE, _r_locale_getstring (IDS_TRAY_POPUP_1)); _r_menu_setitemtext (hsubmenu, TRAY_SUBMENU_2, TRUE, _r_locale_getstring (IDS_TRAY_POPUP_2)); _r_menu_setitemtext (hsubmenu, TRAY_SUBMENU_3, TRUE, _r_locale_getstring (IDS_TRAY_POPUP_3)); _r_menu_setitemtextformat (hsubmenu, IDM_TRAY_SETTINGS, FALSE, L"%s...", _r_locale_getstring (IDS_SETTINGS)); _r_menu_setitemtext (hsubmenu, IDM_TRAY_WEBSITE, FALSE, _r_locale_getstring (IDS_WEBSITE)); _r_menu_setitemtext (hsubmenu, IDM_TRAY_ABOUT, FALSE, _r_locale_getstring (IDS_ABOUT)); _r_menu_setitemtext (hsubmenu, IDM_TRAY_EXIT, FALSE, _r_locale_getstring (IDS_EXIT)); // configure region submenu if (hsubmenu_region) { mask = _r_config_getulong (L"ReductMask2", REDUCT_MASK_DEFAULT, NULL); _r_menu_setitemtext (hsubmenu_region, IDM_WORKINGSET_CHK, FALSE, TITLE_WORKINGSET); _r_menu_setitemtext (hsubmenu_region, IDM_SYSTEMFILECACHE_CHK, FALSE, TITLE_SYSTEMFILECACHE); _r_menu_setitemtext (hsubmenu_region, IDM_MODIFIEDFILECACHE_CHK, FALSE, TITLE_MODIFIEDFILECACHE); _r_menu_setitemtext (hsubmenu_region, IDM_MODIFIEDLIST_CHK, FALSE, TITLE_MODIFIEDLIST); _r_menu_setitemtext (hsubmenu_region, IDM_STANDBYLIST_CHK, FALSE, TITLE_STANDBYLIST); _r_menu_setitemtext (hsubmenu_region, IDM_STANDBYLISTPRIORITY0_CHK, FALSE, TITLE_STANDBYLISTPRIORITY0); _r_menu_setitemtext (hsubmenu_region, IDM_REGISTRYCACHE_CHK, FALSE, TITLE_REGISTRYCACHE); _r_menu_setitemtext (hsubmenu_region, IDM_COMBINEMEMORYLISTS_CHK, FALSE, TITLE_COMBINEMEMORYLISTS); _r_menu_checkitem (hsubmenu_region, IDM_WORKINGSET_CHK, 0, MF_BYCOMMAND, (mask & REDUCT_WORKING_SET) == REDUCT_WORKING_SET); _r_menu_checkitem (hsubmenu_region, IDM_SYSTEMFILECACHE_CHK, 0, MF_BYCOMMAND, (mask & REDUCT_SYSTEM_FILE_CACHE) == REDUCT_SYSTEM_FILE_CACHE); _r_menu_checkitem (hsubmenu_region, IDM_MODIFIEDLIST_CHK, 0, MF_BYCOMMAND, (mask & REDUCT_MODIFIED_LIST) == REDUCT_MODIFIED_LIST); _r_menu_checkitem (hsubmenu_region, IDM_STANDBYLIST_CHK, 0, MF_BYCOMMAND, (mask & REDUCT_STANDBY_LIST) == REDUCT_STANDBY_LIST); _r_menu_checkitem (hsubmenu_region, IDM_STANDBYLISTPRIORITY0_CHK, 0, MF_BYCOMMAND, (mask & REDUCT_STANDBY_PRIORITY0_LIST) == REDUCT_STANDBY_PRIORITY0_LIST); _r_menu_checkitem (hsubmenu_region, IDM_MODIFIEDFILECACHE_CHK, 0, MF_BYCOMMAND, (mask & REDUCT_MODIFIED_FILE_CACHE) == REDUCT_MODIFIED_FILE_CACHE); _r_menu_checkitem (hsubmenu_region, IDM_REGISTRYCACHE_CHK, 0, MF_BYCOMMAND, (mask & REDUCT_REGISTRY_CACHE) == REDUCT_REGISTRY_CACHE); _r_menu_checkitem (hsubmenu_region, IDM_COMBINEMEMORYLISTS_CHK, 0, MF_BYCOMMAND, (mask & REDUCT_COMBINE_MEMORY_LISTS) == REDUCT_COMBINE_MEMORY_LISTS); if (!_r_sys_iselevated ()) { _r_menu_enableitem (hsubmenu_region, IDM_WORKINGSET_CHK, FALSE, FALSE); _r_menu_enableitem (hsubmenu_region, IDM_SYSTEMFILECACHE_CHK, FALSE, FALSE); _r_menu_enableitem (hsubmenu_region, IDM_MODIFIEDFILECACHE_CHK, FALSE, FALSE); _r_menu_enableitem (hsubmenu_region, IDM_MODIFIEDLIST_CHK, FALSE, FALSE); _r_menu_enableitem (hsubmenu_region, IDM_STANDBYLIST_CHK, FALSE, FALSE); _r_menu_enableitem (hsubmenu_region, IDM_STANDBYLISTPRIORITY0_CHK, FALSE, FALSE); _r_menu_enableitem (hsubmenu_region, IDM_REGISTRYCACHE_CHK, FALSE, FALSE); _r_menu_enableitem (hsubmenu_region, IDM_COMBINEMEMORYLISTS_CHK, FALSE, FALSE); } // Flush registry cache (win8.1+) if (_r_sys_isosversionlower (WINDOWS_8_1)) _r_menu_enableitem (hsubmenu_region, IDM_REGISTRYCACHE_CHK, FALSE, FALSE); // Combine memory lists (win10+) if (_r_sys_isosversionlower (WINDOWS_10)) _r_menu_enableitem (hsubmenu_region, IDM_COMBINEMEMORYLISTS_CHK, FALSE, FALSE); } // configure submenu #2 if (hsubmenu_limit) { is_enabled = _r_config_getboolean (L"AutoreductEnable", FALSE, NULL); _app_generate_menu ( hsubmenu_limit, IDX_TRAY_POPUP_1, limits_arr, RTL_NUMBER_OF (limits_arr), L"%" TEXT (PR_ULONG) L"%%", _app_getlimitvalue (), is_enabled ); } // configure submenu #3 if (hsubmenu_interval) { is_enabled = _r_config_getboolean (L"AutoreductIntervalEnable", FALSE, NULL); _app_generate_menu ( hsubmenu_interval, IDX_TRAY_POPUP_2, intervals_arr, RTL_NUMBER_OF (intervals_arr), L"%" TEXT (PR_LONG64) L" min.", _app_getintervalvalue (), is_enabled ); } _r_menu_popup (hsubmenu, hwnd, NULL, TRUE); DestroyMenu (hmenu); break; } } break; } case WM_COMMAND: { INT ctrl_id = LOWORD (wparam); INT notify_code = HIWORD (wparam); if (notify_code == 0 && ctrl_id >= IDX_LANGUAGE && ctrl_id <= IDX_LANGUAGE + (INT)(INT_PTR)_r_locale_getcount () + 1) { HMENU hmenu; HMENU hsubmenu; hmenu = GetMenu (hwnd); if (hmenu) { hsubmenu = GetSubMenu (GetSubMenu (hmenu, LANG_SUBMENU), LANG_MENU); if (hsubmenu) _r_locale_apply (hsubmenu, ctrl_id, IDX_LANGUAGE); } return FALSE; } else if ((ctrl_id >= IDX_TRAY_POPUP_1 && ctrl_id <= IDX_TRAY_POPUP_1 + (INT)RTL_NUMBER_OF (limits_arr) - 1)) { ULONG_PTR idx; idx = (ULONG_PTR)ctrl_id - IDX_TRAY_POPUP_1; _r_config_setboolean (L"AutoreductEnable", TRUE, NULL); _r_config_setlong (L"AutoreductValue", limits_arr[idx], NULL); return FALSE; } else if ((ctrl_id >= IDX_TRAY_POPUP_2 && ctrl_id <= IDX_TRAY_POPUP_2 + (INT)RTL_NUMBER_OF (intervals_arr) - 1)) { ULONG_PTR idx; idx = (ULONG_PTR)ctrl_id - IDX_TRAY_POPUP_2; _r_config_setboolean (L"AutoreductIntervalEnable", TRUE, NULL); _r_config_setlong (L"AutoreductIntervalValue", intervals_arr[idx], NULL); return FALSE; } switch (ctrl_id) { case IDM_ALWAYSONTOP_CHK: { BOOLEAN new_val; new_val = !_r_config_getboolean (L"AlwaysOnTop", FALSE, NULL); _r_menu_checkitem (GetMenu (hwnd), ctrl_id, 0, MF_BYCOMMAND, new_val); _r_config_setboolean (L"AlwaysOnTop", new_val, NULL); _r_wnd_top (hwnd, new_val); break; } case IDM_STARTMINIMIZED_CHK: { BOOLEAN new_val; new_val = !_r_config_getboolean (L"IsStartMinimized", FALSE, NULL); _r_menu_checkitem (GetMenu (hwnd), ctrl_id, 0, MF_BYCOMMAND, new_val); _r_config_setboolean (L"IsStartMinimized", new_val, NULL); break; } case IDM_REDUCTCONFIRMATION_CHK: { BOOLEAN new_val; new_val = !_r_config_getboolean (L"IsShowReductConfirmation", TRUE, NULL); _r_menu_checkitem (GetMenu (hwnd), ctrl_id, 0, MF_BYCOMMAND, new_val); _r_config_setboolean (L"IsShowReductConfirmation", new_val, NULL); break; } case IDM_LOADONSTARTUP_CHK: { BOOLEAN new_val; new_val = !_r_autorun_isenabled (); _r_autorun_enable (hwnd, new_val); _r_menu_checkitem (GetMenu (hwnd), ctrl_id, 0, MF_BYCOMMAND, _r_autorun_isenabled ()); break; } case IDM_USEDARKTHEME: { BOOLEAN is_enabled = !_r_theme_isenabled (); _r_theme_enable (hwnd, is_enabled); _r_menu_checkitem (GetMenu (hwnd), ctrl_id, 0, MF_BYCOMMAND, is_enabled); break; } case IDM_SKIPUACWARNING_CHK: { BOOLEAN new_val; new_val = !_r_skipuac_isenabled (); _r_skipuac_enable (hwnd, new_val); _r_menu_checkitem (GetMenu (hwnd), ctrl_id, 0, MF_BYCOMMAND, _r_skipuac_isenabled ()); break; } case IDM_CHECKUPDATES_CHK: { BOOLEAN new_val; new_val = !_r_update_isenabled (FALSE); _r_menu_checkitem (GetMenu (hwnd), ctrl_id, 0, MF_BYCOMMAND, new_val); _r_update_enable (new_val); break; } case IDM_WORKINGSET_CHK: case IDM_SYSTEMFILECACHE_CHK: case IDM_MODIFIEDFILECACHE_CHK: case IDM_MODIFIEDLIST_CHK: case IDM_STANDBYLIST_CHK: case IDM_STANDBYLISTPRIORITY0_CHK: case IDM_REGISTRYCACHE_CHK: case IDM_COMBINEMEMORYLISTS_CHK: { ULONG new_mask = 0; ULONG mask; mask = _r_config_getulong (L"ReductMask2", REDUCT_MASK_DEFAULT, NULL); switch (ctrl_id) { case IDM_WORKINGSET_CHK: { new_mask = REDUCT_WORKING_SET; break; } case IDM_SYSTEMFILECACHE_CHK: { new_mask = REDUCT_SYSTEM_FILE_CACHE; break; } case IDM_MODIFIEDFILECACHE_CHK: { new_mask = REDUCT_MODIFIED_FILE_CACHE; break; } case IDM_MODIFIEDLIST_CHK: { new_mask = REDUCT_MODIFIED_LIST; break; } case IDM_STANDBYLIST_CHK: { new_mask = REDUCT_STANDBY_LIST; break; } case IDM_STANDBYLISTPRIORITY0_CHK: { new_mask = REDUCT_STANDBY_PRIORITY0_LIST; break; } case IDM_REGISTRYCACHE_CHK: { new_mask = REDUCT_REGISTRY_CACHE; break; } case IDM_COMBINEMEMORYLISTS_CHK: { new_mask = REDUCT_COMBINE_MEMORY_LISTS; break; } default: { return FALSE; } } if ((ctrl_id == IDM_STANDBYLIST_CHK && !(mask & REDUCT_STANDBY_LIST)) || (ctrl_id == IDM_MODIFIEDLIST_CHK && !(mask & REDUCT_MODIFIED_LIST))) { if (!_r_show_confirmmessage (hwnd, _r_locale_getstring (IDS_QUESTION_WARNING), NULL, L"IsShowWarningConfirmation", FALSE)) return FALSE; } _r_config_setulong (L"ReductMask2", (mask & new_mask) != 0 ? (mask & ~new_mask) : (mask | new_mask), NULL); break; } case IDM_CLEAN_WORKINGSET: case IDM_CLEAN_SYSTEMFILECACHE: case IDM_CLEAN_MODIFIEDFILECACHE: case IDM_CLEAN_MODIFIEDLIST: case IDM_CLEAN_STANDBYLIST: case IDM_CLEAN_STANDBYLISTPRIORITY0: case IDM_CLEAN_REGISTRYCACHE: case IDM_CLEAN_COMBINEMEMORYLISTS: { ULONG mask; switch (ctrl_id) { case IDM_CLEAN_WORKINGSET: { mask = REDUCT_WORKING_SET; break; } case IDM_CLEAN_SYSTEMFILECACHE: { mask = REDUCT_SYSTEM_FILE_CACHE; break; } case IDM_CLEAN_MODIFIEDFILECACHE: { mask = REDUCT_MODIFIED_FILE_CACHE; break; } case IDM_CLEAN_MODIFIEDLIST: { mask = REDUCT_MODIFIED_LIST; break; } case IDM_CLEAN_STANDBYLIST: { mask = REDUCT_STANDBY_LIST; break; } case IDM_CLEAN_STANDBYLISTPRIORITY0: { mask = REDUCT_STANDBY_PRIORITY0_LIST; break; } case IDM_CLEAN_REGISTRYCACHE: { mask = REDUCT_REGISTRY_CACHE; break; } case IDM_CLEAN_COMBINEMEMORYLISTS: { mask = REDUCT_COMBINE_MEMORY_LISTS; break; } default: { return FALSE; } } _app_memoryclean (hwnd, SOURCE_CMDLINE, mask); break; } case IDM_TRAY_DISABLE_1: { BOOLEAN new_val; new_val = !_r_config_getboolean (L"AutoreductEnable", FALSE, NULL); _r_config_setboolean (L"AutoreductEnable", new_val, NULL); break; } case IDM_TRAY_DISABLE_2: { BOOLEAN new_val; new_val = !_r_config_getboolean (L"AutoreductIntervalEnable", FALSE, NULL); _r_config_setboolean (L"AutoreductIntervalEnable", new_val, NULL); break; } case IDM_SETTINGS: case IDM_TRAY_SETTINGS: { _r_settings_createwindow (hwnd, &SettingsProc, 0); break; } case IDM_EXIT: case IDM_TRAY_EXIT: { DestroyWindow (hwnd); break; } case IDCANCEL: // process Esc key case IDM_TRAY_SHOW: { _r_wnd_toggle (hwnd, FALSE); break; } case IDOK: // process Enter key case IDC_CLEAN: case IDM_TRAY_CLEAN: { if (_r_sys_iselevated ()) { _app_memoryclean (hwnd, SOURCE_MANUAL, 0); } else { if (_r_app_runasadmin ()) { DestroyWindow (hwnd); } else { _r_show_message (hwnd, MB_OK | MB_ICONSTOP, NULL, _r_locale_getstring (IDS_STATUS_NOPRIVILEGES)); } } break; } case IDM_WEBSITE: case IDM_TRAY_WEBSITE: { _r_shell_opendefault (_r_app_getwebsite_url ()); break; } case IDM_CHECKUPDATES: { _r_update_check (hwnd); break; } case IDM_ABOUT: case IDM_TRAY_ABOUT: { _r_show_aboutmessage (hwnd); break; } } break; } } return FALSE; } BOOLEAN NTAPI _app_parseargs ( _In_ R_CMDLINE_INFO_CLASS type ) { PR_STRING clean_args; ULONG mask = 0; switch (type) { case CmdlineClean: { _r_sys_getopt (_r_sys_getcommandline (), L"clean", &clean_args); if (clean_args) { if (_r_str_isequal2 (&clean_args->sr, L"full", TRUE)) mask = REDUCT_MASK_ALL; _r_obj_dereference (clean_args); } if (!mask) mask = REDUCT_MASK_DEFAULT; _app_initialize (NULL); _app_memoryclean (NULL, SOURCE_CMDLINE, mask); return TRUE; } case CmdlineHelp: { _r_show_message ( NULL, MB_OK | MB_ICONINFORMATION | MB_TOPMOST, L"Available options for memreduct.exe:", L"-clean - clear default memory regions\r\n" \ L"-clean:full - clear all memory regions" ); return TRUE; } } return FALSE; } INT APIENTRY wWinMain ( _In_ HINSTANCE hinst, _In_opt_ HINSTANCE prev_hinst, _In_ LPWSTR cmdline, _In_ INT show_cmd ) { HWND hwnd; if (!_r_app_initialize (&_app_parseargs)) return ERROR_APP_INIT_FAILURE; hwnd = _r_app_createwindow (hinst, MAKEINTRESOURCEW (IDD_MAIN), MAKEINTRESOURCEW (IDI_MAIN), &DlgProc); if (!hwnd) return ERROR_APP_INIT_FAILURE; return _r_wnd_message_callback (hwnd, MAKEINTRESOURCEW (IDA_MAIN)); } ================================================ FILE: src/main.h ================================================ // Mem Reduct // Copyright (c) 2011-2025 Henry++ #pragma once #include "routine.h" #include "resource.h" #include "app.h" DEFINE_GUID (GUID_TrayIcon, 0xAE9053F0, 0x8D59, 0x4803, 0x9A, 0xBB, 0x74, 0xAF, 0xE6, 0x6B, 0x5F, 0xD2); #define TITLE_WORKINGSET L"Working set" #define TITLE_SYSTEMFILECACHE L"System file cache" #define TITLE_STANDBYLISTPRIORITY0 L"Standby list (without priority)" #define TITLE_STANDBYLIST L"Standby list*" #define TITLE_MODIFIEDLIST L"Modified page list*" #define TITLE_MODIFIEDFILECACHE L"Modified file cache" #define TITLE_REGISTRYCACHE L"Registry cache (win8.1+)" #define TITLE_COMBINEMEMORYLISTS L"Combine memory lists (win10+)" #define TIMER 1000 #define UID 1337 #define LANG_SUBMENU 1 #define LANG_MENU 4 #define TRAY_SUBMENU_1 4 #define TRAY_SUBMENU_2 5 #define TRAY_SUBMENU_3 6 #define DEFAULT_AUTOREDUCT_VAL 90 #define DEFAULT_AUTOREDUCTINTERVAL_VAL 30 #define DEFAULT_DANGER_LEVEL 90 #define DEFAULT_WARNING_LEVEL 70 // colors #define TRAY_COLOR_BLACK RGB(0x00, 0x00, 0x00) #define TRAY_COLOR_WHITE RGB(0xFF, 0xFF, 0xFF) #define TRAY_COLOR_TEXT RGB(0xFF, 0xFF, 0xFF) #define TRAY_COLOR_BG RGB(0x00, 0x80, 0x40) #define TRAY_COLOR_WARNING RGB(0xFF, 0x80, 0x40) #define TRAY_COLOR_DANGER RGB(0xEC, 0x1C, 0x24) // memory cleaning mask #define REDUCT_WORKING_SET 0x01 #define REDUCT_SYSTEM_FILE_CACHE 0x02 #define REDUCT_STANDBY_PRIORITY0_LIST 0x04 #define REDUCT_STANDBY_LIST 0x08 #define REDUCT_MODIFIED_LIST 0x10 #define REDUCT_COMBINE_MEMORY_LISTS 0x20 #define REDUCT_REGISTRY_CACHE 0x40 #define REDUCT_MODIFIED_FILE_CACHE 0x80 // memory cleaning values #define REDUCT_MASK_ALL (REDUCT_WORKING_SET | \ REDUCT_SYSTEM_FILE_CACHE | \ REDUCT_STANDBY_PRIORITY0_LIST | \ REDUCT_STANDBY_LIST | \ REDUCT_MODIFIED_LIST | \ REDUCT_COMBINE_MEMORY_LISTS | \ REDUCT_REGISTRY_CACHE | \ REDUCT_MODIFIED_FILE_CACHE) #define REDUCT_MASK_DEFAULT (REDUCT_WORKING_SET | REDUCT_SYSTEM_FILE_CACHE | REDUCT_STANDBY_PRIORITY0_LIST | REDUCT_REGISTRY_CACHE | REDUCT_COMBINE_MEMORY_LISTS | REDUCT_MODIFIED_FILE_CACHE) #define REDUCT_MASK_FREEZES (REDUCT_STANDBY_LIST | REDUCT_MODIFIED_LIST) typedef struct _STATIC_DATA { HDC hdc; HDC hdc_mask; HBITMAP hbitmap; HBITMAP hbitmap_mask; HFONT hfont; RECT icon_size; ULONG ms_prev; } STATIC_DATA, *PSTATIC_DATA; typedef enum _CLEANUP_SOURCE_ENUM { SOURCE_AUTO, SOURCE_MANUAL, SOURCE_HOTKEY, SOURCE_CMDLINE } CLEANUP_SOURCE_ENUM, *PCLEANUP_SOURCE_ENUM; ================================================ FILE: src/res/manifest.xml ================================================ true PerMonitorV2, PerMonitor true true true UTF-8 SegmentHeap ================================================ FILE: src/resource.h ================================================ #ifndef __RESOURCE_H__ #define __RESOURCE_H__ #ifndef IDC_STATIC #define IDC_STATIC (-1) #endif // Acceleration #define IDA_MAIN 1 // Menu Id #define IDM_MAIN 100 #define IDM_TRAY 101 // Dialogs #define IDD_MAIN 100 #define IDD_SETTINGS_GENERAL 101 #define IDD_SETTINGS_MEMORY 102 #define IDD_SETTINGS_APPEARANCE 103 #define IDD_SETTINGS_TRAY 104 #define IDD_SETTINGS_ADVANCED 105 // Main Dlg #define IDC_LISTVIEW 102 #define IDC_CLEAN 103 #define IDC_TITLE_1 104 #define IDC_TITLE_2 105 #define IDC_TITLE_3 106 #define IDC_TITLE_4 107 #define IDC_TITLE_5 108 #define IDC_TITLE_6 109 #define IDC_TITLE_7 110 #define IDC_TITLE_8 111 #define IDC_TITLE_9 112 #define IDC_ALWAYSONTOP_CHK 113 #define IDC_LOADONSTARTUP_CHK 114 #define IDC_STARTMINIMIZED_CHK 115 #define IDC_SKIPUACWARNING_CHK 116 #define IDC_REDUCTCONFIRMATION_CHK 117 #define IDC_CHECKUPDATES_CHK 118 #define IDC_LANGUAGE_HINT 119 #define IDC_LANGUAGE 120 #define IDC_REGIONS 121 #define IDC_AUTOREDUCTENABLE_CHK 122 #define IDC_AUTOREDUCTVALUE_CTRL 123 #define IDC_AUTOREDUCTVALUE 124 #define IDC_AUTOREDUCTINTERVALENABLE_CHK 125 #define IDC_AUTOREDUCTINTERVALVALUE_CTRL 126 #define IDC_AUTOREDUCTINTERVALVALUE 127 #define IDC_HOTKEY_CLEAN_CHK 128 #define IDC_HOTKEY_CLEAN 129 #define IDC_TRAYUSETRANSPARENCY_CHK 130 #define IDC_TRAYSHOWBORDER_CHK 131 #define IDC_TRAYROUNDCORNERS_CHK 132 #define IDC_TRAYCHANGEBG_CHK 133 #define IDC_TRAYUSEANTIALIASING_CHK 134 #define IDC_FONT_HINT 135 #define IDC_FONT 136 #define IDC_COLORS 137 #define IDC_TRAYLEVELWARNING_HINT 138 #define IDC_TRAYLEVELWARNING_CTRL 139 #define IDC_TRAYLEVELWARNING 140 #define IDC_TRAYLEVELDANGER_HINT 141 #define IDC_TRAYLEVELDANGER_CTRL 142 #define IDC_TRAYLEVELDANGER 143 #define IDC_TRAYACTIONSC_HINT 144 #define IDC_TRAYACTIONSC 145 #define IDC_TRAYACTIONMC_HINT 146 #define IDC_TRAYACTIONMC 147 #define IDC_NOTIFICATIONSOUND_CHK 148 #define IDC_SHOW_CLEAN_RESULT_CHK 149 #define IDC_ALLOWSTANDBYLISTCLEANUP_CHK 150 #define IDC_LOGRESULTS_CHK 151 // Main Menu #define IDM_SETTINGS 152 #define IDM_EXIT 153 #define IDM_ALWAYSONTOP_CHK 154 #define IDM_LOADONSTARTUP_CHK 155 #define IDM_USEDARKTHEME 156 #define IDM_STARTMINIMIZED_CHK 157 #define IDM_REDUCTCONFIRMATION_CHK 158 #define IDM_SKIPUACWARNING_CHK 159 #define IDM_CHECKUPDATES_CHK 160 #define IDM_WEBSITE 161 #define IDM_CHECKUPDATES 162 #define IDM_ABOUT 163 // Tray Menu #define IDM_TRAY_SHOW 164 #define IDM_TRAY_CLEAN 165 #define IDM_TRAY_DISABLE_1 166 #define IDM_TRAY_DISABLE_2 167 #define IDM_TRAY_SETTINGS 168 #define IDM_TRAY_WEBSITE 169 #define IDM_TRAY_ABOUT 170 #define IDM_TRAY_EXIT 171 #define IDM_WORKINGSET_CHK 172 #define IDM_SYSTEMFILECACHE_CHK 173 #define IDM_MODIFIEDFILECACHE_CHK 174 #define IDM_MODIFIEDLIST_CHK 175 #define IDM_STANDBYLIST_CHK 176 #define IDM_STANDBYLISTPRIORITY0_CHK 177 #define IDM_REGISTRYCACHE_CHK 178 #define IDM_COMBINEMEMORYLISTS_CHK 179 #define IDM_CLEAN_WORKINGSET 180 #define IDM_CLEAN_SYSTEMFILECACHE 181 #define IDM_CLEAN_MODIFIEDFILECACHE 182 #define IDM_CLEAN_MODIFIEDLIST 183 #define IDM_CLEAN_STANDBYLIST 184 #define IDM_CLEAN_STANDBYLISTPRIORITY0 185 #define IDM_CLEAN_REGISTRYCACHE 186 #define IDM_CLEAN_COMBINEMEMORYLISTS 187 #define IDX_LANGUAGE 1000 #define IDX_TRAY_POPUP_1 2000 #define IDX_TRAY_POPUP_2 3000 // Strings #define IDS_UPDATE_NO 1 #define IDS_UPDATE_YES 2 #define IDS_FILE 3 #define IDS_SETTINGS 4 #define IDS_EXIT 5 #define IDS_LANGUAGE 6 #define IDS_HELP 7 #define IDS_WEBSITE 8 #define IDS_CHECKUPDATES 9 #define IDS_ABOUT 10 #define IDS_DONATE 11 #define IDS_TRAY_SHOW 12 #define IDS_TRAY_DISABLE 13 #define IDS_TRAY_POPUP_1 14 #define IDS_TRAY_POPUP_2 15 #define IDS_TRAY_POPUP_3 16 #define IDS_CLEAN 17 #define IDS_GROUP_1 18 #define IDS_GROUP_2 19 #define IDS_GROUP_3 20 #define IDS_ITEM_1 21 #define IDS_ITEM_2 22 #define IDS_ITEM_3 23 #define IDS_SETTINGS_GENERAL 24 #define IDS_SETTINGS_MEMORY 25 #define IDS_SETTINGS_APPEARANCE 26 #define IDS_SETTINGS_TRAY 27 #define IDS_CLOSE 28 #define IDS_TITLE_1 29 #define IDS_TITLE_2 30 #define IDS_TITLE_3 31 #define IDS_TITLE_4 32 #define IDS_TITLE_5 33 #define IDS_TITLE_6 34 #define IDS_TITLE_7 35 #define IDS_TITLE_8 36 #define IDS_TITLE_9 37 #define IDS_ALWAYSONTOP_CHK 38 #define IDS_LOADONSTARTUP_CHK 39 #define IDS_STARTMINIMIZED_CHK 40 #define IDS_REDUCTCONFIRMATION_CHK 41 #define IDS_SKIPUACWARNING_CHK 42 #define IDS_CHECKUPDATES_CHK 43 #define IDS_LANGUAGE_HINT 44 #define IDS_WORKINGSET_CHK 45 #define IDS_SYSTEMWORKINGSET_CHK 46 #define IDS_STANDBYLISTPRIORITY0_CHK 47 #define IDS_STANDBYLIST_CHK 48 #define IDS_MODIFIEDLIST_CHK 49 #define IDS_COMBINEMEMORYLISTS_CHK 50 #define IDS_AUTOREDUCTENABLE_CHK 51 #define IDS_AUTOREDUCTINTERVALENABLE_CHK 52 #define IDS_HOTKEY_CLEAN_CHK 53 #define IDS_TRAYUSETRANSPARENCY_CHK 54 #define IDS_TRAYSHOWBORDER_CHK 55 #define IDS_TRAYROUNDCORNERS_CHK 56 #define IDS_TRAYCHANGEBG_CHK 57 #define IDS_TRAYUSEANTIALIASING_CHK 58 #define IDS_FONT_HINT 59 #define IDS_COLOR_TEXT_HINT 60 #define IDS_COLOR_BACKGROUND_HINT 61 #define IDS_COLOR_WARNING_HINT 62 #define IDS_COLOR_DANGER_HINT 63 #define IDS_TRAYLEVELWARNING_HINT 64 #define IDS_TRAYLEVELDANGER_HINT 65 #define IDS_TRAYACTIONSC_HINT 66 #define IDS_TRAYACTIONMC_HINT 67 #define IDS_TRAY_ACTION_1 68 #define IDS_TRAY_ACTION_2 69 #define IDS_TRAY_ACTION_3 70 #define IDS_SHOW_CLEAN_RESULT_CHK 71 #define IDS_QUESTION 72 #define IDS_QUESTION_WARNING 73 #define IDS_QUESTION_FLAG_CHK 74 #define IDS_STATUS_CLEANED 75 #define IDS_STATUS_NOPRIVILEGES 76 #define IDS_UPDATE_DOWNLOAD 77 #define IDS_UPDATE_DONE 78 #define IDS_UPDATE_ERROR 79 #define IDS_UPDATE_INIT 80 #define IDS_UPDATE_INSTALL 81 #define IDS_RESET 82 #define IDS_QUESTION_RESET 83 #define IDS_NOTIFICATIONSOUND_CHK 84 #define IDS_TITLE_ADVANCED 85 #define IDS_VIEW 86 #define IDS_USEDARKTHEME 87 #define IDS_UPDATE_SPEED 88 // Icons #define IDI_MAIN 100 #endif // __RESOURCE_H__ ================================================ FILE: src/resource.rc ================================================ #include #include #include #include "resource.h" #include "rconfig.h" #include "app.h" LANGUAGE LANG_ENGLISH, SUBLANG_DEFAULT // // Accelerator resources // IDA_MAIN ACCELERATORS { VK_F1, IDM_ABOUT, VIRTKEY VK_F2, IDM_SETTINGS, VIRTKEY VK_F4, IDM_TRAY_SHOW, ALT, VIRTKEY } // // Menu resources // IDM_MAIN MENU { POPUP " " { MENUITEM " ", IDM_SETTINGS MENUITEM SEPARATOR MENUITEM " ", IDM_EXIT } POPUP " " { MENUITEM " ", IDM_ALWAYSONTOP_CHK MENUITEM " ", IDM_USEDARKTHEME MENUITEM " ", IDM_REDUCTCONFIRMATION_CHK MENUITEM SEPARATOR POPUP " " { MENUITEM " ", IDX_LANGUAGE } } POPUP " " { MENUITEM " ", IDM_LOADONSTARTUP_CHK MENUITEM " ", IDM_STARTMINIMIZED_CHK MENUITEM " ", IDM_SKIPUACWARNING_CHK MENUITEM " ", IDM_CHECKUPDATES_CHK } POPUP " " { MENUITEM " ", IDM_WEBSITE MENUITEM " ", IDM_CHECKUPDATES MENUITEM " ", IDM_ABOUT } } IDM_TRAY MENU { POPUP "" { MENUITEM " ", IDM_TRAY_SHOW MENUITEM SEPARATOR MENUITEM " ", IDM_TRAY_CLEAN MENUITEM SEPARATOR POPUP " " { MENUITEM " ", IDM_WORKINGSET_CHK MENUITEM " ", IDM_SYSTEMFILECACHE_CHK MENUITEM " ", IDM_MODIFIEDFILECACHE_CHK MENUITEM " ", IDM_STANDBYLISTPRIORITY0_CHK MENUITEM " ", IDM_STANDBYLIST_CHK MENUITEM " ", IDM_MODIFIEDLIST_CHK MENUITEM " ", IDM_REGISTRYCACHE_CHK MENUITEM " ", IDM_COMBINEMEMORYLISTS_CHK } POPUP " " { MENUITEM " ", IDM_TRAY_DISABLE_1 MENUITEM SEPARATOR } POPUP " " { MENUITEM " ", IDM_TRAY_DISABLE_2 MENUITEM SEPARATOR } MENUITEM SEPARATOR MENUITEM " ", IDM_TRAY_SETTINGS MENUITEM SEPARATOR MENUITEM " ", IDM_TRAY_WEBSITE MENUITEM " ", IDM_TRAY_ABOUT MENUITEM SEPARATOR MENUITEM " ", IDM_TRAY_EXIT } } // // Dialog resources // IDD_MAIN DIALOGEX 0, 0, 224, 214 STYLE WS_POPUPWINDOW | WS_MINIMIZEBOX | WS_CAPTION | DS_SHELLFONT | DS_MODALFRAME | NOT WS_VISIBLE CAPTION APP_NAME MENU IDM_MAIN FONT 8, "Ms Shell Dlg" { CONTROL "", IDC_LISTVIEW, WC_LISTVIEW, NOT WS_BORDER | LVS_SHOWSELALWAYS | LVS_REPORT | LVS_NOCOLUMNHEADER, 8, 8, 208, 174 PUSHBUTTON "", IDC_CLEAN, 8, 192, 208, 14, BS_SPLITBUTTON | BS_CENTER | BS_VCENTER } IDD_SETTINGS_GENERAL DIALOGEX 0, 0, 260, 168 STYLE WS_CHILD | WS_SYSMENU | WS_TABSTOP | WS_GROUP | DS_SHELLFONT | DS_CONTROL EXSTYLE WS_EX_CONTROLPARENT FONT 8, "Ms Shell Dlg" { GROUPBOX "", IDC_TITLE_1, 0, 0, 260, 90 AUTOCHECKBOX "", IDC_ALWAYSONTOP_CHK, 8, 12, 244, 10 AUTOCHECKBOX "", IDC_LOADONSTARTUP_CHK, 8, 24, 244, 10 AUTOCHECKBOX "", IDC_STARTMINIMIZED_CHK, 8, 36, 244, 10 AUTOCHECKBOX "", IDC_REDUCTCONFIRMATION_CHK, 8, 48, 244, 10 AUTOCHECKBOX "", IDC_SKIPUACWARNING_CHK, 8, 60, 244, 10 AUTOCHECKBOX "", IDC_CHECKUPDATES_CHK, 8, 72, 244, 10 GROUPBOX "", IDC_TITLE_2, 0, 92, 260, 32 LTEXT "", IDC_LANGUAGE_HINT, 8, 104, 112, 12, SS_CENTERIMAGE COMBOBOX IDC_LANGUAGE, 128, 104, 124, 30, CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP } IDD_SETTINGS_MEMORY DIALOGEX 0, 0, 260, 168 STYLE WS_CHILD | WS_SYSMENU | WS_TABSTOP | WS_GROUP | DS_SHELLFONT | DS_CONTROL EXSTYLE WS_EX_CONTROLPARENT FONT 8, "Ms Shell Dlg" { GROUPBOX "", IDC_TITLE_3, 0, 0, 260, 90 CONTROL "", IDC_REGIONS, WC_LISTVIEW, LVS_REPORT | LVS_NOCOLUMNHEADER | LVS_SHAREIMAGELISTS | WS_BORDER | WS_TABSTOP | WS_VSCROLL, 8, 12, 244, 70 GROUPBOX "", IDC_TITLE_4, 0, 90, 260, 46 AUTOCHECKBOX "", IDC_AUTOREDUCTENABLE_CHK, 8, 102, 194, 12, BS_MULTILINE EDITTEXT IDC_AUTOREDUCTVALUE_CTRL, 208, 102, 44, 12, ES_AUTOHSCROLL | ES_NUMBER | ES_MULTILINE CONTROL "", IDC_AUTOREDUCTVALUE, UPDOWN_CLASS, UDS_ALIGNRIGHT | UDS_ARROWKEYS | UDS_AUTOBUDDY | UDS_HOTTRACK | UDS_SETBUDDYINT | UDS_WRAP, 0, 0, 0, 0 AUTOCHECKBOX "", IDC_AUTOREDUCTINTERVALENABLE_CHK, 8, 116, 194, 12, BS_MULTILINE EDITTEXT IDC_AUTOREDUCTINTERVALVALUE_CTRL, 208, 116, 44, 12, ES_AUTOHSCROLL | ES_NUMBER | ES_MULTILINE CONTROL "", IDC_AUTOREDUCTINTERVALVALUE, UPDOWN_CLASS, UDS_ALIGNRIGHT | UDS_ARROWKEYS | UDS_AUTOBUDDY | UDS_HOTTRACK | UDS_SETBUDDYINT | UDS_WRAP, 0, 0, 0, 0 GROUPBOX "", IDC_TITLE_5, 0, 136, 260, 32 AUTOCHECKBOX "", IDC_HOTKEY_CLEAN_CHK, 8, 150, 144, 12, BS_MULTILINE CONTROL "", IDC_HOTKEY_CLEAN, HOTKEY_CLASS, WS_TABSTOP, 158, 148, 94, 12 } IDD_SETTINGS_APPEARANCE DIALOGEX 0, 0, 260, 168 STYLE WS_CHILD | WS_SYSMENU | WS_TABSTOP | WS_GROUP | DS_SHELLFONT | DS_CONTROL EXSTYLE WS_EX_CONTROLPARENT FONT 8, "Ms Shell Dlg" { GROUPBOX "", IDC_TITLE_1, 0, 0, 260, 78 AUTOCHECKBOX "", IDC_TRAYUSETRANSPARENCY_CHK, 8, 12, 244, 10 AUTOCHECKBOX "", IDC_TRAYSHOWBORDER_CHK, 8, 24, 244, 10 AUTOCHECKBOX "", IDC_TRAYROUNDCORNERS_CHK, 8, 36, 244, 10 AUTOCHECKBOX "", IDC_TRAYCHANGEBG_CHK, 8, 48, 244, 10 AUTOCHECKBOX "", IDC_TRAYUSEANTIALIASING_CHK, 8, 60, 244, 10 GROUPBOX "", IDC_TITLE_6, 0, 80, 260, 88 LTEXT "", IDC_FONT_HINT, 8, 92, 112, 12, SS_CENTERIMAGE PUSHBUTTON "", IDC_FONT, 128, 92, 124, 12 CONTROL "", IDC_COLORS, WC_LISTVIEW, LVS_REPORT | LVS_NOCOLUMNHEADER | LVS_SHAREIMAGELISTS | WS_BORDER | WS_TABSTOP | WS_VSCROLL, 8, 110, 244, 50 } IDD_SETTINGS_TRAY DIALOGEX 0, 0, 260, 168 STYLE WS_CHILD | WS_SYSMENU | WS_TABSTOP | WS_GROUP | DS_SHELLFONT | DS_CONTROL EXSTYLE WS_EX_CONTROLPARENT FONT 8, "Ms Shell Dlg" { GROUPBOX "", IDC_TITLE_7, 0, 0, 260, 46 LTEXT "", IDC_TRAYLEVELWARNING_HINT, 8, 12, 194, 12, SS_CENTERIMAGE EDITTEXT IDC_TRAYLEVELWARNING_CTRL, 208, 12, 44, 12, ES_AUTOHSCROLL | ES_NUMBER | ES_MULTILINE CONTROL "", IDC_TRAYLEVELWARNING, UPDOWN_CLASS, UDS_ALIGNRIGHT | UDS_ARROWKEYS | UDS_AUTOBUDDY | UDS_HOTTRACK | UDS_SETBUDDYINT | UDS_WRAP, 0, 0, 0, 0 LTEXT "", IDC_TRAYLEVELDANGER_HINT, 8, 26, 194, 12, SS_CENTERIMAGE EDITTEXT IDC_TRAYLEVELDANGER_CTRL, 208, 26, 44, 12, ES_AUTOHSCROLL | ES_NUMBER | ES_MULTILINE CONTROL "", IDC_TRAYLEVELDANGER, UPDOWN_CLASS, UDS_ALIGNRIGHT | UDS_ARROWKEYS | UDS_AUTOBUDDY | UDS_HOTTRACK | UDS_SETBUDDYINT | UDS_WRAP, 0, 0, 0, 0 GROUPBOX "", IDC_TITLE_8, 0, 48, 260, 48 LTEXT "", IDC_TRAYACTIONSC_HINT, 8, 60, 114, 12, SS_CENTERIMAGE COMBOBOX IDC_TRAYACTIONSC, 128, 60, 124, 12, CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP LTEXT "", IDC_TRAYACTIONMC_HINT, 8, 74, 114, 12, SS_CENTERIMAGE COMBOBOX IDC_TRAYACTIONMC, 128, 74, 124, 12, CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP GROUPBOX "", IDC_TITLE_9, 0, 98, 260, 40 AUTOCHECKBOX "", IDC_SHOW_CLEAN_RESULT_CHK, 8, 110, 244, 12, BS_MULTILINE AUTOCHECKBOX "", IDC_NOTIFICATIONSOUND_CHK, 8, 122, 244, 12, BS_MULTILINE } IDD_SETTINGS_ADVANCED DIALOGEX 0, 0, 260, 168 STYLE WS_CHILD | WS_SYSMENU | WS_TABSTOP | WS_GROUP | DS_SHELLFONT | DS_CONTROL EXSTYLE WS_EX_CONTROLPARENT FONT 8, "Ms Shell Dlg" { GROUPBOX "", IDC_TITLE_1, 0, 0, 260, 46 AUTOCHECKBOX "", IDC_ALLOWSTANDBYLISTCLEANUP_CHK, 8, 12, 244, 10 AUTOCHECKBOX "", IDC_LOGRESULTS_CHK, 8, 24, 244, 10 } // // String resources // STRINGTABLE { IDS_UPDATE_NO "No updates available." IDS_UPDATE_YES "Update available, download and install them?" IDS_UPDATE_DOWNLOAD "Downloading update..." IDS_UPDATE_DONE "Downloading update finished." IDS_UPDATE_ERROR "Update server connection error." IDS_UPDATE_INIT "Checking for new releases..." IDS_UPDATE_INSTALL "Update available, do you want to install them?" IDS_FILE "File" IDS_VIEW "View" IDS_SETTINGS "Settings" IDS_EXIT "Exit" IDS_LANGUAGE "Language" IDS_HELP "Help" IDS_WEBSITE "Website" IDS_CHECKUPDATES "Check for updates" IDS_ABOUT "About" IDS_DONATE "Give thanks!" IDS_TRAY_SHOW "Show/Hide" IDS_TRAY_DISABLE "Disable" IDS_TRAY_POPUP_1 "Clean areas" IDS_TRAY_POPUP_2 "Clean when above" IDS_TRAY_POPUP_3 "Clean every" IDS_CLEAN "Clean memory" IDS_GROUP_1 "Physical memory" IDS_GROUP_2 "Pagefile" IDS_GROUP_3 "System working set" IDS_ITEM_1 "Usage" IDS_ITEM_2 "Available" IDS_ITEM_3 "Total available" IDS_SETTINGS_GENERAL "General" IDS_SETTINGS_MEMORY "Memory cleaning" IDS_SETTINGS_APPEARANCE "Appearance" IDS_SETTINGS_TRAY "Tray icon" IDS_RESET "Reset" IDS_CLOSE "Close" IDS_TITLE_1 "General configuration" IDS_TITLE_2 "Language" IDS_TITLE_3 "Memory regions to be cleaned" IDS_TITLE_4 "Memory management" IDS_TITLE_5 "Hotkeys (global)" IDS_TITLE_6 "Style" IDS_TITLE_7 "Color indication" IDS_TITLE_8 "Mouse control" IDS_TITLE_9 "Balloon tips" IDS_ALWAYSONTOP_CHK "Always on top" IDS_LOADONSTARTUP_CHK "Load on system startup" IDS_STARTMINIMIZED_CHK "Start minimized" IDS_REDUCTCONFIRMATION_CHK "Confirm memory cleaning start" IDS_SKIPUACWARNING_CHK "Skip ""User Account Control"" prompt warning" IDS_CHECKUPDATES_CHK "Periodically check for updates (recommended)" IDS_LANGUAGE_HINT "Select language:" IDS_AUTOREDUCTENABLE_CHK "Clean when above: (%)" IDS_AUTOREDUCTINTERVALENABLE_CHK "Clean every: (min.)" IDS_HOTKEY_CLEAN_CHK "Clean memory:" IDS_TRAYUSETRANSPARENCY_CHK "Use transparent background" IDS_TRAYSHOWBORDER_CHK "Show border" IDS_TRAYROUNDCORNERS_CHK "Round corners" IDS_TRAYCHANGEBG_CHK "Change background color (instead text and border)" IDS_TRAYUSEANTIALIASING_CHK "Use antialiasing" IDS_FONT_HINT "Font:" IDS_COLOR_TEXT_HINT "Text color" IDS_COLOR_BACKGROUND_HINT "Background color" IDS_COLOR_WARNING_HINT """Warning level"" color" IDS_COLOR_DANGER_HINT """Danger level"" color" IDS_TRAYLEVELWARNING_HINT """Warning level"" started at: (%)" IDS_TRAYLEVELDANGER_HINT """Danger level"" started at: (%)" IDS_TRAYACTIONSC_HINT "Single click:" IDS_TRAYACTIONMC_HINT "Middle click:" IDS_TRAY_ACTION_1 "Show/Hide" IDS_TRAY_ACTION_2 "Clean memory" IDS_TRAY_ACTION_3 "Open task manager" IDS_SHOW_CLEAN_RESULT_CHK "Show memory cleaning results" IDS_QUESTION "Are you sure you want to clean the memory?" IDS_QUESTION_WARNING "Switching-on ""Standby list"" and ""Modified page list"" may freeze your computer for almost a minute or so, are you sure to enable this option?" IDS_QUESTION_RESET "Are you really sure you want to reset all application settings?" IDS_QUESTION_FLAG_CHK "Do not ask again" IDS_STATUS_CLEANED "Memory was released with %s result." IDS_STATUS_NOPRIVILEGES "Required administrator privileges, please run program as administrator!" IDS_NOTIFICATIONSOUND_CHK "Enable notifications sound" IDS_TITLE_ADVANCED "Advanced" IDS_USEDARKTHEME "Use dark theme" IDS_UPDATE_SPEED "Speed" } // // Icon resources // IDI_MAIN ICON "res\\100.ico" // // Manifest resource // 1 RT_MANIFEST "res\\manifest.xml" // // Version Information resources // 1 VERSIONINFO FILEVERSION APP_VERSION_RES PRODUCTVERSION APP_VERSION_RES FILEOS VOS__WINDOWS32 FILETYPE VFT_APP FILESUBTYPE VFT2_UNKNOWN FILEFLAGSMASK 0x00000000 FILEFLAGS VS_FF_PATCHED | VS_FF_PRERELEASE { BLOCK "StringFileInfo" { BLOCK "040904E4" { VALUE "Comments", APP_COMMENT VALUE "CompanyName", APP_AUTHOR VALUE "FileDescription", APP_NAME VALUE "FileVersion", APP_VERSION VALUE "InternalName", APP_NAME_SHORT VALUE "LegalCopyright", APP_COPYRIGHT VALUE "OriginalFilename", APP_NAME_SHORT ".exe" VALUE "ProductName", APP_NAME VALUE "ProductVersion", APP_VERSION } } BLOCK "VarFileInfo" { VALUE "Translation", 0x0409, 1252 } }