ReactOS 0.4.16-dev-320-g3bd9ddc
CLoaderWnd.cpp
Go to the documentation of this file.
1/*
2 * PROJECT: ReactOS CTF Monitor
3 * LICENSE: LGPL-2.1-or-later (https://spdx.org/licenses/LGPL-2.1-or-later)
4 * PURPOSE: Cicero Tipbar (Language Bar) loader window
5 * COPYRIGHT: Copyright 2023 Katayama Hirofumi MZ <katayama.hirofumi.mz@gmail.com>
6 */
7
8#include "precomp.h"
9#include "CLoaderWnd.h"
10#include "CRegWatcher.h"
11
14
16{
18 return TRUE; // Already registered
19
20 // Register a window class
21 WNDCLASSEX wc;
22 ZeroMemory(&wc, sizeof(wc));
23 wc.cbSize = sizeof(wc);
25 wc.hInstance = g_hInst;
28 wc.lpszClassName = TEXT("CiCTipBarClass");
29 if (!::RegisterClassEx(&wc))
30 return FALSE;
31
32 s_bWndClassRegistered = TRUE; // Remember
33 return TRUE;
34}
35
37{
38 m_hWnd = ::CreateWindowEx(0, TEXT("CiCTipBarClass"), NULL, WS_DISABLED,
39 0, 0, 0, 0, NULL, NULL, g_hInst, NULL);
40 return m_hWnd;
41}
42
45{
46 switch (uMsg)
47 {
48 case WM_CREATE:
49 break;
50
51 case WM_DESTROY:
53 break;
54
56 // NOTE: We don't support Win95/98/Me
57#ifdef SUPPORT_WIN9X
58 if (!(g_dwOsInfo & CIC_OSINFO_NT) && (!g_fWinLogon || (lParam & ENDSESSION_LOGOFF)))
59 {
63 }
64#endif
65 return TRUE;
66
67 case WM_ENDSESSION:
68 if (wParam) // The session is being ended?
69 {
71 {
72 // Un-initialize now
73 UninitApp();
76 }
77 }
78 else if (s_bUninitedSystem) // Once un-initialized?
79 {
80 // Re-initialize
82 if (!g_bOnWow64)
84
86 }
87 break;
88
90 case WM_DISPLAYCHANGE:
91 if (!g_bOnWow64) // Is the system x86/x64 native?
93 break;
94
95 default:
96 return DefWindowProc(hwnd, uMsg, wParam, lParam);
97 }
98
99 return 0;
100}
#define CIC_OSINFO_NT
Definition: cicbase.h:44
static BOOL s_bUninitedSystem
Definition: CLoaderWnd.h:14
static LRESULT CALLBACK WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: CLoaderWnd.cpp:44
static BOOL s_bWndClassRegistered
Definition: CLoaderWnd.h:15
HWND m_hWnd
Definition: CLoaderWnd.h:13
BOOL Init()
Definition: CLoaderWnd.cpp:15
HWND CreateWnd()
Definition: CLoaderWnd.cpp:36
WPARAM wParam
Definition: combotst.c:138
LPARAM lParam
Definition: combotst.c:139
VOID UninitApp(VOID)
Definition: ctfmon.cpp:246
BOOL g_bOnWow64
Definition: ctfmon.cpp:28
DWORD g_dwOsInfo
Definition: ctfmon.cpp:31
BOOL g_fWinLogon
Definition: ctfmon.cpp:26
HINSTANCE g_hInst
Definition: ctfmon.cpp:23
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define CALLBACK
Definition: compat.h:35
unsigned int BOOL
Definition: ntddk_ex.h:94
#define TEXT(s)
Definition: k32.h:26
EXTERN_C HRESULT WINAPI TF_UninitSystem(VOID)
EXTERN_C HRESULT WINAPI TF_InitSystem(VOID)
EXTERN_C VOID WINAPI ClosePopupTipbar(VOID)
Definition: msutb.cpp:6372
EXTERN_C BOOL WINAPI GetPopupTipbar(HWND hWnd, BOOL fWinLogon)
Definition: msutb.cpp:6331
unsigned int UINT
Definition: ndis.h:50
#define WS_DISABLED
Definition: pedump.c:621
#define DefWindowProc
Definition: ros2win.h:31
static VOID StartSysColorChangeTimer()
HINSTANCE hInstance
Definition: winuser.h:3209
HCURSOR hCursor
Definition: winuser.h:3211
UINT style
Definition: winuser.h:3205
UINT cbSize
Definition: winuser.h:3204
WNDPROC lpfnWndProc
Definition: winuser.h:3206
LPCSTR lpszClassName
Definition: winuser.h:3214
#define ZeroMemory
Definition: winbase.h:1737
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4023
LONG_PTR LPARAM
Definition: windef.h:208
LONG_PTR LRESULT
Definition: windef.h:209
UINT_PTR WPARAM
Definition: windef.h:207
#define CS_VREDRAW
Definition: winuser.h:658
#define CreateWindowEx
Definition: winuser.h:5767
#define WM_CREATE
Definition: winuser.h:1611
__analysis_noreturn void WINAPI PostQuitMessage(_In_ int)
#define CS_HREDRAW
Definition: winuser.h:653
#define IDC_ARROW
Definition: winuser.h:687
#define WM_SYSCOLORCHANGE
Definition: winuser.h:1629
#define RegisterClassEx
Definition: winuser.h:5849
#define WM_QUERYENDSESSION
Definition: winuser.h:1625
#define LoadCursor
Definition: winuser.h:5824
#define WM_DESTROY
Definition: winuser.h:1612
#define WM_ENDSESSION
Definition: winuser.h:1630