MCPcopy Create free account
hub / github.com/FirebirdSQL/firebird / WindowFunc

Function WindowFunc

src/iscguard/iscguard.cpp:363–561  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

361
362
363static LRESULT CALLBACK WindowFunc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
364{
365/**************************************
366 *
367 * W i n d o w _ F u n c
368 *
369 **************************************
370 *
371 * Functional description
372 *
373 * This function is where the windowing action takes place.
374 * Handle the various messages which come here from GetMessage.
375 *
376 **************************************/
377
378 static BOOL bInTaskBar = FALSE;
379 static bool bStartup = false;
380 static HINSTANCE hInstance = NULL;
381 static UINT s_uTaskbarRestart;
382
383 hInstance = (HINSTANCE) GetWindowLongPtr(hWnd, GWLP_HINSTANCE);
384 switch (message)
385 {
386 case WM_CLOSE:
387 // Clean up memory for log_entry
388 while (log_entry->next)
389 {
390 log_info* tmp = log_entry->next;
391 free(log_entry);
392 log_entry = tmp;
393 }
394 free(log_entry);
395 DestroyWindow(hWnd);
396 break;
397
398 case WM_COMMAND:
399 switch (wParam)
400 {
401 case IDM_CANCEL:
402 ShowWindow(hWnd, bInTaskBar ? SW_HIDE : SW_MINIMIZE);
403 return TRUE;
404
405 case IDM_OPENPOPUP:
406 {
407 // The SetForegroundWindow() has to be called because our window
408 // does not become the Foreground one (inspite of clicking on
409 // the icon). This is so because the icon is painted on the task
410 // bar and is not the same as a minimized window.
411
412 SetForegroundWindow(hWnd);
413
414 HMENU hPopup = CreatePopupMenu();
415 char szMsgString[256];
416 LoadString(hInstance, IDS_SVRPROPERTIES, szMsgString, 256);
417 AppendMenu(hPopup, MF_STRING, IDM_SVRPROPERTIES, szMsgString);
418 LoadString(hInstance, IDS_SHUTDOWN, szMsgString, 256);
419 AppendMenu(hPopup, MF_STRING, IDM_SHUTDOWN, szMsgString);
420 LoadString(hInstance, IDS_PROPERTIES, szMsgString, 256);

Callers

nothing calls this directly

Calls 6

DisplayPropSheetFunction · 0.85
addTaskBarIconsFunction · 0.85
startFunction · 0.50
isValidMethod · 0.45
getHandleMethod · 0.45
detachMethod · 0.45

Tested by

no test coverage detected