FIX: Exiting ON SHUTDOWN Window Disables GET Objects (124348)



The information in this article applies to:

  • Microsoft Visual FoxPro for Windows 3.0
  • Microsoft FoxPro for Windows 2.5a
  • Microsoft FoxPro for Windows 2.5b
  • Microsoft FoxPro for Windows 2.6
  • Microsoft FoxPro for Windows 2.6a

This article was previously published under Q124348

SYMPTOMS

If an ON SHUTDOWN procedure calls a window that is then exited, the mouse can only access the current GET object in the READ that was active when the ON SHUTDOWN procedure was called.

CAUSE

Control is not passed from the ON SHUTDOWN procedure back to the previous READ level if the RELEASE WINDOW command is used.

WORKAROUND

Replace the "RELEASE WINDOW window1" command with the "DEACTIVATE WINDOW window1" command to send control back to the previous screen.

STATUS

Microsoft has confirmed this to be a problem in the Microsoft products listed at the beginning of this article. This problem has been fixed in Visual FoxPro 5.0 for Windows.

MORE INFORMATION

Steps to Reproduce Problem

  1. Create a program containing the following commands, and run it:
       ON SHUTDOWN DO shutdialog
    
       mbutton = 1
       @ 10, 10 GET mbutton ;
          PICTURE "@*HN Button1; Button2" ;
          SIZE 2, 12, 2
       READ CYCLE
       ON SHUTDOWN         && To clear the setting
    
       PROCEDURE shutdialog
       DEFINE WINDOW window1 FROM 0,0 TO 4,45
       ACTIVATE WINDOW window1
       @ 1,2 SAY 'Type "q" To Quit Or Any Key To Continue:'
       mwindow1=INKEY(0,"H")
    
       IF mwindow1=113 or mwindow1=81     && INKEY() values for "q" and "Q"
          QUIT
       ELSE
          RELEASE WINDOW window1   && Becomes DEACTIVATE WINDOW window1
       ENDIF
    						
  2. Press ALT+F4 to invoke ON SHUTDOWN.
  3. Press a key other than q to exit the ON SHUTDOWN window. The mouse will only access the GET object which was active when ON SHUTDOWN was called. Moving between GET objects with the cursor keys will allow the object that has the focus to be accessed with the mouse.
The RELEASE WINDOW <windowname> command does not release the window. This can be verified by going into the Window menu and seeing Window1 even after the RELEASE WINDOW command has been executed. However, the RELEASE WINDOW command releases the window correctly if executed outside the ON SHUTDOWN procedure.

Using DEACTIVATE WINDOW <windowname> in place of RELEASE WINDOW allows the GETS to work as expected.

Modification Type:MajorLast Reviewed:12/3/2003
Keywords:kbBug kbfix kbvfp500fix KB124348