With the following code I detect the presence of a window (MyWindow) and if it exists I try to destroy it. MyWindow is created using DO FORM ".\forms\MyWindow"
x is > 0, however, I put a messagebox in the MyWindow's destroy event and that doesn't fire. It only fires when I manually close the form, or when I exit my VFP7 environment.
I'm forgetting something, but I don't know what!
Code:
DECLARE INTEGER FindWindow IN user32;
STRING lpClassName,;
STRING lpWindowName
DECLARE INTEGER DestroyWindow IN user32;
INTEGER hWnd
n = FindWindow(.NULL., "MyWindow")
IF n > 0 THEN
x = DestroyWindow(n)
ENDIF
x is > 0, however, I put a messagebox in the MyWindow's destroy event and that doesn't fire. It only fires when I manually close the form, or when I exit my VFP7 environment.
I'm forgetting something, but I don't know what!