Skip to content

Commit

Permalink
#2
Browse files Browse the repository at this point in the history
- Added a menueitem to check if close to try is active.
  • Loading branch information
Dakoon committed Apr 7, 2017
1 parent 6d17310 commit 09b6d76
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
7 changes: 6 additions & 1 deletion WhatsappTray/WhatsappTray.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ static HMODULE _hLib;
static HWND _hwndHook;
static HWND _hwndItems[MAXTRAYITEMS];
static HWND _hwndForMenu;
static bool closeToTray;

int FindInTray(HWND hwnd) {
for (int i = 0; i < MAXTRAYITEMS; i++) {
Expand Down Expand Up @@ -152,6 +153,10 @@ void ExecuteMenu() {
MessageBox(NULL, L"Error creating menu.", L"WhatsappTray", MB_OK | MB_ICONERROR);
return;
}
if (closeToTray)
{
AppendMenu(hMenu, MF_STRING, IDM_DUMMY, L"Close to tray active.");
}
AppendMenu(hMenu, MF_STRING, IDM_ABOUT, L"About WhatsappTray");
AppendMenu(hMenu, MF_STRING, IDM_EXIT, L"Exit WhatsappTray");
AppendMenu(hMenu, MF_SEPARATOR, 0, NULL); //--------------
Expand Down Expand Up @@ -253,7 +258,7 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR szCmdLine
WNDCLASS wc;
MSG msg;

bool closeToTray = strstr(szCmdLine, "--closeToTray");
closeToTray = strstr(szCmdLine, "--closeToTray");

_hInstance = hInstance;
_hwndHook = FindWindow(NAME, NAME);
Expand Down
1 change: 1 addition & 0 deletions WhatsappTray/WhatsappTray.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#define IDM_CLOSE 0x1002
#define IDM_EXIT 0x1003
#define IDM_ABOUT 0x1004
#define IDM_DUMMY 0x0405

#define DLLIMPORT __declspec(dllexport)

Expand Down

0 comments on commit 09b6d76

Please sign in to comment.