ReactOS  0.4.12-dev-14-gd0c8636
misc.cpp
Go to the documentation of this file.
1 /*
2  * PROJECT: ReactOS Applications Manager
3  * LICENSE: GPL-2.0+ (https://spdx.org/licenses/GPL-2.0+)
4  * FILE: base/applications/rapps/misc.cpp
5  * PURPOSE: Misc functions
6  * COPYRIGHT: Copyright 2009 Dmitry Chapyshev (dmitry@reactos.org)
7  * Copyright 2015 Ismael Ferreras Morezuelas (swyterzone+ros@gmail.com)
8  * Copyright 2017 Alexander Shaposhnikov (sanchaez@reactos.org)
9  */
10 #include "rapps.h"
11 
12 #include "gui.h"
13 #include "misc.h"
14 
15 static HANDLE hLog = NULL;
16 
18 {
19  RECT Rect;
20 
21  GetWindowRect(hwnd, &Rect);
22  return (Rect.right - Rect.left);
23 }
24 
26 {
27  RECT Rect;
28 
29  GetWindowRect(hwnd, &Rect);
30  return (Rect.bottom - Rect.top);
31 }
32 
34 {
35  RECT Rect;
36 
37  GetClientRect(hwnd, &Rect);
38  return (Rect.right - Rect.left);
39 }
40 
42 {
43  RECT Rect;
44 
45  GetClientRect(hwnd, &Rect);
46  return (Rect.bottom - Rect.top);
47 }
48 
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 }
74 
76 {
78 
79  szText.LoadStringW(IDS_WELCOME_TITLE);
80  NewRichEditText(szText, CFE_BOLD);
81 
82  szText.LoadStringW(IDS_WELCOME_TEXT);
83  InsertRichEditText(szText, 0);
84 
85  szText.LoadStringW(IDS_WELCOME_URL);
87 }
88 
89 VOID ShowPopupMenu(HWND hwnd, UINT MenuID, UINT DefaultItem)
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 
119  SetForegroundWindow(hwnd);
120  TrackPopupMenu(hPopupMenu, 0, pt.x, pt.y, 0, hMainWnd, NULL);
121 
122  if (hMenu)
123  {
124  DestroyMenu(hMenu);
125  }
126 }
127 
129 {
130  return StartProcess(const_cast<LPWSTR>(Path.GetString()), Wait);;
131 }
132 
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  {
160  if (dwRet == WAIT_OBJECT_0 + 1)
161  {
162  while (PeekMessageW(&msg, NULL, 0, 0, PM_REMOVE))
163  {
164  TranslateMessage(&msg);
165  DispatchMessageW(&msg);
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 }
186 
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 }
200 
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 
220  if (!GetModuleFileNameW(NULL, szPath, _countof(szPath)))
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 }
245 
246 
248 {
249  if (hLog)
250  {
251  DeregisterEventSource(hLog);
252  }
253 }
254 
255 
256 BOOL WriteLogMessage(WORD wType, DWORD dwEventID, LPCWSTR lpMsg)
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 }
271 
273  const ATL::CStringW& szRegName,
274  BOOL IsUserKey,
275  REGSAM keyWow)
276 {
277  BOOL bHasSucceded = FALSE;
280  ATL::CStringW szPath = ATL::CStringW(L"Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\%ls") + szRegName;
281 
282  if (key.Open(IsUserKey ? HKEY_CURRENT_USER : HKEY_LOCAL_MACHINE,
283  szPath.GetString(),
284  keyWow | KEY_READ) != ERROR_SUCCESS)
285  {
286  return FALSE;
287  }
288 
289  if (szVersionResult != NULL)
290  {
291  ULONG dwSize = MAX_PATH * sizeof(WCHAR);
292 
293  if (key.QueryStringValue(L"DisplayVersion",
294  szVersion.GetBuffer(MAX_PATH),
295  &dwSize) == ERROR_SUCCESS)
296  {
297  szVersion.ReleaseBuffer();
298  *szVersionResult = szVersion;
299  bHasSucceded = TRUE;
300  }
301  else
302  {
303  szVersion.ReleaseBuffer();
304  }
305  }
306  else
307  {
308  bHasSucceded = TRUE;
309  szVersion.ReleaseBuffer();
310  }
311  key.Close();
312 
313  return bHasSucceded;
314 }
315 
316 BOOL GetInstalledVersion(ATL::CStringW *pszVersion, const ATL::CStringW &szRegName)
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 }
324 
325 // CConfigParser
326 
327 CConfigParser::CConfigParser(const ATL::CStringW& FileName) : szConfigPath(GetINIFullPath(FileName))
328 {
329  CacheINILocale();
330 }
331 
333 {
334  ATL::CStringW szDir;
335  ATL::CStringW szBuffer;
336 
337  GetStorageDirectory(szDir);
338  szBuffer.Format(L"%ls\\rapps\\%ls", szDir.GetString(), FileName.GetString());
339 
340  return szBuffer;
341 }
342 
344 {
345  // TODO: Set default locale if call fails
346  // find out what is the current system lang code (e.g. "0a") and append it to SectionLocale
349 
352 
353  // turn "Section.0c0a" into "Section.0a", keeping just the neutral lang part
355 }
356 
358 {
359  DWORD dwResult;
360 
361  LPWSTR ResultStringBuffer = ResultString.GetBuffer(MAX_PATH);
362  // 1st - find localized strings (e.g. "Section.0c0a")
364  KeyName.GetString(),
365  NULL,
366  ResultStringBuffer,
367  MAX_PATH,
369 
370  if (!dwResult)
371  {
372  // 2nd - if they weren't present check for neutral sub-langs/ generic translations (e.g. "Section.0a")
374  KeyName.GetString(),
375  NULL,
376  ResultStringBuffer,
377  MAX_PATH,
379  if (!dwResult)
380  {
381  // 3rd - if they weren't present fallback to standard english strings (just "Section")
382  dwResult = GetPrivateProfileStringW(L"Section",
383  KeyName.GetString(),
384  NULL,
385  ResultStringBuffer,
386  MAX_PATH,
388  }
389  }
390 
391  ResultString.ReleaseBuffer();
392  return (dwResult != 0 ? TRUE : FALSE);
393 }
394 
396 {
398 
399  iResult = 0;
400 
401  // grab the text version of our entry
402  if (!GetString(KeyName, Buffer))
403  return FALSE;
404 
405  if (Buffer.IsEmpty())
406  return FALSE;
407 
408  // convert it to an actual integer
409  iResult = StrToIntW(Buffer.GetString());
410 
411  // we only care about values > 0
412  return (iResult > 0);
413 }
414 // CConfigParser
BOOL WINAPI CreateDirectoryW(IN LPCWSTR lpPathName, IN LPSECURITY_ATTRIBUTES lpSecurityAttributes)
Definition: dir.c:90
DWORD WINAPI GetModuleFileNameW(HINSTANCE hModule, LPWSTR lpFilename, DWORD nSize)
Definition: loader.c:607
_Must_inspect_result_ _Out_ PNDIS_STATUS _In_ NDIS_HANDLE _In_ ULONG _Out_ PNDIS_STRING KeyName
Definition: ndis.h:4693
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
ATL::CStringW GetINIFullPath(const ATL::CStringW &FileName)
Definition: misc.cpp:332
BOOL WINAPI TranslateMessage(_In_ const MSG *)
ATL::CStringW m_szLocaleID
Definition: misc.h:32
INT WINAPI GetPrivateProfileStringW(LPCWSTR section, LPCWSTR entry, LPCWSTR def_val, LPWSTR buffer, UINT len, LPCWSTR filename)
Definition: profile.c:1142
#define TRUE
Definition: types.h:120
HGLOBAL NTAPI GlobalAlloc(UINT uFlags, SIZE_T dwBytes)
Definition: heapmem.c:368
#define CloseHandle
Definition: compat.h:398
long y
Definition: polytest.cpp:48
#define ERROR_SUCCESS
Definition: deptool.c:10
long x
Definition: polytest.cpp:48
static const INT m_cchLocaleSize
Definition: misc.h:30
#define KEY_READ
Definition: nt_native.h:1023
#define pt(x, y)
Definition: drawing.c:79
__wchar_t WCHAR
Definition: xmlstorage.h:180
VOID NewRichEditText(LPCWSTR szText, DWORD flags)
Definition: gui.cpp:1792
#define _countof(array)
Definition: fontsub.cpp:30
#define HKEY_CURRENT_USER
Definition: winreg.h:11
TW_UINT32 TW_UINT16 TW_UINT16 MSG
Definition: twain.h:1827
CStringT Right(int nCount) const
Definition: cstringt.h:655
LONG top
Definition: windef.h:297
#define IDS_WELCOME_TITLE
Definition: resource.h:91
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
#define IDS_WELCOME_TEXT
Definition: resource.h:92
static HANDLE ULONG_PTR dwData
Definition: file.c:35
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
#define ZeroMemory
Definition: winbase.h:1635
ATL::CStringW m_szCachedINISectionLocaleNeutral
Definition: misc.h:34
void __cdecl Format(UINT nFormatID,...)
Definition: cstringt.h:668
HWND WINAPI SetFocus(_In_opt_ HWND)
LCID WINAPI GetUserDefaultLCID(void)
Definition: lang.c:523
BOOL GetInt(const ATL::CStringW &KeyName, INT &iResult)
Definition: misc.cpp:395
#define LOCALE_ILANGUAGE
Definition: winnls.h:25
uint16_t * PWCHAR
Definition: typedefs.h:54
LONG left
Definition: windef.h:296
BOOL WINAPI GetCursorPos(_Out_ LPPOINT)
Definition: cursoricon.c:2635
#define WCHAR
Definition: msvc.h:43
VOID SetWelcomeText()
Definition: misc.cpp:75
LONG right
Definition: windef.h:298
LONG Close()
Definition: atlbase.h:1061
int32_t INT
Definition: typedefs.h:56
HANDLE WINAPI SetClipboardData(_In_ UINT, _In_opt_ HANDLE)
ATL::CStringW m_szCachedINISectionLocale
Definition: misc.h:33
INT GetWindowHeight(HWND hwnd)
Definition: misc.cpp:25
#define CFE_BOLD
Definition: richedit.h:406
INT WINAPI GetLocaleInfoW(LCID lcid, LCTYPE lctype, LPWSTR buffer, INT len)
Definition: lang.c:807
INT GetClientWindowWidth(HWND hwnd)
Definition: misc.cpp:33
void ReleaseBuffer(_In_ int nNewLength=-1)
Definition: atlsimpstr.h:372
#define EVENTLOG_ERROR_TYPE
Definition: winnt_old.h:2630
static const WCHAR szText[]
Definition: dialog.c:139
LRESULT WINAPI DispatchMessageW(_In_ const MSG *)
INT GetClientWindowHeight(HWND hwnd)
Definition: misc.cpp:41
#define MIIM_STATE
Definition: winuser.h:716
const ATL::CStringW szConfigPath
Definition: misc.h:36
STRSAFEAPI StringCchCopyW(STRSAFE_LPWSTR pszDest, size_t cchDest, STRSAFE_LPCWSTR pszSrc)
Definition: strsafe.h:149
static DWORD cchBuffer
Definition: fusion.c:83
VOID InitLogs()
Definition: misc.cpp:201
#define CF_UNICODETEXT
Definition: constants.h:408
smooth NULL
Definition: ftsmooth.c:416
#define QS_ALLEVENTS
Definition: winuser.h:873
SETTINGS_INFO SettingsInfo
Definition: winmain.cpp:19
#define STARTF_USESHOWWINDOW
Definition: winbase.h:472
#define SW_SHOW
Definition: winuser.h:769
VOID CacheINILocale()
Definition: misc.cpp:343
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 REG_OPTION_NON_VOLATILE
Definition: nt_native.h:1057
#define KEY_WRITE
Definition: nt_native.h:1031
#define KEY_WOW64_64KEY
Definition: cmtypes.h:46
BOOL WINAPI GetMenuItemInfoW(_In_ HMENU, _In_ UINT, _In_ BOOL, _Inout_ LPMENUITEMINFOW)
BOOL WINAPI EmptyClipboard(void)
Definition: ntwrapper.h:190
LONG SetDWORDValue(LPCTSTR pszValueName, DWORD dwValue)
Definition: atlbase.h:1227
INT GetWindowWidth(HWND hwnd)
Definition: misc.cpp:17
unsigned int BOOL
Definition: ntddk_ex.h:94
#define WAIT_OBJECT_0
Definition: winbase.h:387
DWORD cb
Definition: winbase.h:817
#define EVENTLOG_INFORMATION_TYPE
Definition: winnt_old.h:2632
#define EVENTLOG_WARNING_TYPE
Definition: winnt_old.h:2631
LONG HRESULT
Definition: typedefs.h:77
#define CSIDL_LOCAL_APPDATA
Definition: shlobj.h:1903
#define MAX_PATH
Definition: compat.h:26
PCXSTR GetString() const
Definition: atlsimpstr.h:361
unsigned int UINT
Definition: ndis.h:50
LONG Open(HKEY hKeyParent, LPCTSTR lpszKeyName, REGSAM samDesired=KEY_READ|KEY_WRITE)
Definition: atlbase.h:1078
static HANDLE hLog
Definition: misc.cpp:15
unsigned short WORD
Definition: ntddk_ex.h:93
unsigned long DWORD
Definition: ntddk_ex.h:95
#define WAIT_FAILED
Definition: winbase.h:394
LONG QueryStringValue(LPCTSTR pszValueName, LPTSTR pszValue, ULONG *pnChars)
Definition: atlbase.h:1157
BOOL WINAPI CloseClipboard(void)
Definition: ntwrapper.h:178
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)
static LPCWSTR szVersion
Definition: asmcache.c:748
HWND hMainWnd
Definition: magnifier.c:33
VOID InsertRichEditText(LPCWSTR szText, DWORD flags)
Definition: gui.cpp:1797
static const WCHAR L[]
Definition: oid.c:1087
LPVOID NTAPI GlobalLock(HGLOBAL hMem)
Definition: heapmem.c:755
#define MFS_GRAYED
Definition: winuser.h:746
HKEY key
Definition: reg.c:42
WORD wShowWindow
Definition: winbase.h:829
LONG Create(HKEY hKeyParent, LPCTSTR lpszKeyName, LPTSTR lpszClass=REG_NONE, DWORD dwOptions=REG_OPTION_NON_VOLATILE, REGSAM samDesired=KEY_READ|KEY_WRITE, LPSECURITY_ATTRIBUTES lpSecAttr=NULL, LPDWORD lpdwDisposition=NULL)
Definition: atlbase.h:1099
HMENU WINAPI GetSubMenu(_In_ HMENU, _In_ int)
#define CFM_LINK
Definition: richedit.h:337
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
VOID CopyTextToClipboard(LPCWSTR lpszText)
Definition: misc.cpp:49
BOOL WINAPI DestroyMenu(_In_ HMENU)
BOOL WINAPI EnableWindow(_In_ HWND, _In_ BOOL)
BOOL WriteLogMessage(WORD wType, DWORD dwEventID, LPCWSTR lpMsg)
Definition: misc.cpp:256
BOOL GetInstalledVersion(ATL::CStringW *pszVersion, const ATL::CStringW &szRegName)
Definition: misc.cpp:316
bool IsEmpty() const
Definition: atlsimpstr.h:379
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
HINSTANCE hInst
Definition: dxdiag.c:13
PRTL_UNICODE_STRING_BUFFER Path
BOOL bLogEnabled
Definition: winmain.h:9
BOOL WINAPI SHGetSpecialFolderPathW(HWND hwndOwner, LPWSTR szPath, int nFolder, BOOL bCreate)
Definition: shellpath.c:2566
BOOL StartProcess(ATL::CStringW &Path, BOOL Wait)
Definition: misc.cpp:128
LPCWSTR szPath
Definition: env.c:35
#define IDS_WELCOME_URL
Definition: resource.h:93
#define REG_EXPAND_SZ
Definition: nt_native.h:1494
ACCESS_MASK REGSAM
Definition: winreg.h:69
BOOL GetString(const ATL::CStringW &KeyName, ATL::CStringW &ResultString)
Definition: misc.cpp:357
BOOL WINAPI DeregisterEventSource(IN HANDLE hEventLog)
Definition: eventlog.c:473
BOOL NTAPI GlobalUnlock(HGLOBAL hMem)
Definition: heapmem.c:1190
CConfigParser(const ATL::CStringW &FileName="")
Definition: misc.cpp:327
INT WINAPI StrToIntW(LPCWSTR lpString)
Definition: string.c:411
BOOL WINAPI SetMenuDefaultItem(_In_ HMENU, _In_ UINT, _In_ UINT)
#define GMEM_DDESHARE
Definition: winbase.h:295
BOOL GetStorageDirectory(ATL::CStringW &Directory)
Definition: misc.cpp:187
#define msg(x)
Definition: auth_time.c:54
HMENU WINAPI LoadMenuW(_In_opt_ HINSTANCE, _In_ LPCWSTR)
unsigned int ULONG
Definition: retypes.h:1
base for all directory entries
Definition: entries.h:138
BOOL WINAPI SetForegroundWindow(_In_ HWND)
LONG bottom
Definition: windef.h:299
CAtlStringW CStringW
Definition: atlstr.h:130
BOOL WINAPI GetWindowRect(_In_ HWND, _Out_ LPRECT)
#define KEY_WOW64_32KEY
Definition: cmtypes.h:45
BOOL WINAPI OpenClipboard(_In_opt_ HWND)
DWORD dwFlags
Definition: winbase.h:828
VOID FreeLogs()
Definition: misc.cpp:247
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
#define ERROR_ALREADY_EXISTS
Definition: disk.h:80
BOOL WINAPI PeekMessageW(_Out_ LPMSG, _In_opt_ HWND, _In_ UINT, _In_ UINT, _In_ UINT)
#define PM_REMOVE
Definition: winuser.h:1182
#define REG_NONE
Definition: nt_native.h:1492
WCHAR * LPWSTR
Definition: xmlstorage.h:184
#define INFINITE
Definition: serial.h:102
IN BOOLEAN OUT PSTR Buffer
Definition: progress.h:34
HANDLE WINAPI RegisterEventSourceW(IN LPCWSTR lpUNCServerName, IN LPCWSTR lpSourceName)
Definition: eventlog.c:1295
HMENU WINAPI GetMenu(_In_ HWND)
VOID ShowPopupMenu(HWND hwnd, UINT MenuID, UINT DefaultItem)
Definition: misc.cpp:89
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)
size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
PSDBQUERYRESULT_VISTA PVOID DWORD * dwSize
Definition: env.c:54
struct Rect Rect
#define SUCCEEDED(hr)
Definition: intsafe.h:57
BOOL GetInstalledVersion_WowUser(ATL::CStringW *szVersionResult, const ATL::CStringW &szRegName, BOOL IsUserKey, REGSAM keyWow)
Definition: misc.cpp:272
IN BOOLEAN Wait
Definition: fatprocs.h:1529
#define HKEY_LOCAL_MACHINE
Definition: winreg.h:12
LONG SetStringValue(LPCTSTR pszValueName, LPCTSTR pszValue, DWORD dwType=REG_SZ)
Definition: atlbase.h:1232