BOOL InitControls(HWND hwnd) { if (SettingsInfo.bSaveWndPos) { MoveWindow(hwnd, SettingsInfo.Left, SettingsInfo.Top, SettingsInfo.Right - SettingsInfo.Left, SettingsInfo.Bottom - SettingsInfo.Top, TRUE); if (SettingsInfo.Maximized) ShowWindow(hwnd, SW_MAXIMIZE); } if (CreateStatusBar(hwnd) && CreateToolBar(hwnd) && CreateListView(hwnd) && CreateTreeView(hwnd) && CreateRichEdit(hwnd) && CreateVSplitBar(hwnd) && CreateHSplitBar(hwnd)) { WCHAR szBuffer1[MAX_STR_LEN], szBuffer2[MAX_STR_LEN]; InitApplicationsList(); InitCategoriesList(); LoadStringW(hInst, IDS_APPS_COUNT, szBuffer2, sizeof(szBuffer2) / sizeof(WCHAR)); swprintf(szBuffer1, szBuffer2, ListView_GetItemCount(hListView)); SetStatusBarText(szBuffer1); return TRUE; } return FALSE; }
BOOL InitControls(HWND hwnd) { if (CreateStatusBar(hwnd) && CreateToolBar(hwnd) && CreateListView(hwnd) && CreateTreeView(hwnd) && CreateRichEdit(hwnd) && CreateVSplitBar(hwnd) && CreateHSplitBar(hwnd)) { WCHAR szBuffer1[MAX_STR_LEN], szBuffer2[MAX_STR_LEN]; InitApplicationsList(); InitCategoriesList(); LoadStringW(hInst, IDS_APPS_COUNT, szBuffer2, _countof(szBuffer2)); StringCbPrintfW(szBuffer1, sizeof(szBuffer1), szBuffer2, ListView_GetItemCount(hListView)); SetStatusBarText(szBuffer1); return TRUE; } return FALSE; }