Bug fixes and reorganization of code.

This commit is contained in:
ak47 committed 2026-10-10 22:27:12 -04:00
1 parent 5f78168c57
commit cbce83581a
10 files changed
+148 -81

No files matched your search

+13 -8
View File
@@ -4,7 +4,7 @@
#include <windows.h>
#include <commctrl.h>
static HWND tabs, atlTabs, tree, combo, edit, button;
static HWND tabs, atlTabs, tree, combo, edit, button, list;
static HTREEITEM root;
static int step;
@@ -35,6 +35,7 @@ static LRESULT CALLBACK window_proc(HWND window, UINT message, WPARAM wp, LPARAM
case 14: SendMessageW(atlTabs, TCM_DELETEALLITEMS, 0, 0); break;
case 15: focus_control(tree); break;
case 16: SendMessageW(tree, TVM_DELETEITEM, 0, (LPARAM)TVI_ROOT); break;
case 17: focus_control(list); break;
default: DestroyWindow(window); break;
}
return 0;
@@ -52,7 +53,7 @@ int WINAPI WinMain(HINSTANCE instance, HINSTANCE previous, LPSTR args, int show)
cls.lpszClassName = L"WineAccessControlsFixture";
cls.lpfnWndProc = window_proc;
RegisterClassW(&cls);
HWND window = CreateWindowW(cls.lpszClassName, L"Wine controls fixture", WS_OVERLAPPEDWINDOW,
HWND window = CreateWindowW(cls.lpszClassName, L"Wine & controls fixture", WS_OVERLAPPEDWINDOW,
120, 120, 700, 440, NULL, NULL, instance, NULL);
WNDCLASSEXW tabClass = {0};
tabClass.cbSize = sizeof(tabClass);
@@ -86,20 +87,24 @@ int WINAPI WinMain(HINSTANCE instance, HINSTANCE previous, LPSTR args, int show)
node.item.pszText = L"Artist & album β";
SendMessageW(tree, TVM_INSERTITEMW, 0, (LPARAM)&node);
SendMessageW(tree, TVM_SELECTITEM, TVGN_CARET, (LPARAM)root);
button = CreateWindowW(L"Button", L"Named native button", WS_CHILD | WS_VISIBLE | WS_TABSTOP,
button = CreateWindowW(L"Button", L"&Named && native button", WS_CHILD | WS_VISIBLE | WS_TABSTOP,
10, 310, 250, 30, window, NULL, instance, NULL);
combo = CreateWindowW(L"ComboBox", L"", WS_CHILD | WS_VISIBLE | WS_TABSTOP | CBS_DROPDOWNLIST,
390, 110, 200, 150, window, NULL, instance, NULL);
SendMessageW(combo, CB_ADDSTRING, 0, (LPARAM)L"by artist");
SendMessageW(combo, CB_ADDSTRING, 0, (LPARAM)L"by year");
SendMessageW(combo, CB_ADDSTRING, 0, (LPARAM)L"artist & album");
SendMessageW(combo, CB_ADDSTRING, 0, (LPARAM)L"year && date");
SendMessageW(combo, CB_SETCURSEL, 0, 0);
edit = CreateWindowW(L"Edit", L"search", WS_CHILD | WS_VISIBLE | WS_TABSTOP,
edit = CreateWindowW(L"Edit", L"search & find", WS_CHILD | WS_VISIBLE | WS_TABSTOP,
390, 170, 200, 25, window, NULL, instance, NULL);
// Labels are deliberately created after their fields, like foobar2000.
CreateWindowW(L"Static", L"View:", WS_CHILD | WS_VISIBLE,
CreateWindowW(L"Static", L"&View && sort:", WS_CHILD | WS_VISIBLE,
330, 110, 50, 25, window, NULL, instance, NULL);
CreateWindowW(L"Static", L"Filter:", WS_CHILD | WS_VISIBLE,
CreateWindowW(L"Static", L"Filter & query:", WS_CHILD | WS_VISIBLE | SS_NOPREFIX,
330, 170, 50, 25, window, NULL, instance, NULL);
list = CreateWindowW(L"ListBox", L"", WS_CHILD | WS_VISIBLE | WS_TABSTOP,
390, 220, 200, 80, window, NULL, instance, NULL);
SendMessageW(list, LB_ADDSTRING, 0, (LPARAM)L"Rock & roll && blues");
SendMessageW(list, LB_SETCURSEL, 0, 0);
ShowWindow(window, SW_SHOW);
SetForegroundWindow(window);
focus_control(tabs);