MCPcopy Create free account
hub / github.com/bailey27/cppcryptfs / Create

Method Create

cppcryptfs/ui/TrayIcon.h:119–138  ·  view source on GitHub ↗

Operations

Source from the content-addressed store, hash-verified

117
118// Operations
119 BOOL Create(LPCTSTR szTip, HICON hIcon, UINT Menu=0) { //Menu may be used by derived classes
120 //VERIFY(OK=(GetVersion() & 0xFF)>=4); // this is only for Windows 95 (or higher)
121 OK = TRUE;
122 if(OK) {
123 ASSERT(_tcslen(szTip)<=64); // Tray only supports tooltip text up to 64 characters
124 // Create this invisible window for Message passing
125 CWnd::CreateEx(0, AfxRegisterWndClass(0), _T(""), WS_POPUP, 0,0,10,10, 0, 0);
126 memset(&NID, 0, sizeof(NID));
127 NID.cbSize=sizeof(NOTIFYICONDATA);
128 NID.hWnd =m_hWnd;//pParent->GetSafeHwnd()? pParent->GetSafeHwnd() : m_hWnd;
129 NID.uID =Menu;
130 NID.hIcon =hIcon;
131 NID.uFlags=NIF_MESSAGE | NIF_ICON | NIF_TIP;
132 NID.uCallbackMessage=RegisterWindowMessage(L"CTrayIcon");
133 wcscpy_s(NID.szTip, sizeof(NID.szTip) / sizeof(NID.szTip[0]), szTip);
134 VERIFY(OK=Shell_NotifyIcon(NIM_ADD, &NID));
135 }
136 if(!OK) memset(&NID, 0, sizeof(NID));
137 return OK;
138 }
139
140 void RemoveIcon() {
141 if(!OK) return;

Callers 1

OnInitDialogMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected