view: Use the ARRAY_SIZE() macro.
Signed-off-by: Michael Stefaniuc <mstefani@winehq.org> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
56c4c7c57e
commit
e9e96bc39a
|
@ -214,12 +214,12 @@ static void UpdateWindowCaption(void)
|
||||||
WCHAR szView[MAX_PATH];
|
WCHAR szView[MAX_PATH];
|
||||||
static const WCHAR hyphenW[] = { ' ','-',' ',0 };
|
static const WCHAR hyphenW[] = { ' ','-',' ',0 };
|
||||||
|
|
||||||
LoadStringW(hInst, IDS_DESCRIPTION, szView, sizeof(szView)/sizeof(WCHAR));
|
LoadStringW(hInst, IDS_DESCRIPTION, szView, ARRAY_SIZE(szView));
|
||||||
|
|
||||||
if (szFileTitle[0] != '\0')
|
if (szFileTitle[0] != '\0')
|
||||||
{
|
{
|
||||||
lstrcpyW(szCaption, szFileTitle);
|
lstrcpyW(szCaption, szFileTitle);
|
||||||
LoadStringW(hInst, IDS_DESCRIPTION, szView, sizeof(szView)/sizeof(WCHAR));
|
LoadStringW(hInst, IDS_DESCRIPTION, szView, ARRAY_SIZE(szView));
|
||||||
lstrcatW(szCaption, hyphenW);
|
lstrcatW(szCaption, hyphenW);
|
||||||
lstrcatW(szCaption, szView);
|
lstrcatW(szCaption, szView);
|
||||||
}
|
}
|
||||||
|
@ -260,10 +260,10 @@ static LRESULT CALLBACK WndProc(HWND hwnd, UINT uMessage, WPARAM wparam, LPARAM
|
||||||
case IDM_OPEN:
|
case IDM_OPEN:
|
||||||
{
|
{
|
||||||
WCHAR filename[MAX_PATH];
|
WCHAR filename[MAX_PATH];
|
||||||
if (FileOpen(hwnd, filename, sizeof(filename)/sizeof(WCHAR)))
|
if (FileOpen(hwnd, filename, ARRAY_SIZE(filename)))
|
||||||
{
|
{
|
||||||
szFileTitle[0] = 0;
|
szFileTitle[0] = 0;
|
||||||
GetFileTitleW(filename, szFileTitle, sizeof(szFileTitle)/sizeof(WCHAR));
|
GetFileTitleW(filename, szFileTitle, ARRAY_SIZE(szFileTitle));
|
||||||
DoOpenFile(filename);
|
DoOpenFile(filename);
|
||||||
UpdateWindowCaption();
|
UpdateWindowCaption();
|
||||||
}
|
}
|
||||||
|
@ -323,7 +323,7 @@ static BOOL InitApplication(HINSTANCE hInstance)
|
||||||
WNDCLASSEXW wc;
|
WNDCLASSEXW wc;
|
||||||
|
|
||||||
/* Load the application description strings */
|
/* Load the application description strings */
|
||||||
LoadStringW(hInstance, IDS_DESCRIPTION, szTitle, sizeof(szTitle)/sizeof(WCHAR));
|
LoadStringW(hInstance, IDS_DESCRIPTION, szTitle, ARRAY_SIZE(szTitle));
|
||||||
|
|
||||||
/* Fill in window class structure with parameters that describe the
|
/* Fill in window class structure with parameters that describe the
|
||||||
main window */
|
main window */
|
||||||
|
@ -390,7 +390,7 @@ static void HandleCommandLine(LPWSTR cmdline)
|
||||||
cmdline[lstrlenW(cmdline) - 1] = 0;
|
cmdline[lstrlenW(cmdline) - 1] = 0;
|
||||||
}
|
}
|
||||||
szFileTitle[0] = 0;
|
szFileTitle[0] = 0;
|
||||||
GetFileTitleW(cmdline, szFileTitle, sizeof(szFileTitle)/sizeof(WCHAR));
|
GetFileTitleW(cmdline, szFileTitle, ARRAY_SIZE(szFileTitle));
|
||||||
DoOpenFile(cmdline);
|
DoOpenFile(cmdline);
|
||||||
UpdateWindowCaption();
|
UpdateWindowCaption();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue