Microsoft KB Archive/124348

= FIX: Exiting ON SHUTDOWN Window Disables GET Objects =

Article ID: 124348

Article Last Modified on 12/3/2003

-

APPLIES TO


 * Microsoft Visual FoxPro 3.0 Standard Edition
 * Microsoft FoxPro 2.5a
 * Microsoft FoxPro 2.5b
 * Microsoft FoxPro 2.6 Standard Edition
 * Microsoft FoxPro 2.6a Standard Edition

-



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.



Steps to Reproduce Problem
  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  Press ALT+F4 to invoke ON SHUTDOWN. 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 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 in place of RELEASE WINDOW allows the GETS to work as expected.

Additional query words: 3.00 2.50a 2.50b 2.60 2.60a

Keywords: kbbug kbfix kbvfp500fix KB124348

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.