mirror of
https://github.com/pbatard/rufus.git
synced 2025-05-23 11:17:03 -04:00
parent
8db7e1720a
commit
d27e73137d
5 changed files with 91 additions and 18 deletions
|
@ -159,6 +159,20 @@ static __inline HWND CreateWindowU(char* lpClassName, char* lpWindowName,
|
|||
return ret;
|
||||
}
|
||||
|
||||
static __inline int MessageBoxU(HWND hWnd, LPCSTR lpText, LPCSTR lpCaption, UINT uType)
|
||||
{
|
||||
int ret;
|
||||
DWORD err = ERROR_INVALID_DATA;
|
||||
wconvert(lpText);
|
||||
wconvert(lpCaption);
|
||||
ret = MessageBoxW(hWnd, wlpText, wlpCaption, uType);
|
||||
err = GetLastError();
|
||||
wfree(lpText);
|
||||
wfree(lpCaption);
|
||||
SetLastError(err);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static __inline int GetWindowTextU(HWND hWnd, char* lpString, int nMaxCount)
|
||||
{
|
||||
int ret = 0;
|
||||
|
@ -579,6 +593,16 @@ static __inline FILE* fopenU(const char* filename, const char* mode)
|
|||
return ret;
|
||||
}
|
||||
|
||||
// returned UTF-8 string must be freed
|
||||
static __inline char* getenvU(const char* varname)
|
||||
{
|
||||
wconvert(varname);
|
||||
char* ret;
|
||||
ret = wchar_to_utf8(_wgetenv(wvarname));
|
||||
wfree(varname);
|
||||
return ret;
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue