aboutsummaryrefslogtreecommitdiff
path: root/c/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'c/main.c')
-rw-r--r--c/main.c34
1 files changed, 17 insertions, 17 deletions
diff --git a/c/main.c b/c/main.c
index 330101e..82f30a6 100644
--- a/c/main.c
+++ b/c/main.c
@@ -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);
}