[Solved] Show Yes/No messagebox where No is grayed out win32api C++ [closed]
Use SetWindowsHookEx() or SetWinEventHook() with a thread-local hook to capture the MessageBox() dialog’s HWND, then you can use EnableWindow() to disable the button. Here is how to do it using SetWindowsHookEx(): HHOOK hHook = NULL; LRESULT CALLBACK CBTProc(int nCode, WPARAM wParam, LPARAM lParam) { if( nCode == HCBT_ACTIVATE ) { HWND hDlg = (HWND) wParam; … Read more