aboutsummaryrefslogtreecommitdiff
path: root/c/main.c
diff options
context:
space:
mode:
authorJohn Ankarström <john@ankarstrom.se>2022-03-02 22:03:00 +0100
committerJohn Ankarström <john@ankarstrom.se>2022-03-03 12:05:55 +0100
commit23df5644c2ce8209a8387257f8d6942736008663 (patch)
tree4e74c3ea0fe1a7e3b1e8dd2a2bd312ec1be3e0cb /c/main.c
parent170e048f4ceb11633b62cfcc5b82df6a5aa9c27b (diff)
downloadEpisodeBrowser-23df5644c2ce8209a8387257f8d6942736008663.tar.gz
Update code style.
Diffstat (limited to 'c/main.c')
-rw-r--r--c/main.c56
1 files changed, 26 insertions, 30 deletions
diff --git a/c/main.c b/c/main.c
index 3dd5eb7..4fc5999 100644
--- a/c/main.c
+++ b/c/main.c
@@ -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();