Todo List - CPP
Todo List - CPP
h>
#include <string>
#include <vector>
#include <tuple>
#include "database.h"
// Window procedure
LRESULT CALLBACK TodoListProc(HWND hwnd, UINT msg, WPARAM wParam,
LPARAM lParam) {
switch (msg) {
case WM_CREATE:
CreateWindowW(L"STATIC", L"To-Do List", WS_CHILD | WS_VISIBLE,
20, 10, 200, 20, hwnd, nullptr, nullptr, nullptr);
case WM_COMMAND:
if (LOWORD(wParam) == 1002) { // Show Tasks button
std::string date = GetTextFromHWND(hDateInput);
LoadTasksForDate(hwnd, date);
}
break;
case WM_DESTROY:
PostQuitMessage(0);
break;
default:
return DefWindowProcW(hwnd, msg, wParam, lParam);
}
return 0;
}
WNDCLASSW wc = {};
wc.lpfnWndProc = TodoListProc;
wc.hInstance = hInstance;
wc.lpszClassName = CLASS_NAME;
RegisterClassW(&wc);
ShowWindow(hwnd, SW_SHOW);
UpdateWindow(hwnd);
}