Hi John,
Here are the steps to fix the progress bar sample :
- Add #include <commctrl.h> to define PROGRESS_CLASS
- Practical solution : move int nProgress = 0; to the top of the code - static storage classe definiton in the original code.
- Initialize the missing timer : SetTimer(hwnd, ID_TIMER, 50, NULL);
Asking ChatGPT to design a more sophisticated treeview example failed, the AI suddenly stopped typing the code after some progress :
LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
switch (message)
{
case WM_SIZE:
// Resize treeview control to fit window
MoveWindow(GetDlgItem(g_hWnd, WC_TREEVIEW), 0, 0, LOWORD(lParam), HIWORD(lParam), TRUE);
break;
case WM_NOTIFY:
if (((LPNMHDR)lParam)->code == TVN_ITEMEXPANDING)
{
// Populate subfolders when a node is expanded
LPNMTREEVIEW lpnmtv = (LPN
}
No code after the last line.