[SETUP:REACTOS] Add some SetWindowRes* helper functions

This commit is contained in:
Hermès Bélusca-Maïto 2024-08-08 13:36:03 +02:00
parent 5b07c33031
commit fd67017512
No known key found for this signature in database
GPG key ID: 3B2539C65E7B93D0
2 changed files with 62 additions and 0 deletions

View file

@ -246,6 +246,47 @@ DisplayError(
return iRes;
}
VOID
SetWindowResTextW(
_In_ HWND hWnd,
_In_opt_ HINSTANCE hInstance,
_In_ UINT uID)
{
WCHAR szText[256];
LoadStringW(hInstance, uID, szText, _countof(szText));
SetWindowTextW(hWnd, szText);
}
VOID
SetWindowResPrintfVW(
_In_ HWND hWnd,
_In_opt_ HINSTANCE hInstance,
_In_ UINT uID,
_In_ va_list args)
{
WCHAR ResBuffer[256];
WCHAR szText[256];
LoadStringW(hInstance, uID, ResBuffer, _countof(ResBuffer));
StringCchVPrintfW(szText, _countof(szText), ResBuffer, args);
SetWindowTextW(hWnd, szText);
}
VOID
__cdecl
SetWindowResPrintfW(
_In_ HWND hWnd,
_In_opt_ HINSTANCE hInstance,
_In_ UINT uID,
...)
{
va_list args;
va_start(args, uID);
SetWindowResPrintfVW(hWnd, hInstance, uID, args);
va_end(args);
}
static INT_PTR CALLBACK
StartDlgProc(
IN HWND hwndDlg,

View file

@ -255,6 +255,27 @@ DisplayError(
_In_ UINT uIDMessage,
...);
VOID
SetWindowResTextW(
_In_ HWND hWnd,
_In_opt_ HINSTANCE hInstance,
_In_ UINT uID);
VOID
SetWindowResPrintfVW(
_In_ HWND hWnd,
_In_opt_ HINSTANCE hInstance,
_In_ UINT uID,
_In_ va_list args);
VOID
__cdecl
SetWindowResPrintfW(
_In_ HWND hWnd,
_In_opt_ HINSTANCE hInstance,
_In_ UINT uID,
...);
#endif /* _REACTOS_PCH_ */
/* EOF */