I'm trying to disable a button on a dialog, but I can't seem to retrieve the button handle no matter what I try (Spy++ can see the control and get its ID).
What I have tried:
I can find the dialog handle, and thus get its CWnd. I test changing the dialog title, just to confirm that it isn't protected somehow. I have the control ID from Spy++.
I tried GetDlgItem, FindWindow, FindWndowEx and EnumChildWindows, but just cannot get the button window handle.
Interestingly, EnumChildWindows doesn't find all the children - so what is Spy++ doing that I'm not?