878f5bb9a936fc2372528044548a053acd297923
[reactos.git] / reactos / base / applications / rapps / include / misc.h
1 #pragma once
2
3 #include <windef.h>
4 #include <atlstr.h>
5
6 INT GetWindowWidth(HWND hwnd);
7 INT GetWindowHeight(HWND hwnd);
8 INT GetClientWindowWidth(HWND hwnd);
9 INT GetClientWindowHeight(HWND hwnd);
10
11 VOID CopyTextToClipboard(LPCWSTR lpszText);
12 VOID SetWelcomeText(VOID);
13 VOID ShowPopupMenu(HWND hwnd, UINT MenuID, UINT DefaultItem);
14 BOOL StartProcess(ATL::CStringW &Path, BOOL Wait);
15 BOOL StartProcess(LPWSTR lpPath, BOOL Wait);
16 BOOL GetStorageDirectory(ATL::CStringW &lpDirectory);
17 BOOL ExtractFilesFromCab(LPCWSTR lpCabName, LPCWSTR lpOutputPath);
18 VOID InitLogs(VOID);
19 VOID FreeLogs(VOID);
20 BOOL WriteLogMessage(WORD wType, DWORD dwEventID, LPCWSTR lpMsg);
21 BOOL GetInstalledVersion(ATL::CStringW *pszVersion, const ATL::CStringW &szRegName);
22
23 class CConfigParser
24 {
25 // Locale names cache
26 const static INT m_cchLocaleSize = 5;
27
28 static ATL::CStringW m_szLocaleID;
29 static ATL::CStringW m_szCachedINISectionLocale;
30 static ATL::CStringW m_szCachedINISectionLocaleNeutral;
31
32 const ATL::CStringW szConfigPath;
33
34 static ATL::CStringW GetINIFullPath(const ATL::CStringW& FileName);
35 static VOID CacheINILocaleLazy();
36
37 public:
38 static const ATL::CStringW& GetLocale();
39 static INT CConfigParser::GetLocaleSize();
40
41 CConfigParser(const ATL::CStringW& FileName);
42
43 UINT GetString(const ATL::CStringW& KeyName, ATL::CStringW& ResultString);
44 UINT GetInt(const ATL::CStringW& KeyName);
45 };