diff options
Diffstat (limited to 'widgetfactory.cpp')
| -rw-r--r-- | widgetfactory.cpp | 22 |
1 files changed, 9 insertions, 13 deletions
diff --git a/widgetfactory.cpp b/widgetfactory.cpp index 8cdc6a4..e4dc214 100644 --- a/widgetfactory.cpp +++ b/widgetfactory.cpp @@ -20,7 +20,7 @@ static const TCHAR *g_paneLabels[PANE__MAX] = { }; enum { - ID_COMBO1 = 2, + ID_COMBO1 = 100, ID_COMBO2, ID_LBLCOMBOTEXT, ID_BTNCOMBOCLEAR, @@ -779,7 +779,6 @@ addPaneToNotebook(HWND hwndNotebook, int paneId) g_paneInitTable[paneId](panel); } - static LRESULT handleCommand(void *closure, HWND window, WORD notificationcode, WORD sourceid, HWND control) { @@ -856,6 +855,7 @@ WinMain (void)hPrevInstance; (void)lpCmdLine; (void)nCmdShow; + (void)hInstance; ALF_SetDpiAwareness(ALF_DPI_AWARENESS_PER_MONITOR_AWARE_V2); @@ -866,21 +866,18 @@ WinMain } } - ALFWindowClassParams cparams; - ZeroMemory(&cparams, sizeof(cparams)); + ALFWindowVTable vtbl; + ZeroMemory(&vtbl, sizeof(vtbl)); - //cparams.className = TEXT("DummyClass"); - cparams.vtbl.command = handleCommand; + vtbl.command = handleCommand; ALF_Initialize(); - LPCTSTR clazz = ALF_RegisterWindowClass(hInstance, &cparams); - if (!clazz) - MessageBox(0, TEXT("couldn't create window class!"), 0, MB_ICONHAND|MB_OK); - - HWND win = ALF_InstantiateWindow(hInstance, clazz, NULL, NULL); - if (!win) + HWND win = ALF_CreateToplevelWindow(NULL, &vtbl, NULL); + if (!win) { MessageBox(0, TEXT("couldn't create main window!"), 0, MB_ICONHAND|MB_OK); + return 1; + } HWND hwndNtbk = ALF_AddNotebook(win, ID_NOTEBOOK, 1, 1); @@ -942,7 +939,6 @@ WinMain ALF_ShowModal(win); ALF_DestroyWindow(win); - ALF_UnregisterWindowClass(hInstance, clazz); ALF_UnInitialize(); return 0; |
