Zhiyi Zhang (@zhiyi) commented about dlls/comctl32/tests/treeview.c:
- pt.y = (rc.top + rc.bottom) / 2;
- ClientToScreen(hMainWnd, &pt);
- GetCursorPos(&orig_pos);
- SetCursorPos(pt.x, pt.y);
- ScreenToClient(treeview, &pt);
- flush_events();
- flush_sequences(sequences, NUM_MSG_SEQUENCES);
- PostMessageA(treeview, WM_LBUTTONDOWN, MK_LBUTTON, MAKELPARAM(pt.x, pt.y));
- PostMessageA(treeview, WM_LBUTTONUP, 0, MAKELPARAM(pt.x, pt.y));
- while (GetMessageA(&msg, 0, 0, 0))
- {
TranslateMessage(&msg);
DispatchMessageA(&msg);
if((msg.hwnd == treeview) && (msg.message == WM_LBUTTONDOWN))
Space after if. Actually, I think you can delete the whole while loop. You have a flush_events() afterwards, and DestroyWindow() is called when handling NM_CLICK. I don't think the while loop is necessary.