Once the focus has been set on a form, there doesn't appear to be any way to
remove it.  I need to do so temporarily, and then restore it.  This is so I
can FrmDrawForm() my own custom "please wait" form, do some work, and then
clean up.

Here's how I do it:

// Get current focus:
wOldFocus = FrmGetFocus( frmP );

if ( wOldFocus)
   // noFocus is undocumented, in Form.h, as 0xffff:
   FrmSetFocus( frmP, noFocus );

// Do my custom form-drawing stuff

if ( wOldFocus )
   // Restore the focus:
   FrmSetFocus( frmP, wOldFocus );

If I fail to do this, and the old form happened to have a blinking cursor on
a field with the focus before I do my drawing stuff, then I get a cursor
artifact in my temporary "please wait" form.

Is there a Better Way to do this?  Or perhaps a FrmUnsetFocus() function I
didn't catch?

Thanks,
-Jeff Ishaq
The Windward Group

Reply via email to