home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.os.ms-windows.programmer.misc
- Path: sparky!uunet!usc!cs.utexas.edu!torn!maccs!howard
- From: howard@maccs.dcss.mcmaster.ca (Howard Betel)
- Subject: Help with dialog msgs, please
- Message-ID: <1992Aug31.023637.28589@maccs.dcss.mcmaster.ca>
- Organization: Department of Computer Science, McMaster University
- Date: Mon, 31 Aug 1992 02:36:37 GMT
- Lines: 67
-
- The following code, was extracted from the case WM_COMMAND section
- of the dialog box. When moving from one edit control to another with both
- fields being empty a EN_KILLFOCUS is sent to both edit controls.
-
- Could someone please help me change the following code so that a
- EN_KILLFOCUS message is sent to the leaving field.
-
- I have been able to determine that it looks like the MessageBox is causing
- a EN_KILLFOCUS message to be sent to the target field.
-
- ----------------------------------------------------------------------------
- case dfEPsword: /* Edit Control */
- switch(HIWORD(lParam))
- {
- case EN_KILLFOCUS:
- GetDlgItemText(hWndDlg, dfEPsword, epsword, 10);
- if (strlen(epsword) != 8)
- /* Check length of EDSNET Current Password */
- {
- MessageBeep(NULL);
- MessageBox(hWndDlg,
- "EDSNET Current Password must be a 8 character alphanumeric string.",
- "EDSNET Current Password",
- MB_ICONHAND|MB_OK);
- SendDlgItemMessage(hWndDlg,
- dfEPsword,
- EM_SETSEL,
- NULL,
- MAKELONG(0, 0x7ffff));
- SetFocus(GetDlgItem(hWndDlg, dfEPsword));
- return FALSE;
- }
- break;
- }
- break;
-
- case dfEAPsword: /* Edit Control */
- switch(HIWORD(lParam))
- {
- case EN_KILLFOCUS:
- GetDlgItemText(hWndDlg, dfEAPsword, eapsword, 10);
- if (strlen(eapsword) != 8)
- /* Check length of EDSNET Alternate Password */
- {
- MessageBeep(NULL);
- MessageBox(hWndDlg,
- "EDSNET Alternate Password must be a 8 character alphanumeric string.",
- "EDSNET Alternate Password",
- MB_ICONHAND|MB_OK);
- SendDlgItemMessage(hWndDlg,
- dfEAPsword,
- EM_SETSEL,
- NULL,
- MAKELONG(0, 0x7ffff));
- SetFocus(GetDlgItem(hWndDlg, dfEAPsword));
- return FALSE;
- }
- break;
- }
- break;
-
- Thanks,
-
- --
- Howard Betel Howard@maccs.dcss.McMaster.CA
- Dept of Computer Science ...!unet!utai!utgpu!maccs!howard
- McMaster University
-