FrmDoDialog() has its own event handler--the reason you event handler was 
being called at all was that you accidentally set it as the event handler 
for the previous form (the one that invoked the dialog).  That's why you 
got the WinExit event as the window was exited and the dialog came up.  If 
you want a custom event handler for a dialog, you can't use FrmDoDialog(). 
It's a great function, but this is one limitation.

---

--On Tuesday, January 11, 2000 8:21 AM -0500 Ralph Krausse 
<[EMAIL PROTECTED]> wrote:

> I am trying to set the focus in one of my dialog forms after it displays
> itself. I am using FrmDoDialog to display the dialog so I used
> FrmSetEventHandler(frm,PasswordHandleEvent) to set an event handler.  I
> wanted to setfocus on the frmLoadEvent. When this didn't work, I wanted to
> see if the event was being call so I had the following code.
>
> static Boolean PasswordHandleEvent(EventPtr eventP)
> {
>        Boolean handled = false;
>        FormPtr frmP;
>        switch (eventP->eType)
>        {
>                case frmLoadEvent:
>                {
>                        frmP = FrmGetActiveForm();
>                        MsgBox("a","a");
>                        FrmDrawForm (frmP);
>                        handled = true;
>                }
>                break;
>        }
>        return handled;
>
> }
>
> Just to 'see' if I get the frmLoadEvent, I display a MessageBox ( my
> function ). It seems that I never got to this point. So I inserted
> my MsgBox right prior to the switch statement and displayed the value of
> eventP->eType. This did work so I know the system is calling
> PasswordHandleEvent but eventP->eType was 6 which occording to the docs is
> winExitEvent. What am I doing wrong?
>
> thanks
> -Ralph




Reply via email to