Skip to content

Commit

Permalink
Version 1.3
Browse files Browse the repository at this point in the history
  • Loading branch information
CSaratakij committed Aug 21, 2018
2 parents 4ff49c7 + 2f074f9 commit 3822262
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
1 change: 1 addition & 0 deletions Keybind.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,5 @@
[ Mod + Shift + 9 ] - Move window to workspace 9
[ Mod + Shift + 0 ] - Move window to workspace 10
[ Mod + F12 ] - Toggle Explorer Shell's Taskbar
[ Mod + Shift + E ] - Open propmt to quit MyWinTiles
```
14 changes: 14 additions & 0 deletions MyWinTiles/MyWinTiles.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -425,6 +425,15 @@ int APIENTRY wWinMain(_In_ HINSTANCE hInstance,
break;
}

case HOTKEY_QUIT_APP:
{
UINT dialogStyle = MB_YESNO | MB_ICONWARNING | MB_DEFBUTTON2 | MB_APPLMODAL | MB_SETFOREGROUND | MB_TOPMOST;
int result = MessageBox(NULL, L"Do you want to quit MyWinTiles?", L"Warnning", dialogStyle);
if (result == IDYES)
DestroyWindow(msg.hwnd);
break;
}

default:
break;
}
Expand Down Expand Up @@ -521,6 +530,7 @@ BOOL InitInstance(HINSTANCE hInstance, int nCmdShow)
RegisterHotKey(hWnd, HOTKEY_SWAPWINDOW_PREVIOUS, MOD | MOD_SHIFT | MOD_NOREPEAT, 0x48);

RegisterHotKey(hWnd, HOTKEY_TOGGLE_EXPLORER_TASKBAR, MOD | MOD_NOREPEAT, VK_F12);
RegisterHotKey(hWnd, HOTKEY_QUIT_APP, MOD | MOD_SHIFT | MOD_NOREPEAT, 0x45);

for (UINT i = 0; i < MAX_WINDOW_PER_WORKSPACE; ++i) {
windowOfWorkSpace1[i] = NULL;
Expand All @@ -542,6 +552,8 @@ BOOL InitInstance(HINSTANCE hInstance, int nCmdShow)
}

EnumWindows(&InitWorkSpaces_Callback, NULL);
SendCurrentWorkspaceThroughIPC(hWnd);

return TRUE;
}

Expand Down Expand Up @@ -599,6 +611,7 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
UnregisterHotKey(hWnd, HOTKEY_SWAPWINDOW_PREVIOUS);

UnregisterHotKey(hWnd, HOTKEY_TOGGLE_EXPLORER_TASKBAR);
UnregisterHotKey(hWnd, HOTKEY_QUIT_APP);

PostQuitMessage(0);
break;
Expand Down Expand Up @@ -1109,6 +1122,7 @@ void ToggleWindow(HWND hWnd)

if (IsWindowVisible(hWnd))
ShowWindow(hWnd, SW_HIDE);

else
ShowWindow(hWnd, SW_SHOW);
}
Expand Down
1 change: 1 addition & 0 deletions MyWinTiles/MyWinTiles.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
#define HOTKEY_MOVEWINDOW_TO_WORKSPACE_10 5010

#define HOTKEY_TOGGLE_EXPLORER_TASKBAR 8001
#define HOTKEY_QUIT_APP 8002

#define OVERLAP_WINDOW_MODE 0x02

Expand Down

0 comments on commit 3822262

Please sign in to comment.