RegFlush.cpp
资源名称:RegFlush.zip [点击查看]
上传用户:gl1234
上传日期:2022-08-02
资源大小:156k
文件大小:1k
源码类别:
Windows CE
开发平台:
C/C++
- // RegFlush.cpp : Defines the entry point for the application.
- //
- #include "stdafx.h"
- #include "resource.h"
- //----------------------------------------------------------------------------
- //
- // Main
- //
- //----------------------------------------------------------------------------
- int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int nCmdShow)
- {
- int nResponse;
- long Result1;
- long Result2;
- MessageBeep (MB_ICONQUESTION);
- nResponse = MessageBox (GetForegroundWindow (), TEXT ("Save Current Registry?"), TEXT ("Registry Save"), MB_YESNO | MB_ICONQUESTION | MB_DEFBUTTON2 | MB_SETFOREGROUND);
- if (nResponse == IDYES)
- {
- DEBUGMSG (1, (TEXT ("RegFlush: Calling RegFlushKeyn")));
- Result1 = RegFlushKey (HKEY_LOCAL_MACHINE);
- Result2 = RegFlushKey (HKEY_CURRENT_USER);
- // Result1 = RegCloseKey (HKEY_LOCAL_MACHINE);
- // Result2 = RegCloseKey (HKEY_CURRENT_USER);
- DEBUGMSG (1, (TEXT ("RegFlush: RegFlushKey returned %dn"), Result1));
- RETAILMSG (1, (TEXT ("RegFlush: RegFlushKey returned %dn"), Result2));
- }
- else
- {
- DEBUGMSG (1, (TEXT ("RegFlush: Cancelledn")));
- }
- return 0;
- }