summaryrefslogtreecommitdiff
path: root/prev/init_windows.c
diff options
context:
space:
mode:
authorPietro Gagliardi <[email protected]>2016-05-30 00:14:46 -0400
committerPietro Gagliardi <[email protected]>2016-05-30 00:14:46 -0400
commit52f7d276a6bb04b8827ac019ad1e135b43819cea (patch)
tree5f0ebbfdf5885ef832e77e243b5916e59f46ba18 /prev/init_windows.c
parentc9b32c1333e4009b342eedc5f5b39127a724fb42 (diff)
Removed prev/.
Diffstat (limited to 'prev/init_windows.c')
-rw-r--r--prev/init_windows.c73
1 files changed, 0 insertions, 73 deletions
diff --git a/prev/init_windows.c b/prev/init_windows.c
deleted file mode 100644
index 4b35fc3..0000000
--- a/prev/init_windows.c
+++ /dev/null
@@ -1,73 +0,0 @@
-// 17 july 2014
-
-#include "winapi_windows.h"
-
-HINSTANCE hInstance;
-int nCmdShow;
-
-HICON hDefaultIcon;
-HCURSOR hArrowCursor;
-
-HFONT controlFont;
-HFONT titleFont;
-HFONT smallTitleFont;
-HFONT menubarFont;
-HFONT statusbarFont;
-
-HBRUSH hollowBrush;
-
-DWORD initWindows(char **errmsg)
-{
- STARTUPINFOW si;
- NONCLIENTMETRICSW ncm;
-
- // WinMain() parameters
- hInstance = GetModuleHandleW(NULL);
- if (hInstance == NULL) {
- *errmsg = "error getting hInstance";
- return GetLastError();
- }
- nCmdShow = SW_SHOWDEFAULT;
- GetStartupInfoW(&si);
- if ((si.dwFlags & STARTF_USESHOWWINDOW) != 0)
- nCmdShow = si.wShowWindow;
-
- // icons and cursors
- hDefaultIcon = LoadIconW(NULL, IDI_APPLICATION);
- if (hDefaultIcon == NULL) {
- *errmsg = "error loading default icon";
- return GetLastError();
- }
- hArrowCursor = LoadCursorW(NULL, IDC_ARROW);
- if (hArrowCursor == NULL) {
- *errmsg = "error loading arrow (default) cursor";
- return GetLastError();
- }
-
- // standard fonts
-#define GETFONT(l, f, n) l = CreateFontIndirectW(&ncm.f); \
- if (l == NULL) { \
- *errmsg = "error loading " n " font"; \
- return GetLastError(); \
- }
-
- ZeroMemory(&ncm, sizeof (NONCLIENTMETRICSW));
- ncm.cbSize = sizeof (NONCLIENTMETRICSW);
- if (SystemParametersInfoW(SPI_GETNONCLIENTMETRICS, sizeof (NONCLIENTMETRICSW), &ncm, sizeof (NONCLIENTMETRICSW)) == 0) {
- *errmsg = "error getting non-client metrics parameters";
- return GetLastError();
- }
- GETFONT(controlFont, lfMessageFont, "control");
- GETFONT(titleFont, lfCaptionFont, "titlebar");
- GETFONT(smallTitleFont, lfSmCaptionFont, "small title bar");
- GETFONT(menubarFont, lfMenuFont, "menu bar");
- GETFONT(statusbarFont, lfStatusFont, "status bar");
-
- hollowBrush = GetStockObject(HOLLOW_BRUSH);
- if (hollowBrush == NULL) {
- *errmsg = "error getting hollow brush";
- return GetLastError();
- }
-
- return 0;
-}