1 //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
\r
2 // mayuipc.h - mayu inter process communication
\r
7 # include <windows.h>
\r
12 # endif // __cplusplus
\r
15 # define WM_MayuIPC_NAME _T("MayuIPC{46269F4D-D560-40f9-B38B-DB5E280FEF47}")
\r
17 enum MayuIPCCommand {
\r
18 // enable or disable Mayu
\r
19 MayuIPCCommand_Enable = 1,
\r
22 BOOL MayuIPC_PostMessage(MayuIPCCommand i_wParam, LPARAM i_lParam);
\r
23 BOOL MayuIPC_Enable(BOOL i_isEnabled);
\r
25 # ifdef _MAYUIPC_H_DEFINE_FUNCTIONS
\r
27 BOOL MayuIPC_PostMessage(MayuIPCCommand i_command, LPARAM i_lParam) {
\r
28 static UINT WM_MayuIPC;
\r
31 if (WM_MayuIPC == 0) {
\r
32 WM_MayuIPC = RegisterWindowMessage(WM_MayuIPC_NAME);
\r
33 if (WM_MayuIPC == 0) {
\r
38 hwnd = FindWindow(_T("mayuTasktray"), NULL);
\r
42 PostMessage(hwnd, WM_MayuIPC, i_command, i_lParam);
\r
46 BOOL MayuIPC_Enable(BOOL i_isEnabled) {
\r
47 return MayuIPC_PostMessage(MayuIPCCommand_Enable, i_isEnabled);
\r
50 # endif // _MAYUIPC_H_DEFINE_FUNCTIONS
\r
54 # endif // __cplusplus
\r
55 #endif // !_MAYUIPC_H
\r