aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/main.cpp
diff options
context:
space:
mode:
authorEgor Tensin <Egor.Tensin@gmail.com>2016-09-16 04:34:39 +0300
committerEgor Tensin <Egor.Tensin@gmail.com>2016-09-16 04:34:39 +0300
commitc61e0019288a32da5f86c4c3d17038b082aba9c0 (patch)
treedb790a5a5157c9311dd2fe85446f0e4027d2061a /src/main.cpp
parentrefactoring (diff)
downloadprivilege-check-c61e0019288a32da5f86c4c3d17038b082aba9c0.tar.gz
privilege-check-c61e0019288a32da5f86c4c3d17038b082aba9c0.zip
move more strings to resources
Diffstat (limited to '')
-rw-r--r--src/main.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/main.cpp b/src/main.cpp
index 2045ef6..c2ffb21 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -1,6 +1,7 @@
#include "error.hpp"
#include "os.hpp"
#include "process.hpp"
+#include "resource.hpp"
#include "resource_ids.h"
#include "sid.hpp"
#include "token.hpp"
@@ -108,6 +109,14 @@ BOOL on_init_dialog(HWND wnd, HWND, LPARAM)
return TRUE;
}
+void report_already_elevated(HWND wnd)
+{
+ MessageBoxW(wnd,
+ resource::load_string(IDS_ALREADY_ELEVATED).c_str(),
+ resource::load_string(IDS_ELEVATION_CAPTION).c_str(),
+ MB_OK);
+}
+
void on_button_elevate_click(HWND wnd)
{
bool as_admin = false;
@@ -124,7 +133,7 @@ void on_button_elevate_click(HWND wnd)
if (as_admin)
{
- MessageBoxW(wnd, L"Already elevated!", L"Elevation", MB_OK);
+ report_already_elevated(wnd);
return;
}