Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move checkIsRunning after tryElevate to ensure that we have permission to create GLOBAL event #149

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 13 additions & 9 deletions src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -331,13 +331,6 @@ static int uiOnDialogShow(Ihandle *ih, int state) {
SendMessage(hWnd, WM_SETICON, ICON_BIG, (LPARAM)icon);
SendMessage(hWnd, WM_SETICON, ICON_SMALL, (LPARAM)icon);

exit = checkIsRunning();
if (exit) {
MessageBox(hWnd, (LPCSTR)"Theres' already an instance of clumsy running.",
(LPCSTR)"Aborting", MB_OK);
return IUP_CLOSE;
}

#ifdef _WIN32
exit = check32RunningOn64(hWnd);
if (exit) {
Expand All @@ -347,14 +340,25 @@ static int uiOnDialogShow(Ihandle *ih, int state) {

// try elevate and decides whether to exit
exit = tryElevate(hWnd, parameterized);
if (exit) {
return IUP_CLOSE;
}

if (!exit && parameterized) {
if (parameterized) {
setFromParameter(filterText, "VALUE", "filter");
LOG("is parameterized, start filtering upon execution.");
uiStartCb(filterButton);
}


exit = checkIsRunning();
if (exit) {
MessageBox(hWnd, (LPCSTR)"Theres' already an instance of clumsy running.",
(LPCSTR)"Aborting", MB_OK);
return IUP_CLOSE;
}

return exit ? IUP_CLOSE : IUP_DEFAULT;
return IUP_DEFAULT;
}

static int uiStartCb(Ihandle *ih) {
Expand Down