1
0
forked from Yadciel/c_tray

formatting changes

This commit is contained in:
Serge A. Zaitsev
2017-01-08 15:34:25 +02:00
parent 6534a32a20
commit 14a8be3424
2 changed files with 40 additions and 40 deletions

View File

@@ -1,5 +1,5 @@
#include <string.h>
#include <stdio.h>
#include <string.h>
#include "tray.h"

12
tray.h
View File

@@ -146,8 +146,8 @@ static void tray_update(struct tray *tray) {
static void tray_exit() { [NSApp terminate:NSApp]; }
#elif defined(TRAY_WINAPI)
#include <windows.h>
#include <shellapi.h>
#include <windows.h>
#define WM_TRAY_CALLBACK_MESSAGE (WM_USER + 1)
#define WC_TRAY_CLASS_NAME "TRAY"
@@ -158,7 +158,8 @@ static NOTIFYICONDATA nid;
static HWND hwnd;
static HMENU hmenu;
static LRESULT CALLBACK _tray_wnd_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam) {
static LRESULT CALLBACK _tray_wnd_proc(HWND hwnd, UINT msg, WPARAM wparam,
LPARAM lparam) {
switch (msg) {
case WM_CLOSE:
DestroyWindow(hwnd);
@@ -170,8 +171,8 @@ static LRESULT CALLBACK _tray_wnd_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARA
if (lparam == WM_LBUTTONUP || lparam == WM_RBUTTONUP) {
POINT p;
GetCursorPos(&p);
WORD cmd = TrackPopupMenu(hmenu,
TPM_LEFTALIGN | TPM_RIGHTBUTTON | TPM_RETURNCMD | TPM_NONOTIFY,
WORD cmd = TrackPopupMenu(hmenu, TPM_LEFTALIGN | TPM_RIGHTBUTTON |
TPM_RETURNCMD | TPM_NONOTIFY,
p.x, p.y, 0, hwnd, NULL);
SendMessage(hwnd, WM_COMMAND, cmd, 0);
return 0;
@@ -180,8 +181,7 @@ static LRESULT CALLBACK _tray_wnd_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARA
case WM_COMMAND:
if (wparam >= ID_TRAY_FIRST) {
MENUITEMINFO item = {
.cbSize = sizeof(MENUITEMINFO),
.fMask = MIIM_ID | MIIM_DATA,
.cbSize = sizeof(MENUITEMINFO), .fMask = MIIM_ID | MIIM_DATA,
};
if (GetMenuItemInfo(hmenu, wparam, FALSE, &item)) {
struct tray_menu *menu = (struct tray_menu *)item.dwItemData;