Last active
December 17, 2015 23:39
-
-
Save dantmnf/5690408 to your computer and use it in GitHub Desktop.
a small program to show the time spent from Windows startup
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define UNICODE | |
#include <windows.h> | |
#ifdef __GNUC__ | |
#define wWinMain WinMain //MinGW does not support wWinMain | |
#define WINMAIN_CMDLINE_TYPE LPSTR | |
#else | |
#define WINMAIN_CMDLINE_TYPE LPWSTR | |
#endif | |
int __stdcall wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, WINMAIN_CMDLINE_TYPE lpCmdLine, int nCmdShow) | |
{ | |
DWORD time = GetTickCount() / 1000; | |
WCHAR *buf = malloc(128); | |
wsprintf(buf, L"本次开机共用了%d秒。", time); | |
MessageBox(NULL, buf, L"Startup Time Monitor", MB_ICONINFORMATION); | |
free(buf); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment