diff options
author | John Ankarström <john@ankarstrom.se> | 2022-02-17 01:48:22 +0100 |
---|---|---|
committer | John Ankarström <john@ankarstrom.se> | 2022-02-17 01:48:22 +0100 |
commit | d7cf090cee5f1b71c3e9c5f232d0e2a51ad6a7e5 (patch) | |
tree | 1b803ac1d172556422455c6822a7702202409eb5 /c/main.c | |
parent | 263bc8b8ff4296a1fe0014a26134ad35ebccbbff (diff) | |
download | EpisodeBrowser-d7cf090cee5f1b71c3e9c5f232d0e2a51ad6a7e5.tar.gz |
More cleanup.
Diffstat (limited to 'c/main.c')
-rw-r--r-- | c/main.c | 34 |
1 files changed, 17 insertions, 17 deletions
@@ -5,9 +5,10 @@ #include "resource.h" #include "defs.h" -HFONT g_GUIFont; -HFONT g_GUIFontBold; -HMENU g_hPopupMenu; +HFONT HfNormal; +HFONT HfBold; +HMENU HPopupMenu; +HWND HWnd; static LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM); static INT_PTR CALLBACK AboutDlgProc(HWND, UINT, WPARAM, LPARAM); static int Attach(void); @@ -37,9 +38,9 @@ WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, icc.dwICC = ICC_WIN95_CLASSES; InitCommonControlsEx(&icc); - g_hPopupMenu = LoadMenu(NULL, + HPopupMenu = LoadMenu(NULL, MAKEINTRESOURCE(IDR_POPUPMENU)); - g_hPopupMenu = GetSubMenu(g_hPopupMenu, 0); + HPopupMenu = GetSubMenu(HPopupMenu, 0); wc.cbSize = sizeof(WNDCLASSEX); wc.style = 0; @@ -91,8 +92,9 @@ WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) PostQuitMessage(0); break; case WM_CREATE: - DlvCreate(hWnd); - ElvCreate(hWnd); + HWnd = hWnd; + DlvCreate(); + ElvCreate(); break; case WM_SIZE: UpdateLayout(hWnd); @@ -128,10 +130,10 @@ WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) HWND hElv; int iEpisode; term_t t; - extern int Elv_iSelectedItem; + extern int IElvSelectedItem; hElv = GetDlgItem(hWnd, IDC_EPISODELISTVIEW); - iEpisode = ElvItemEpisode(Elv_iSelectedItem); + iEpisode = ElvItemEpisode(IElvSelectedItem); F(f); t = T(1); @@ -152,7 +154,7 @@ WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) break; case ID_LOOKUP: P("episode_data","retract_episode",1,t); - ElvUpdateName(Elv_iSelectedItem, iEpisode); + ElvUpdateName(IElvSelectedItem, iEpisode); ElvRedraw(); DlvShowEpisode(iEpisode); break; @@ -226,14 +228,14 @@ SetupFonts() m.cbSize = sizeof(NONCLIENTMETRICS); SystemParametersInfo(SPI_GETNONCLIENTMETRICS, sizeof(NONCLIENTMETRICS), &m, 0); - g_GUIFont = CreateFontIndirect(&m.lfMessageFont); + HfNormal = CreateFontIndirect(&m.lfMessageFont); } else { - g_GUIFont = GetStockObject(DEFAULT_GUI_FONT); + HfNormal = GetStockObject(DEFAULT_GUI_FONT); } - GetObject(g_GUIFont, sizeof(LOGFONT), &lf); + GetObject(HfNormal, sizeof(LOGFONT), &lf); lf.lfWeight = FW_BOLD; - g_GUIFontBold = CreateFontIndirect(&lf); + HfBold = CreateFontIndirect(&lf); } /***/ @@ -244,7 +246,7 @@ UpdateLayout(HWND hWnd) HWND hElv, hDlv; int cxColumn, cyDlv; RECT rc; - extern int Elv_iSelectedItem; + extern int IElvSelectedItem; static int cxVScroll = 0; if (cxVScroll == 0) @@ -270,6 +272,4 @@ UpdateLayout(HWND hWnd) cxColumn = ListView_GetColumnWidth(hElv, 0); ListView_SetColumnWidth(hElv, 1, rc.right-cxColumn-cxVScroll-4); - - //ListView_EnsureVisible(hElv, Elv_iSelectedItem, TRUE); } |