From bce106ce5fd1c0913289caaf74707d6e5d93e4cf Mon Sep 17 00:00:00 2001 From: freedom Date: Mon, 23 Oct 2023 13:46:39 -0600 Subject: [PATCH] more vista-readiness --- progmgr/dialog.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/progmgr/dialog.c b/progmgr/dialog.c index 429bc30..1374cf4 100644 --- a/progmgr/dialog.c +++ b/progmgr/dialog.c @@ -388,13 +388,16 @@ BOOL CALLBACK NewItemDlgProc(HWND hWndDlg, UINT message, WPARAM wParam, LPARAM l // Check that all the applicable fields are filled out, // and if not then set the focus to the offending field if (!(bOKEnabled = GetDlgItemText(hWndDlg, IDD_NAME, (LPWSTR)&szBuffer, ARRAYSIZE(szBuffer)))) - SendDlgItemMessage(hWndDlg, IDD_NAME, EM_TAKEFOCUS, 0, 0); + // SendDlgItemMessage(hWndDlg, IDD_NAME, EM_TAKEFOCUS, 0, 0); + SetFocus(GetDlgItem(hWndDlg, IDD_NAME)); if (!(bOKEnabled = GetDlgItemText(hWndDlg, IDD_PATH, (LPWSTR)&szPathBuffer, ARRAYSIZE(szPathBuffer)))) - SendDlgItemMessage(hWndDlg, IDD_PATH, EM_TAKEFOCUS, 0, 0); + // SendDlgItemMessage(hWndDlg, IDD_PATH, EM_TAKEFOCUS, 0, 0); + SetFocus(GetDlgItem(hWndDlg, IDD_PATH)); if (bWorkPath) { if (!(bOKEnabled = GetDlgItemText(hWndDlg, IDD_WORKPATH, (LPWSTR)&szPathBuffer, ARRAYSIZE(szPathBuffer)))) - SendDlgItemMessage(hWndDlg, IDD_WORKPATH, EM_TAKEFOCUS, 0, 0); + // SendDlgItemMessage(hWndDlg, IDD_WORKPATH, EM_TAKEFOCUS, 0, 0); + SetFocus(GetDlgItem(hWndDlg, IDD_WORKPATH)); } // Enable or disable the OK button based on the information