aboutsummaryrefslogtreecommitdiff
path: root/c/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'c/main.cpp')
-rw-r--r--c/main.cpp19
1 files changed, 8 insertions, 11 deletions
diff --git a/c/main.cpp b/c/main.cpp
index 237cc22..449863b 100644
--- a/c/main.cpp
+++ b/c/main.cpp
@@ -382,7 +382,7 @@ LRESULT CALLBACK WndProc(const HWND hWnd, const UINT uMsg, const WPARAM wParam,
return 0;
}
-void HandleMainMenu(const HWND hWnd, WORD command)
+void HandleMainMenu(const HWND hWnd, const WORD command)
{
switch (command) {
case IDM_FILE_EXIT:
@@ -438,7 +438,7 @@ void HandleMainMenu(const HWND hWnd, WORD command)
}
}
-void HandleContextMenu(const HWND, WORD command)
+void HandleContextMenu(const HWND, const WORD command)
{
int cNotFound = 0;
@@ -498,12 +498,11 @@ void HandleContextMenu(const HWND, WORD command)
void WaitFor(const char* mod, const char* pred)
{
- static atom_t aThread;
- static bool bActive;
- static int iTimer;
static WcharPtr activePred;
+ static UINT_PTR iTimer;
+ static atom_t aThread;
- if (bActive) {
+ if (activePred) {
wchar_t msg[256] = {0};
Swprintf(msg, L"Another task (%s) is active. "
L"Do you want to cancel the existing task and start a new one?",
@@ -511,7 +510,7 @@ void WaitFor(const char* mod, const char* pred)
if (EBMessageBox(msg, L"Error", MB_YESNO|MB_ICONWARNING) != IDYES)
return;
KillTimer(nullptr, iTimer);
- bActive = false;
+ activePred = nullptr;
g_elv->Update();
}
@@ -530,17 +529,15 @@ void WaitFor(const char* mod, const char* pred)
} else {
KillTimer(nullptr, iTimer);
i = 0;
- bActive = false;
+ activePred = nullptr;
g_elv->Update();
}
};
Plx(mod,"thread_create",pred,&aThread);
SendMessage(g_hWndStatus, SB_SETTEXT, MAKEWPARAM(1,0), reinterpret_cast<LPARAM>(L"."));
- if (Prefer(iTimer = SetTimer(nullptr, -1, 500, proc))) {
+ if (Prefer(iTimer = SetTimer(nullptr, -1, 500, proc)))
activePred = WcharPtr::FromNarrow(pred);
- bActive = true;
- }
}
INT_PTR CALLBACK AboutDlgProc(const HWND hWnd, const UINT uMsg, const WPARAM wParam, const LPARAM)