diff options
Diffstat (limited to 'c/main.c')
-rw-r--r-- | c/main.c | 56 |
1 files changed, 26 insertions, 30 deletions
@@ -43,30 +43,29 @@ WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, tszErr = TEXT("Could not initialize common controls."); if (!InitCommonControlsEx(&icc)) goto f; - HPopupMenu = LoadMenu(NULL, - MAKEINTRESOURCE(IDR_POPUPMENU)); + HPopupMenu = LoadMenu(NULL, MAKEINTRESOURCE(IDR_POPUPMENU)); HPopupMenu = GetSubMenu(HPopupMenu, 0); memset(&wc, 0, sizeof(WNDCLASSEX)); - wc.cbSize = sizeof(WNDCLASSEX); - wc.lpfnWndProc = WndProc; - wc.hInstance = hInstance; - wc.hIcon = LoadIcon(NULL, IDI_APPLICATION); - wc.hCursor = LoadCursor(NULL, IDC_ARROW); - wc.hbrBackground = (HBRUSH)(COLOR_WINDOW+1); - wc.lpszMenuName = MAKEINTRESOURCE(IDR_MENU); - wc.lpszClassName = TEXT("EpisodeBrowser"); - wc.hIconSm = LoadIcon(NULL, IDI_APPLICATION); + wc.cbSize = sizeof(WNDCLASSEX); + wc.lpfnWndProc = WndProc; + wc.hInstance = hInstance; + wc.hIcon = LoadIcon(NULL, IDI_APPLICATION); + wc.hCursor = LoadCursor(NULL, IDC_ARROW); + wc.hbrBackground = (HBRUSH)(COLOR_WINDOW+1); + wc.lpszMenuName = MAKEINTRESOURCE(IDR_MENU); + wc.lpszClassName = TEXT("EpisodeBrowser"); + wc.hIconSm = LoadIcon(NULL, IDI_APPLICATION); tszErr = TEXT("Could not register window class."); if (!RegisterClassEx(&wc)) goto f; hWnd = CreateWindowEx( - 0, - TEXT("EpisodeBrowser"), - TEXT("Episode Browser"), - WS_OVERLAPPEDWINDOW, - CW_USEDEFAULT, CW_USEDEFAULT, 510, 400, - NULL, NULL, hInstance, NULL + 0, + TEXT("EpisodeBrowser"), + TEXT("Episode Browser"), + WS_OVERLAPPEDWINDOW, + CW_USEDEFAULT, CW_USEDEFAULT, 510, 400, + NULL, NULL, hInstance, NULL ); tszErr = TEXT("Could not create main window."); if (!hWnd) goto f; @@ -121,7 +120,7 @@ WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) break; case WA_ACTIVE: SetFocus(HElv); - /* no break */ + /* FALLTHROUGH */ case WA_CLICKACTIVE: F(f); t = T(0); @@ -146,10 +145,10 @@ WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) break; case ID_FILE_ABOUT: DialogBox( - GetModuleHandle(NULL), - MAKEINTRESOURCE(IDD_ABOUT), - hWnd, - AboutDlgProc + GetModuleHandle(NULL), + MAKEINTRESOURCE(IDD_ABOUT), + hWnd, + AboutDlgProc ); break; case ID_WATCH: @@ -253,11 +252,10 @@ SetupFonts() NONCLIENTMETRICS m; m.cbSize = sizeof(NONCLIENTMETRICS); SystemParametersInfo(SPI_GETNONCLIENTMETRICS, - sizeof(NONCLIENTMETRICS), &m, 0); + sizeof(NONCLIENTMETRICS), &m, 0); HfNormal = CreateFontIndirect(&m.lfMessageFont); - } else { + } else HfNormal = GetStockObject(DEFAULT_GUI_FONT); - } GetObject(HfNormal, sizeof(LOGFONT), &lf); lf.lfWeight = FW_BOLD; @@ -287,8 +285,7 @@ UpdateLayout() MoveWindow(hDlv, 0, cyDlv, rc.right, rc.bottom, TRUE); cxColumn = ListView_GetColumnWidth(hDlv, 0); - ListView_SetColumnWidth(hDlv, 1, - rc.right-cxColumn-cxVScroll-4); + ListView_SetColumnWidth(hDlv, 1, rc.right-cxColumn-cxVScroll-4); /* Resize episode list view. */ @@ -296,8 +293,7 @@ UpdateLayout() MoveWindow(hElv, 0, 0, rc.right, cyDlv+1, TRUE); cxColumn = ListView_GetColumnWidth(hElv, 0); - ListView_SetColumnWidth(hElv, 1, - rc.right-cxColumn-cxVScroll-4); + ListView_SetColumnWidth(hElv, 1, rc.right-cxColumn-cxVScroll-4); } void @@ -310,7 +306,7 @@ UpdateTheme() if (bTheming == -1) { HMODULE hModule; hModule = LoadLibrary(TEXT("uxtheme.dll")); - bTheming = hModule && GetProcAddress(hModule, "SetWindowTheme"); + bTheming = hModule && GetProcAddress(hModule,"SetWindowTheme"); } if (!bTheming) return; bThemeActive = IsThemeActive(); |