summaryrefslogtreecommitdiff
path: root/widgetfactory.cpp
diff options
context:
space:
mode:
authorJonas Kümmerlin <jonas@kuemmerlin.eu>2018-12-29 12:23:43 +0100
committerJonas Kümmerlin <jonas@kuemmerlin.eu>2018-12-29 12:23:43 +0100
commit388c42454ad593f8c201a0bc7c2b1bd18f21b1fe (patch)
tree263717f8292ad5161969cb4fd584c6564283ebcb /widgetfactory.cpp
parent8ead043a524ffedc634663779a49730cc5da8d97 (diff)
make it build with ansi
it now actually works on Win95. WOHOO!
Diffstat (limited to 'widgetfactory.cpp')
-rw-r--r--widgetfactory.cpp21
1 files changed, 13 insertions, 8 deletions
diff --git a/widgetfactory.cpp b/widgetfactory.cpp
index 631326c..6259f17 100644
--- a/widgetfactory.cpp
+++ b/widgetfactory.cpp
@@ -46,7 +46,12 @@ handleMessage(void *closure, HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)
}
int CALLBACK
-wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR lpCmdLine, int nCmdShow)
+#ifdef UNICODE
+wWinMain
+#else
+WinMain
+#endif
+(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int nCmdShow)
{
(void)hPrevInstance;
(void)lpCmdLine;
@@ -71,11 +76,11 @@ wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR lpCmdLine, int nCm
HWND win = ALF_InstantiateWindow(app, clazz, NULL, NULL);
- ALF_AddLabel(win, ID_LBL2, 1, 0, L"Hello, 2!\nblub");
+ ALF_AddLabel(win, ID_LBL2, 1, 0, TEXT("Hello, 2!\nblub"));
HWND hwndLabel = CreateWindow(
- L"STATIC",
- L"Hello World!",
+ TEXT("STATIC"),
+ TEXT("Hello World!"),
WS_CHILD | WS_VISIBLE | SS_LEFT,
0, 0, 50, 25,
win,
@@ -84,12 +89,12 @@ wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR lpCmdLine, int nCm
NULL);
ALF_AddWidget(win, 0, 0, hwndLabel, 5000, 1000, ALF_MESSAGEFONT);
- ALF_AddLabel(win, ID_LBL3, 0, 1, L"Good Morning my &Angel!");
+ ALF_AddLabel(win, ID_LBL3, 0, 1, TEXT("Good Morning my &Angel!"));
- ALF_AddEdit(win, ID_ED1, 1, 1, L"Happy Birthday!");
+ ALF_AddEdit(win, ID_ED1, 1, 1, TEXT("Happy Birthday!"));
- ALF_AddButton(win, ID_B1, 2, 1, L"&Go!");
- ALF_AddButton(win, ID_B2, 0, 2, L"Oh m&y god,\r\nwho the hell cares?");
+ ALF_AddButton(win, ID_B1, 2, 1, TEXT("&Go!"));
+ ALF_AddButton(win, ID_B2, 0, 2, TEXT("Oh m&y god,\r\nwho the hell cares?"));
ALF_RecalculateLayout(win);
ALF_SetDefaultButton(win, ID_B1);