Results 1 to 2 of 2

Thread: API & Unloading MDI forms

  1. #1
    viv
    Guest

    Unhappy

    Anybody for a challenge? This one has beat me.

    Ive got a VB6 project with a HookWindow to capture windows events for an MDI form. Using the X to close the form in Windows98, tool tip 'Close' appears just before the MDI form closes.

    Windows raises an event to erase the background left by the tool tip just before it raises the Deactivate, QueryUnload etc. So basically, the VB is trying to repaint but the form is unloading taking all the resources first so it all goes horribly wrong. When the MDI form completes its unload which should be the end of the exe, the HookWindow cannot be killed because it still has the repaint event pending. This causes the MDI form to relaunch itself when further messages are raised!!

    Can anyone think of a way to stop the repaint event OR to distinguish that its the repaint event from the close button.

    We cant turn the tool tips off 'cause they're in the current user bit of the registry. We cant wait in the QueryUnload till the repaint finishes because once you've pressed the X it doesnt seem to let the repaint event finish anyway, even if you're waiting in code.

  2. #2
    Fanatic Member
    Join Date
    Feb 2000
    Location
    Dunmow,Essex,England
    Posts
    898
    Hi,

    Here's a long shot. You say you cant wait in code, but what have you been using. I think if you use waitforsingleobject API passing it the handle of the form you are closing, then this will throw processing to that form before continuing.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width