Skip to content

Commit 6469584

Browse files
committed
Initial commit: MemoryCleaner
0 parents  commit 6469584

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

73 files changed

+10546
-0
lines changed

.gitignore

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# Qt build files
2+
build/
3+
*.o
4+
*.obj
5+
*.exe
6+
*.a
7+
*.lib
8+
*.dll
9+
*.so
10+
*.dylib
11+
12+
# Qt Creator
13+
*.pro.user
14+
*.autosave
15+
16+
# Qt MOC
17+
moc_*.cpp
18+
qrc_*.cpp
19+
ui_*.h
20+
21+
# Qt translations
22+
*.qm
23+
24+
# CMake
25+
CMakeLists.txt.user
26+
CMakeCache.txt
27+
CMakeFiles/
28+
cmake_install.cmake
29+
Makefile
30+
31+
# IDE
32+
.vscode/
33+
.idea/
34+
*.swp
35+
*.swo
36+
*~
37+
38+
# OS
39+
.DS_Store
40+
Thumbs.db
41+
desktop.ini
42+
43+
# Temporary files
44+
*.tmp
45+
*.log
46+
*.stackdump
47+
48+
# Debug files
49+
*.pdb
50+
*.ilk
51+
52+
# MinGW
53+
*.stackdump

LICENSE

Lines changed: 674 additions & 0 deletions
Large diffs are not rendered by default.

MemoryCleaner.manifest

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
2+
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
3+
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
4+
<security>
5+
<requestedPrivileges>
6+
<requestedExecutionLevel level="requireAdministrator" uiAccess="false"/>
7+
</requestedPrivileges>
8+
</security>
9+
</trustInfo>
10+
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
11+
<application>
12+
<supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}"/>
13+
<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"/>
14+
<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}"/>
15+
<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}"/>
16+
<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}"/>
17+
</application>
18+
</compatibility>
19+
</assembly>

MemoryCleaner.pro

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
QT += core gui widgets
2+
3+
CONFIG += c++17
4+
CONFIG += static
5+
CONFIG += strip
6+
TARGET = MemoryCleaner
7+
TEMPLATE = app
8+
9+
QMAKE_LFLAGS_RELEASE += -Wl,-s
10+
QMAKE_CFLAGS_RELEASE -= -O0
11+
QMAKE_CFLAGS_RELEASE += -O2
12+
QMAKE_CXXFLAGS_RELEASE -= -O0
13+
QMAKE_CXXFLAGS_RELEASE += -O2
14+
15+
QMAKE_CXXFLAGS_RELEASE += -ffunction-sections -fdata-sections
16+
QMAKE_LFLAGS_RELEASE += -Wl,--gc-sections
17+
18+
win32 {
19+
QMAKE_LFLAGS_RELEASE += -Wl,--enable-stdcall-fixup
20+
DEFINES += WIN32_LEAN_AND_MEAN
21+
}
22+
23+
SOURCES += \
24+
src/aboutdialog.cpp \
25+
src/main.cpp \
26+
src/mainwindow.cpp \
27+
src/memorycleaner.cpp
28+
29+
HEADERS += \
30+
include/aboutdialog.h \
31+
include/mainwindow.h \
32+
include/memorycleaner.h
33+
34+
INCLUDEPATH += include
35+
36+
FORMS += \
37+
ui/aboutdialog.ui \
38+
ui/mainwindow.ui
39+
40+
win32 {
41+
LIBS += -lpsapi -ladvapi32 -lkernel32
42+
DEFINES += _WIN32_WINNT=0x0601
43+
QMAKE_CXXFLAGS += -std=c++11
44+
}
45+
46+
TRANSLATIONS += translations/MemoryCleaner_zh_CN.ts \
47+
translations/MemoryCleaner_ar_AE.ts \
48+
translations/MemoryCleaner_de_DE.ts \
49+
translations/MemoryCleaner_en_US.ts \
50+
translations/MemoryCleaner_es_ES.ts \
51+
translations/MemoryCleaner_fr_FR.ts \
52+
translations/MemoryCleaner_it_IT.ts \
53+
translations/MemoryCleaner_ja_JP.ts \
54+
translations/MemoryCleaner_ko_KR.ts \
55+
translations/MemoryCleaner_mn_CN.ts \
56+
translations/MemoryCleaner_ru_RU.ts \
57+
translations/MemoryCleaner_zh_TW.ts \
58+
translations/MemoryCleaner_ug_UG.ts
59+
60+
61+
CONFIG += lrelease
62+
CONFIG += embed_translations
63+
64+
# Default rules for deployment.
65+
qnx: target.path = /tmp/$${TARGET}/bin
66+
else: unix:!android: target.path = /opt/$${TARGET}/bin
67+
!isEmpty(target.path): INSTALLS += target
68+
69+
RESOURCES += \
70+
resources/res.qrc
71+
72+
RC_FILE = resources/logo.rc
73+
RC_ICON = resources/app.ico
74+
75+
DISTFILES += \
76+
resources/logo.rc

README.md

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
2+
[![License: GPL v3](https://img.shields.io/badge/License-GPL%20v3-orange.svg?style=flat)](LICENSE)
3+
[![PayPal](https://img.shields.io/badge/Donate-PayPal-blue.svg?logo=paypal)](https://paypal.me/TheUserWW)
4+
[![GitHub all releases](https://img.shields.io/github/downloads/TheUserWW/MemoryCleaner/total?logo=github&label=Downloads)](https://github.com/TheUserWW/MemoryCleaner/releases)
5+
6+
# MemoryCleaner
7+
8+
## This powerful software allows you Clean your memory
9+
<img width="272" height="399" alt="image" src="https://github.com/user-attachments/assets/29a3d13e-1634-4bbe-8e38-8e37ff809979" />
10+
11+
12+
Memory cleaning tool is a practical utility for optimizing the memory usage of Windows systems. It can clean various types of memory areas, including working sets, standby lists, etc., to help improve system performance.
13+
14+
**Other Download Link (Softpedia):** https://www.softpedia.com/get/Tweak/Memory-Tweak/theuserww-MemoryCleaner.shtml
15+
## Features
16+
- Clean multiple memory areas:
17+
- Working Set
18+
- System Working Set
19+
- Standby List
20+
- Low Priority Standby List
21+
- Modified Page List
22+
- Combined Page List
23+
- Real-time memory monitoring
24+
- Automatic scheduled cleaning function
25+
- System tray icon showing memory usage rate
26+
- Detailed cleaning records
27+
28+
## System Requirements
29+
- Windows 8/10/11 (64-bit)
30+
31+
32+
## Usage Instructions
33+
### Main Interface Operations
34+
1. Select the types of memory areas that need to be cleared
35+
2. Click the "Immediate Cleanup" button to perform manual cleanup
36+
3. Check the "Automatic Cleanup" option and set the interval time to enable the automatic cleanup function
37+
38+
### System Tray Operations
39+
- Right-click on the tray icon to display the function menu
40+
- Double-click on the tray icon to show/hide the main window
41+
- The menu contains:
42+
- Clean Options Submenu
43+
- Immediate Clean Function
44+
- About and Author Information
45+
- Show Main Window/Exit Options
46+
47+
## Option Explanation
48+
- **Working Set**: Clear the working set memory of the current process
49+
- **System WS**: Clear the working set memory of all processes (requires administrator privileges)
50+
- **Standby List**: Clear the standard standby memory list
51+
- **Low Priority Standby List**: Clear the low priority standby memory
52+
- **Modified Page List**: Clear the list of modified pages
53+
- **Combined Page List**: Clear the combined page list
54+
55+
## Notes
56+
- Certain cleaning functions require administrator privileges to function properly.
57+
- Frequent memory cleaning may affect system performance.
58+
- Cleaning the system working set may cause temporary stalling of some applications.
59+
60+
## Technical Support
61+
If you have any questions or suggestions, please send them to the email address wcx1615471430@outlook.com
62+
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio Version 17
4+
VisualStudioVersion = 17.14.36414.22 d17.14
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MemoryCleaner", "MemoryCleaner\MemoryCleaner.vcxproj", "{74EF283B-C493-406E-A977-B0D9B4A907BC}"
7+
EndProject
8+
Global
9+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
10+
Debug|ARM64 = Debug|ARM64
11+
Debug|x64 = Debug|x64
12+
Debug|x86 = Debug|x86
13+
Release|ARM64 = Release|ARM64
14+
Release|x64 = Release|x64
15+
Release|x86 = Release|x86
16+
EndGlobalSection
17+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
18+
{74EF283B-C493-406E-A977-B0D9B4A907BC}.Debug|ARM64.ActiveCfg = Debug|ARM64
19+
{74EF283B-C493-406E-A977-B0D9B4A907BC}.Debug|ARM64.Build.0 = Debug|ARM64
20+
{74EF283B-C493-406E-A977-B0D9B4A907BC}.Debug|ARM64.Deploy.0 = Debug|ARM64
21+
{74EF283B-C493-406E-A977-B0D9B4A907BC}.Debug|x64.ActiveCfg = Debug|x64
22+
{74EF283B-C493-406E-A977-B0D9B4A907BC}.Debug|x64.Build.0 = Debug|x64
23+
{74EF283B-C493-406E-A977-B0D9B4A907BC}.Debug|x64.Deploy.0 = Debug|x64
24+
{74EF283B-C493-406E-A977-B0D9B4A907BC}.Debug|x86.ActiveCfg = Debug|Win32
25+
{74EF283B-C493-406E-A977-B0D9B4A907BC}.Debug|x86.Build.0 = Debug|Win32
26+
{74EF283B-C493-406E-A977-B0D9B4A907BC}.Debug|x86.Deploy.0 = Debug|Win32
27+
{74EF283B-C493-406E-A977-B0D9B4A907BC}.Release|ARM64.ActiveCfg = Release|ARM64
28+
{74EF283B-C493-406E-A977-B0D9B4A907BC}.Release|ARM64.Build.0 = Release|ARM64
29+
{74EF283B-C493-406E-A977-B0D9B4A907BC}.Release|ARM64.Deploy.0 = Release|ARM64
30+
{74EF283B-C493-406E-A977-B0D9B4A907BC}.Release|x64.ActiveCfg = Release|x64
31+
{74EF283B-C493-406E-A977-B0D9B4A907BC}.Release|x64.Build.0 = Release|x64
32+
{74EF283B-C493-406E-A977-B0D9B4A907BC}.Release|x64.Deploy.0 = Release|x64
33+
{74EF283B-C493-406E-A977-B0D9B4A907BC}.Release|x86.ActiveCfg = Release|Win32
34+
{74EF283B-C493-406E-A977-B0D9B4A907BC}.Release|x86.Build.0 = Release|Win32
35+
{74EF283B-C493-406E-A977-B0D9B4A907BC}.Release|x86.Deploy.0 = Release|Win32
36+
EndGlobalSection
37+
GlobalSection(SolutionProperties) = preSolution
38+
HideSolutionNode = FALSE
39+
EndGlobalSection
40+
GlobalSection(ExtensibilityGlobals) = postSolution
41+
SolutionGuid = {3B286E30-56EB-4694-9FB2-305A95FD29A2}
42+
EndGlobalSection
43+
EndGlobal
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
#include "pch.h"
2+
#include "AboutDialog.h"
3+
#include "AboutDialog.g.cpp"
4+
#include <microsoft.ui.xaml.window.h>
5+
// 移除以下重复包含的头文件,因为它们已经在 pch.h 中包含
6+
// #include <winrt/Microsoft.UI.Interop.h>
7+
// #include <winrt/Microsoft.UI.Windowing.h>
8+
9+
// 添加Windows API头文件
10+
#include <windowsx.h>
11+
#include <winuser.h>
12+
13+
using namespace winrt;
14+
using namespace Microsoft::UI::Xaml;
15+
using namespace Microsoft::UI::Windowing;
16+
17+
namespace winrt::MemoryCleaner::implementation
18+
{
19+
AboutDialog::AboutDialog()
20+
{
21+
InitializeComponent();
22+
versionTextBlock().Text(L"v 1.2.0");
23+
24+
// 设置自定义标题栏
25+
auto titleBar = AboutDialogTitleBar();
26+
this->SetTitleBar(titleBar);
27+
this->ExtendsContentIntoTitleBar(true);
28+
29+
// 使用IWindowNative接口和AppWindow设置窗口大小
30+
auto windowNative{ this->try_as<::IWindowNative>() };
31+
if (windowNative)
32+
{
33+
HWND hWnd{ nullptr };
34+
windowNative->get_WindowHandle(&hWnd);
35+
36+
if (hWnd)
37+
{
38+
// 获取并存储AppWindow
39+
appWindow = AppWindow::GetFromWindowId(
40+
Microsoft::UI::GetWindowIdFromWindow(hWnd));
41+
42+
if (appWindow)
43+
{
44+
appWindow.Resize({ 640, 480 });
45+
46+
// 使用Windows API禁止调整窗口大小
47+
// 获取当前窗口样式
48+
LONG_PTR style = GetWindowLongPtr(hWnd, GWL_STYLE);
49+
// 移除WS_THICKFRAME样式(允许调整大小的边框)
50+
style &= ~WS_THICKFRAME;
51+
// 移除WS_MAXIMIZEBOX样式(禁用最大化按钮)
52+
style &= ~WS_MAXIMIZEBOX;
53+
// 应用新的窗口样式
54+
SetWindowLongPtr(hWnd, GWL_STYLE, style);
55+
56+
// 刷新窗口
57+
SetWindowPos(hWnd, nullptr, 0, 0, 0, 0,
58+
SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER | SWP_FRAMECHANGED);
59+
}
60+
}
61+
}
62+
}
63+
64+
void AboutDialog::CloseButtonClick(Windows::Foundation::IInspectable const& sender, Microsoft::UI::Xaml::RoutedEventArgs const& e)
65+
{
66+
Close();
67+
}
68+
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#pragma once
2+
3+
#include "AboutDialog.g.h"
4+
// 移除以下重复包含的头文件,因为它们已经在 pch.h 中包含
5+
// #include <winrt/Microsoft.UI.Windowing.h>
6+
// #include <winrt/Microsoft.UI.Interop.h>
7+
8+
namespace winrt::MemoryCleaner::implementation
9+
{
10+
struct AboutDialog : AboutDialogT<AboutDialog>
11+
{
12+
AboutDialog();
13+
void CloseButtonClick(Windows::Foundation::IInspectable const& sender, Microsoft::UI::Xaml::RoutedEventArgs const& e);
14+
void Activate();
15+
winrt::Microsoft::UI::Windowing::AppWindow appWindow{ nullptr };
16+
};
17+
}
18+
19+
namespace winrt::MemoryCleaner::factory_implementation
20+
{
21+
struct AboutDialog : AboutDialogT<AboutDialog, implementation::AboutDialog>
22+
{
23+
};
24+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
2+
namespace MemoryCleaner
3+
{
4+
[default_interface]
5+
runtimeclass AboutDialog : Microsoft.UI.Xaml.Window
6+
{
7+
AboutDialog();
8+
}
9+
}

0 commit comments

Comments
 (0)