ReactOS  0.4.13-dev-257-gfabbd7c
misc.h File Reference
#include <windef.h>
#include <atlstr.h>
Include dependency graph for misc.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  CConfigParser
 

Functions

INT GetWindowWidth (HWND hwnd)
 
INT GetWindowHeight (HWND hwnd)
 
INT GetClientWindowWidth (HWND hwnd)
 
INT GetClientWindowHeight (HWND hwnd)
 
VOID CopyTextToClipboard (LPCWSTR lpszText)
 
VOID SetWelcomeText ()
 
VOID ShowPopupMenu (HWND hwnd, UINT MenuID, UINT DefaultItem)
 
BOOL StartProcess (ATL::CStringW &Path, BOOL Wait)
 
BOOL StartProcess (LPWSTR lpPath, BOOL Wait)
 
BOOL GetStorageDirectory (ATL::CStringW &lpDirectory)
 
VOID InitLogs ()
 
VOID FreeLogs ()
 
BOOL WriteLogMessage (WORD wType, DWORD dwEventID, LPCWSTR lpMsg)
 
BOOL GetInstalledVersion (ATL::CStringW *pszVersion, const ATL::CStringW &szRegName)
 
BOOL ExtractFilesFromCab (const ATL::CStringW &szCabName, const ATL::CStringW &szCabDir, const ATL::CStringW &szOutputDir)
 

Function Documentation

◆ CopyTextToClipboard()

VOID CopyTextToClipboard ( LPCWSTR  lpszText)

Definition at line 49 of file misc.cpp.

50 {
51  if (!OpenClipboard(NULL))
52  {
53  return;
54  }
55 
56  HRESULT hr;
57  HGLOBAL ClipBuffer;
58  LPWSTR Buffer;
60 
62  cchBuffer = wcslen(lpszText) + 1;
63  ClipBuffer = GlobalAlloc(GMEM_DDESHARE, cchBuffer * sizeof(WCHAR));
64 
65  Buffer = (PWCHAR) GlobalLock(ClipBuffer);
66  hr = StringCchCopyW(Buffer, cchBuffer, lpszText);
67  GlobalUnlock(ClipBuffer);
68 
69  if (SUCCEEDED(hr))
70  SetClipboardData(CF_UNICODETEXT, ClipBuffer);
71 
73 }
HGLOBAL NTAPI GlobalAlloc(UINT uFlags, SIZE_T dwBytes)
Definition: heapmem.c:368
HRESULT hr
Definition: shlfolder.c:183
uint16_t * PWCHAR
Definition: typedefs.h:54
HANDLE WINAPI SetClipboardData(_In_ UINT, _In_opt_ HANDLE)
STRSAFEAPI StringCchCopyW(STRSAFE_LPWSTR pszDest, size_t cchDest, STRSAFE_LPCWSTR pszSrc)
Definition: strsafe.h:149
static DWORD cchBuffer
Definition: fusion.c:83
#define CF_UNICODETEXT
Definition: constants.h:408
smooth NULL
Definition: ftsmooth.c:416
Definition: bufpool.h:45
BOOL WINAPI EmptyClipboard(void)
Definition: ntwrapper.h:190
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:77
unsigned long DWORD
Definition: ntddk_ex.h:95
BOOL WINAPI CloseClipboard(void)
Definition: ntwrapper.h:178
LPVOID NTAPI GlobalLock(HGLOBAL hMem)
Definition: heapmem.c:755
BOOL NTAPI GlobalUnlock(HGLOBAL hMem)
Definition: heapmem.c:1190
#define GMEM_DDESHARE
Definition: winbase.h:295
BOOL WINAPI OpenClipboard(_In_opt_ HWND)
WCHAR * LPWSTR
Definition: xmlstorage.h:184
IN BOOLEAN OUT PSTR Buffer
Definition: progress.h:34
size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
#define SUCCEEDED(hr)
Definition: intsafe.h:57

Referenced by CMainWindow::OnCommand().

◆ ExtractFilesFromCab()

BOOL ExtractFilesFromCab ( const ATL::CStringW szCabName,
const ATL::CStringW szCabDir,
const ATL::CStringW szOutputDir 
)

Definition at line 257 of file cabinet.cpp.

260 {
261  HINSTANCE hCabinetDll;
262  HFDI ExtractHandler;
263  ERF ExtractErrors;
264  ATL::CStringA szCabNameUTF8, szCabDirUTF8, szOutputDirUTF8;
265  fnFDICreate pfnFDICreate;
266  fnFDICopy pfnFDICopy;
267  fnFDIDestroy pfnFDIDestroy;
268  BOOL bResult;
269 
270  // Load cabinet.dll and extract needed functions
271  hCabinetDll = LoadLibraryW(L"cabinet.dll");
272 
273  if (!hCabinetDll)
274  {
275  return FALSE;
276  }
277 
278  pfnFDICreate = (fnFDICreate) GetProcAddress(hCabinetDll, "FDICreate");
279  pfnFDICopy = (fnFDICopy) GetProcAddress(hCabinetDll, "FDICopy");
280  pfnFDIDestroy = (fnFDIDestroy) GetProcAddress(hCabinetDll, "FDIDestroy");
281 
282  if (!pfnFDICreate || !pfnFDICopy || !pfnFDIDestroy)
283  {
284  FreeLibrary(hCabinetDll);
285  return FALSE;
286  }
287 
288  // Create FDI context
289  ExtractHandler = pfnFDICreate(fnMemAlloc,
290  fnMemFree,
291  fnFileOpen,
292  fnFileRead,
293  fnFileWrite,
294  fnFileClose,
295  fnFileSeek,
296  cpuUNKNOWN,
297  &ExtractErrors);
298 
299  if (!ExtractHandler)
300  {
301  FreeLibrary(hCabinetDll);
302  return FALSE;
303  }
304 
305  // Create output dir
306  bResult = CreateDirectoryW(szOutputDir, NULL);
307 
308  if (bResult || GetLastError() == ERROR_ALREADY_EXISTS)
309  {
310  // Convert wide strings to UTF-8
311  bResult = WideToMultiByte(szCabName, szCabNameUTF8, CP_UTF8);
312  bResult &= WideToMultiByte(szCabDir, szCabDirUTF8, CP_UTF8);
313  bResult &= WideToMultiByte(szOutputDir, szOutputDirUTF8, CP_UTF8);
314  }
315 
316  // Perform extraction
317  if (bResult)
318  {
319  // Add a slash to cab name as required by the api
320  szCabNameUTF8 = "\\" + szCabNameUTF8;
321 
322  bResult = pfnFDICopy(ExtractHandler,
323  (LPSTR) szCabNameUTF8.GetString(),
324  (LPSTR) szCabDirUTF8.GetString(),
325  0,
326  fnNotify,
327  NULL,
328  (void FAR *) szOutputDirUTF8.GetString());
329  }
330 
331  pfnFDIDestroy(ExtractHandler);
332  FreeLibrary(hCabinetDll);
333  return bResult;
334 }
BOOL WINAPI CreateDirectoryW(IN LPCWSTR lpPathName, IN LPSECURITY_ATTRIBUTES lpSecurityAttributes)
Definition: dir.c:90
BOOL(* fnFDIDestroy)(HFDI)
Definition: cabinet.cpp:251
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
char * LPSTR
Definition: xmlstorage.h:182
#define CP_UTF8
Definition: nls.h:20
#define cpuUNKNOWN
Definition: fdi.h:269
unsigned int BOOL
Definition: ntddk_ex.h:94
HFDI(* fnFDICreate)(PFNALLOC, PFNFREE, PFNOPEN, PFNREAD, PFNWRITE, PFNCLOSE, PFNSEEK, int, PERF)
Definition: cabinet.cpp:233
Definition: fci.h:44
#define FAR
Definition: guiddef.h:36
#define LoadLibraryW(x)
Definition: compat.h:404
smooth NULL
Definition: ftsmooth.c:416
BOOL WideToMultiByte(const CStringW &szSource, CStringA &szDest, UINT Codepage)
Definition: cabinet.cpp:25
#define FreeLibrary(x)
Definition: compat.h:405
PCXSTR GetString() const
Definition: atlsimpstr.h:361
static const WCHAR L[]
Definition: oid.c:1250
BOOL(* fnFDICopy)(HFDI, LPSTR, LPSTR, INT, PFNFDINOTIFY, PFNFDIDECRYPT, void FAR *pvUser)
Definition: cabinet.cpp:243
#define GetProcAddress(x, y)
Definition: compat.h:410
#define ERROR_ALREADY_EXISTS
Definition: disk.h:80

Referenced by CAvailableApps::UpdateAppsDB().

◆ FreeLogs()

VOID FreeLogs ( )

Definition at line 247 of file misc.cpp.

248 {
249  if (hLog)
250  {
252  }
253 }
static HANDLE hLog
Definition: misc.cpp:15
BOOL WINAPI DeregisterEventSource(IN HANDLE hEventLog)
Definition: eventlog.c:473

Referenced by CMainWindow::ProcessWindowMessage(), and wmain().

◆ GetClientWindowHeight()

INT GetClientWindowHeight ( HWND  hwnd)

Definition at line 41 of file misc.cpp.

42 {
43  RECT Rect;
44 
46  return (Rect.bottom - Rect.top);
47 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
struct Rect Rect

Referenced by HSplitterWindowProc(), and VSplitterWindowProc().

◆ GetClientWindowWidth()

INT GetClientWindowWidth ( HWND  hwnd)

Definition at line 33 of file misc.cpp.

34 {
35  RECT Rect;
36 
38  return (Rect.right - Rect.left);
39 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
struct Rect Rect

Referenced by HSplitterWindowProc(), and VSplitterWindowProc().

◆ GetInstalledVersion()

BOOL GetInstalledVersion ( ATL::CStringW pszVersion,
const ATL::CStringW szRegName 
)

Definition at line 316 of file misc.cpp.

317 {
318  return (!szRegName.IsEmpty()
319  && (GetInstalledVersion_WowUser(pszVersion, szRegName, TRUE, KEY_WOW64_32KEY)
320  || GetInstalledVersion_WowUser(pszVersion, szRegName, FALSE, KEY_WOW64_32KEY)
321  || GetInstalledVersion_WowUser(pszVersion, szRegName, TRUE, KEY_WOW64_64KEY)
322  || GetInstalledVersion_WowUser(pszVersion, szRegName, FALSE, KEY_WOW64_64KEY)));
323 }
#define TRUE
Definition: types.h:120
#define KEY_WOW64_64KEY
Definition: cmtypes.h:46
bool IsEmpty() const
Definition: atlsimpstr.h:379
#define KEY_WOW64_32KEY
Definition: cmtypes.h:45
BOOL GetInstalledVersion_WowUser(ATL::CStringW *szVersionResult, const ATL::CStringW &szRegName, BOOL IsUserKey, REGSAM keyWow)
Definition: misc.cpp:272

Referenced by CAvailableApplicationInfo::RetrieveInstalledStatus(), and CAvailableApplicationInfo::RetrieveInstalledVersion().

◆ GetStorageDirectory()

BOOL GetStorageDirectory ( ATL::CStringW lpDirectory)

Definition at line 187 of file misc.cpp.

188 {
190  {
191  Directory.ReleaseBuffer();
192  return FALSE;
193  }
194 
195  Directory.ReleaseBuffer();
196  Directory += L"\\rapps";
197 
198  return (CreateDirectoryW(Directory.GetString(), NULL) || GetLastError() == ERROR_ALREADY_EXISTS);
199 }
BOOL WINAPI CreateDirectoryW(IN LPCWSTR lpPathName, IN LPSECURITY_ATTRIBUTES lpSecurityAttributes)
Definition: dir.c:90
#define TRUE
Definition: types.h:120
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
smooth NULL
Definition: ftsmooth.c:416
#define CSIDL_LOCAL_APPDATA
Definition: shlobj.h:2030
#define MAX_PATH
Definition: compat.h:26
static const WCHAR L[]
Definition: oid.c:1250
BOOL WINAPI SHGetSpecialFolderPathW(HWND hwndOwner, LPWSTR szPath, int nFolder, BOOL bCreate)
Definition: shellpath.c:2566
base for all directory entries
Definition: entries.h:138
#define ERROR_ALREADY_EXISTS
Definition: disk.h:80

Referenced by AvailableStrings::AvailableStrings(), CConfigParser::GetINIFullPath(), and CDownloadManager::ThreadFunc().

◆ GetWindowHeight()

INT GetWindowHeight ( HWND  hwnd)

Definition at line 25 of file misc.cpp.

26 {
27  RECT Rect;
28 
30  return (Rect.bottom - Rect.top);
31 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
BOOL WINAPI GetWindowRect(_In_ HWND, _Out_ LPRECT)
struct Rect Rect

Referenced by HSplitterWindowProc(), and VSplitterWindowProc().

◆ GetWindowWidth()

INT GetWindowWidth ( HWND  hwnd)

Definition at line 17 of file misc.cpp.

18 {
19  RECT Rect;
20 
22  return (Rect.right - Rect.left);
23 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
BOOL WINAPI GetWindowRect(_In_ HWND, _Out_ LPRECT)
struct Rect Rect

Referenced by HSplitterWindowProc().

◆ InitLogs()

VOID InitLogs ( )

Definition at line 201 of file misc.cpp.

202 {
204  {
205  return;
206  }
207 
209  DWORD dwCategoryNum = 1;
210  DWORD dwDisp, dwData;
212 
213  if (key.Create(HKEY_LOCAL_MACHINE,
214  L"SYSTEM\\CurrentControlSet\\Services\\EventLog\\Application\\ReactOS Application Manager",
216  {
217  return;
218  }
219 
221  {
222  return;
223  }
224 
227 
228  if ((key.SetStringValue(L"EventMessageFile",
229  szPath,
231  && (key.SetStringValue(L"CategoryMessageFile",
232  szPath,
234  && (key.SetDWORDValue(L"TypesSupported",
235  dwData) == ERROR_SUCCESS)
236  && (key.SetDWORDValue(L"CategoryCount",
237  dwCategoryNum) == ERROR_SUCCESS))
238 
239  {
240  hLog = RegisterEventSourceW(NULL, L"ReactOS Application Manager");
241  }
242 
243  key.Close();
244 }
DWORD WINAPI GetModuleFileNameW(HINSTANCE hModule, LPWSTR lpFilename, DWORD nSize)
Definition: loader.c:607
#define ERROR_SUCCESS
Definition: deptool.c:10
#define _countof(array)
Definition: fontsub.cpp:30
static HANDLE ULONG_PTR dwData
Definition: file.c:35
#define EVENTLOG_ERROR_TYPE
Definition: winnt_old.h:2630
smooth NULL
Definition: ftsmooth.c:416
SETTINGS_INFO SettingsInfo
Definition: winmain.cpp:19
#define REG_OPTION_NON_VOLATILE
Definition: nt_native.h:1057
#define KEY_WRITE
Definition: nt_native.h:1031
#define EVENTLOG_INFORMATION_TYPE
Definition: winnt_old.h:2632
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define EVENTLOG_WARNING_TYPE
Definition: winnt_old.h:2631
#define MAX_PATH
Definition: compat.h:26
static HANDLE hLog
Definition: misc.cpp:15
unsigned long DWORD
Definition: ntddk_ex.h:95
static const WCHAR L[]
Definition: oid.c:1250
HKEY key
Definition: reg.c:42
BOOL bLogEnabled
Definition: winmain.h:9
LPCWSTR szPath
Definition: env.c:35
#define REG_EXPAND_SZ
Definition: nt_native.h:1494
#define REG_NONE
Definition: nt_native.h:1492
HANDLE WINAPI RegisterEventSourceW(IN LPCWSTR lpUNCServerName, IN LPCWSTR lpSourceName)
Definition: eventlog.c:1295
Definition: path.c:42
#define HKEY_LOCAL_MACHINE
Definition: winreg.h:12

Referenced by wmain(), and wWinMain().

◆ SetWelcomeText()

VOID SetWelcomeText ( )

Definition at line 75 of file misc.cpp.

76 {
78 
79  szText.LoadStringW(IDS_WELCOME_TITLE);
81 
82  szText.LoadStringW(IDS_WELCOME_TEXT);
84 
85  szText.LoadStringW(IDS_WELCOME_URL);
87 }
VOID NewRichEditText(LPCWSTR szText, DWORD flags)
Definition: gui.cpp:1797
#define IDS_WELCOME_TITLE
Definition: resource.h:92
#define IDS_WELCOME_TEXT
Definition: resource.h:93
#define CFE_BOLD
Definition: richedit.h:406
static const WCHAR szText[]
Definition: dialog.c:139
VOID InsertRichEditText(LPCWSTR szText, DWORD flags)
Definition: gui.cpp:1802
#define CFM_LINK
Definition: richedit.h:337
#define IDS_WELCOME_URL
Definition: resource.h:94

Referenced by CMainWindow::UpdateApplicationsList().

◆ ShowPopupMenu()

VOID ShowPopupMenu ( HWND  hwnd,
UINT  MenuID,
UINT  DefaultItem 
)

Definition at line 89 of file misc.cpp.

90 {
91  HMENU hMenu = NULL;
92  HMENU hPopupMenu;
93  MENUITEMINFO ItemInfo;
94  POINT pt;
95 
96  if (MenuID)
97  {
98  hMenu = LoadMenuW(hInst, MAKEINTRESOURCEW(MenuID));
99  hPopupMenu = GetSubMenu(hMenu, 0);
100  }
101  else
102  {
103  hPopupMenu = GetMenu(hwnd);
104  }
105 
106  ZeroMemory(&ItemInfo, sizeof(ItemInfo));
107  ItemInfo.cbSize = sizeof(ItemInfo);
108  ItemInfo.fMask = MIIM_STATE;
109 
110  GetMenuItemInfoW(hPopupMenu, DefaultItem, FALSE, &ItemInfo);
111 
112  if (!(ItemInfo.fState & MFS_GRAYED))
113  {
114  SetMenuDefaultItem(hPopupMenu, DefaultItem, FALSE);
115  }
116 
117  GetCursorPos(&pt);
118 
120  TrackPopupMenu(hPopupMenu, 0, pt.x, pt.y, 0, hMainWnd, NULL);
121 
122  if (hMenu)
123  {
124  DestroyMenu(hMenu);
125  }
126 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define pt(x, y)
Definition: drawing.c:79
#define ZeroMemory
Definition: winbase.h:1635
BOOL WINAPI GetCursorPos(_Out_ LPPOINT)
Definition: cursoricon.c:2635
#define MIIM_STATE
Definition: winuser.h:716
smooth NULL
Definition: ftsmooth.c:416
BOOL WINAPI GetMenuItemInfoW(_In_ HMENU, _In_ UINT, _In_ BOOL, _Inout_ LPMENUITEMINFOW)
HWND hMainWnd
Definition: magnifier.c:34
#define MFS_GRAYED
Definition: winuser.h:746
HMENU WINAPI GetSubMenu(_In_ HMENU, _In_ int)
BOOL WINAPI DestroyMenu(_In_ HMENU)
HINSTANCE hInst
Definition: dxdiag.c:13
BOOL WINAPI SetMenuDefaultItem(_In_ HMENU, _In_ UINT, _In_ UINT)
HMENU WINAPI LoadMenuW(_In_opt_ HINSTANCE, _In_ LPCWSTR)
BOOL WINAPI SetForegroundWindow(_In_ HWND)
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
HMENU WINAPI GetMenu(_In_ HWND)
static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static IServiceProvider DWORD *static HMENU
Definition: ordinal.c:60
BOOL WINAPI TrackPopupMenu(_In_ HMENU, _In_ UINT, _In_ int, _In_ int, _Reserved_ int, _In_ HWND, _Reserved_ LPCRECT)

Referenced by CMainWindow::OnLink(), and CMainWindow::ProcessWindowMessage().

◆ StartProcess() [1/2]

BOOL StartProcess ( ATL::CStringW Path,
BOOL  Wait 
)

Definition at line 128 of file misc.cpp.

129 {
130  return StartProcess(const_cast<LPWSTR>(Path.GetString()), Wait);;
131 }
PRTL_UNICODE_STRING_BUFFER Path
BOOL StartProcess(ATL::CStringW &Path, BOOL Wait)
Definition: misc.cpp:128
IN BOOLEAN Wait
Definition: fatprocs.h:1529

Referenced by UninstallApplication().

◆ StartProcess() [2/2]

BOOL StartProcess ( LPWSTR  lpPath,
BOOL  Wait 
)

Definition at line 133 of file misc.cpp.

134 {
136  STARTUPINFOW si;
137  DWORD dwRet;
138  MSG msg;
139 
140  ZeroMemory(&si, sizeof(si));
141  si.cb = sizeof(si);
143  si.wShowWindow = SW_SHOW;
144 
145  if (!CreateProcessW(NULL, lpPath, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi))
146  {
147  return FALSE;
148  }
149 
150  CloseHandle(pi.hThread);
151 
152  if (Wait)
153  {
155  }
156 
157  while (Wait)
158  {
159  dwRet = MsgWaitForMultipleObjects(1, &pi.hProcess, FALSE, INFINITE, QS_ALLEVENTS);
160  if (dwRet == WAIT_OBJECT_0 + 1)
161  {
162  while (PeekMessageW(&msg, NULL, 0, 0, PM_REMOVE))
163  {
166  }
167  }
168  else
169  {
170  if (dwRet == WAIT_OBJECT_0 || dwRet == WAIT_FAILED)
171  break;
172  }
173  }
174 
175  CloseHandle(pi.hProcess);
176 
177  if (Wait)
178  {
182  }
183 
184  return TRUE;
185 }
BOOL WINAPI TranslateMessage(_In_ const MSG *)
#define TRUE
Definition: types.h:120
#define CloseHandle
Definition: compat.h:398
TW_UINT32 TW_UINT16 TW_UINT16 MSG
Definition: twain.h:1827
#define ZeroMemory
Definition: winbase.h:1635
HWND WINAPI SetFocus(_In_opt_ HWND)
LRESULT WINAPI DispatchMessageW(_In_ const MSG *)
smooth NULL
Definition: ftsmooth.c:416
#define QS_ALLEVENTS
Definition: winuser.h:873
#define STARTF_USESHOWWINDOW
Definition: winbase.h:472
#define SW_SHOW
Definition: winuser.h:769
BOOL WINAPI DECLSPEC_HOTPATCH CreateProcessW(LPCWSTR lpApplicationName, LPWSTR lpCommandLine, LPSECURITY_ATTRIBUTES lpProcessAttributes, LPSECURITY_ATTRIBUTES lpThreadAttributes, BOOL bInheritHandles, DWORD dwCreationFlags, LPVOID lpEnvironment, LPCWSTR lpCurrentDirectory, LPSTARTUPINFOW lpStartupInfo, LPPROCESS_INFORMATION lpProcessInformation)
Definition: proc.c:4623
#define WAIT_OBJECT_0
Definition: winbase.h:387
DWORD cb
Definition: winbase.h:817
unsigned long DWORD
Definition: ntddk_ex.h:95
#define WAIT_FAILED
Definition: winbase.h:394
static DWORD pi
Definition: protocol.c:150
DWORD WINAPI MsgWaitForMultipleObjects(_In_ DWORD nCount, _In_reads_opt_(nCount) CONST HANDLE *pHandles, _In_ BOOL fWaitAll, _In_ DWORD dwMilliseconds, _In_ DWORD dwWakeMask)
HWND hMainWnd
Definition: magnifier.c:34
WORD wShowWindow
Definition: winbase.h:829
BOOL WINAPI EnableWindow(_In_ HWND, _In_ BOOL)
#define msg(x)
Definition: auth_time.c:54
BOOL WINAPI SetForegroundWindow(_In_ HWND)
DWORD dwFlags
Definition: winbase.h:828
BOOL WINAPI PeekMessageW(_Out_ LPMSG, _In_opt_ HWND, _In_ UINT, _In_ UINT, _In_ UINT)
#define PM_REMOVE
Definition: winuser.h:1182
#define INFINITE
Definition: serial.h:102
IN BOOLEAN Wait
Definition: fatprocs.h:1529

◆ WriteLogMessage()

BOOL WriteLogMessage ( WORD  wType,
DWORD  dwEventID,
LPCWSTR  lpMsg 
)

Definition at line 256 of file misc.cpp.

257 {
259  {
260  return TRUE;
261  }
262 
263  if (!ReportEventW(hLog, wType, 0, dwEventID,
264  NULL, 1, 0, &lpMsg, NULL))
265  {
266  return FALSE;
267  }
268 
269  return TRUE;
270 }
#define TRUE
Definition: types.h:120
smooth NULL
Definition: ftsmooth.c:416
SETTINGS_INFO SettingsInfo
Definition: winmain.cpp:19
static HANDLE hLog
Definition: misc.cpp:15
BOOL WINAPI ReportEventW(IN HANDLE hEventLog, IN WORD wType, IN WORD wCategory, IN DWORD dwEventID, IN PSID lpUserSid, IN WORD wNumStrings, IN DWORD dwDataSize, IN LPCWSTR *lpStrings, IN LPVOID lpRawData)
Definition: eventlog.c:1516
BOOL bLogEnabled
Definition: winmain.h:9

Referenced by UninstallApplication().