资源简介
C\C++ 内存整理工具源码 C\C++ 内存整理工具源码
代码片段和文件信息
#include
#include
#include
#include
#include
#include “resource.h“
#pragma comment (lib “psapi“)
#pragma comment (linker “/subsystem:windows“)
/*==================宏定义====================*/
#define IDM_CLEAN_EMPTY 1
#define IDM_CLEAN_ONESEC 2
#define IDM_CLEAN_TENSEC 3
#define IDM_CLEAN_ONEMIN 4
#define IDM_CLEAN_MEMORY 5
#define IDM_ABOUT_SET 6
#define IDM_ABOUT_ABOUT 7
#define UM_SHOWNDF WM_USER + 1
/*=================全局变量====================*/
WCHAR *szClassName = TEXT(“生日特别版“);
NOTIFYICONDATA g_nfd;
HMENU g_hMenu;
HMENU g_hClean;
HMENU g_hAbout;
HANDLE g_hDrawThread;
HANDLE g_hAboutThread;
UINT g_checkMenu_1 = MF_UNCHECKED;
UINT g_checkMenu_2 = MF_UNCHECKED;
UINT g_checkMenu_3 = MF_UNCHECKED;
UINT g_checkMenu_4 = MF_UNCHECKED;
/*=================函数定义====================*/
LRESULT CALLBACK WndProc (HWND hWnd UINT msg WPARAM wParam LPARAM lParam);
LRESULT CALLBACK AboutProc (HWND hWnd UINT msg WPARAM wParam LPARAM lParam);
DWORD WINAPI DrawThread (LPVOID lpParamter);
DWORD WINAPI AboutThread (LPVOID lpParamter);
INT CDECL FormatPrint (WCHAR *szBuffer INT iBufSize WCHAR *szFormat ...);
VOID InitWndClass (WNDCLASS *wnd HINSTANCE hInstance);
VOID InitNFD (HWND hwnd NOTIFYICONDATA *g_nfd);
VOID InitMenu (HMENU *hmenu HMENU *hClean HMENU *hAbout);
VOID InitPos(HWND hwnd);
VOID MenuEvent(HWND hwnd UINT Index UINT *pcheckMenu UINT ID UINT iclock);
VOID StartRun(void);
VOID StartRunMenu(void);
BOOL CheckMenu(void);
BOOL EmptyMemory(VOID);
INT WINAPI WinMain (HINSTANCE hInstance HINSTANCE hPrevInstance LPSTR lpCmdLine int iShowCmd)
{
WNDCLASS wndclass;
MSG msg;
HWND hWnd;
wndclass.cbClsExtra = 0;
wndclass.cbWndExtra = 0;
wndclass.hbrBackground = (HBRUSH)GetStockobject(WHITE_BRUSH);
wndclass.hCursor = LoadCursor(NULL IDC_ARROW);
wndclass.hIcon = LoadIcon(hInstance MAKEINTRESOURCE(IDI_ICON));
wndclass.lpfnWndProc = WndProc;
wndclass.lpszClassName = szClassName;
wndclass.lpszMenuName = szClassName;
wndclass.style = CS_HREDRAW | CS_VREDRAW;
wndclass.hInstance = hInstance;
RegisterClass (&wndclass);
InitMenu(&g_hMenu &g_hClean &g_hAbout);
hWnd = CreateWindow ( szClassName
szClassName
WS_OVERLAPPEDWINDOW & ~WS_MAXIMIZEBOX & ~WS_THICKframe
CW_USEDEFAULT
CW_USEDEFAULT
300
200
NULL
g_hMenu
hInstance
NULL);
ShowWindow (hWnd SW_SHOWDEFAULT);
while ( GetMessage(&msg NULL 0 0) )
{
TranslateMessage (&msg);
DispatchMessage (&msg);
}
return 0;
}
LRESULT CALLBACK WndProc (HWND hWnd UINT msg WPARAM wParam LPARAM lParam)
{
switch (msg)
{
case WM_CREATE:
HDC hdc hdcCompatible;
hdcCompatible = CreateCompatibleDC (hdc);
hdc = GetDC(hWnd);
InitNFD(hWnd &g_nfd);
InitPos(hWnd);
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2012-09-13 21:37 Memory\
目录 0 2012-09-19 21:15 Memory\Memory\
文件 11414528 2012-09-19 21:15 Memory\Memory.ncb
文件 888 2012-09-13 19:48 Memory\Memory.sln
文件 40960 2012-09-19 21:15 Memory\Memory.suo
文件 99678 2012-09-11 21:41 Memory\Memory\Butterfly-Red.ico
目录 0 2012-09-13 19:48 Memory\Memory\Debug\
文件 8064 2012-09-13 19:48 Memory\Memory\Debug\BuildLog.htm
文件 663 2012-09-11 21:41 Memory\Memory\Debug\Memory.exe.em
文件 728 2012-09-11 21:41 Memory\Memory\Debug\Memory.exe.em
文件 621 2012-09-13 19:48 Memory\Memory\Debug\Memory.exe.intermediate.manifest
文件 62915 2012-09-13 19:48 Memory\Memory\Debug\Memory.obj
文件 99892 2012-09-11 21:41 Memory\Memory\Debug\Memory.res
文件 67 2012-09-13 19:48 Memory\Memory\Debug\mt.dep
文件 355328 2012-09-13 19:48 Memory\Memory\Debug\vc90.idb
文件 126976 2012-09-13 19:48 Memory\Memory\Debug\vc90.pdb
文件 133316 2012-09-11 21:41 Memory\Memory\Memory.aps
文件 14999 2012-09-19 21:15 Memory\Memory\Memory.cpp
文件 1688 2012-09-11 21:41 Memory\Memory\Memory.rc
文件 4126 2012-09-11 21:41 Memory\Memory\Memory.vcproj
文件 1411 2012-09-19 21:15 Memory\Memory\Memory.vcproj.AILL-PC.Administrator.user
目录 0 2012-09-19 21:15 Memory\Memory\Release\
文件 8040 2012-09-19 21:15 Memory\Memory\Release\BuildLog.htm
文件 616 2012-09-19 21:15 Memory\Memory\Release\Memory.exe.intermediate.manifest
文件 89668 2012-09-19 21:15 Memory\Memory\Release\Memory.obj
文件 99892 2012-09-11 21:59 Memory\Memory\Release\Memory.res
文件 67 2012-09-19 21:15 Memory\Memory\Release\mt.dep
文件 240640 2012-09-19 21:15 Memory\Memory\Release\vc90.idb
文件 118784 2012-09-19 21:15 Memory\Memory\Release\vc90.pdb
文件 451 2012-09-11 21:41 Memory\Memory\resource.h
目录 0 2012-09-19 21:15 Memory\Release\
............此处省略2个文件信息
评论
共有 条评论