#ifndef __TWIN32__
#ifdef __GNUWIN32__
+#ifndef wxUSE_NORLANDER_HEADERS
#include <wx/msw/gnuwin32/extra.h>
#endif
#endif
+#endif
#ifdef __SALFORDC__
#include <shellapi.h>
win = new wxFrame(NULL, -1, "", wxPoint(x,y), wxSize(-1,-1), 0);
win->PushEventHandler(this);
+ // Remove from record of top-level windows, or will confuse wxWindows
+ // if we try to exit right now.
+ wxTopLevelWindows.DeleteObject(win);
+
rval = win->PopupMenu(menu, 0, 0);
win->PopEventHandler(FALSE);
win->Destroy();
+ delete win;
+
return rval;
}