Not catching window close in DLL
Posted: Mon Sep 06, 2004 11:08 pm
I am calling a DLL with Blitz3D. The widnow close event does not get caught. I even tried a Window callback, and the callback function never got used. (I had an End command at the beginning of the callback, to test with.)
Global WIN
Global GADGET_KEYS
Global WINDOWCLOSED
Global SVAR.s
ProcedureDLL.l CS_InitProperties(hwnd)
win=OpenWindow(0,0,0,400,300,#PB_Window_TitleBar+#PB_Window_ScreenCentered+#PB_WINDOW_INVISIBLE+#PB_Window_SystemMenu,"Properties")
CreateGadgetList(win)
GADGET_KEYS=StringGadget(#PB_ANY,0,0,400,300,"",#PB_String_Multiline)
CloseGadgetList()
ProcedureReturn win
EndProcedure
ProcedureDLL.l CS_Properties(keys$)
WINDOWCLOSED=0
SetGadgetText(GADGET_KEYS,keys$)
HideWindow(0,0)
Repeat
eventid=WaitWindowEvent()
Select eventid
Case #PB_Event_CloseWindow
WINDOWCLOSED=1
EndSelect
Delay(1)
Until WINDOWCLOSED=1
SVAR.s=GetGadgetText(GADGET_KEYS)
HideWindow(0,1)
ProcedureReturn @SVAR
EndProcedure
Global WIN
Global GADGET_KEYS
Global WINDOWCLOSED
Global SVAR.s
ProcedureDLL.l CS_InitProperties(hwnd)
win=OpenWindow(0,0,0,400,300,#PB_Window_TitleBar+#PB_Window_ScreenCentered+#PB_WINDOW_INVISIBLE+#PB_Window_SystemMenu,"Properties")
CreateGadgetList(win)
GADGET_KEYS=StringGadget(#PB_ANY,0,0,400,300,"",#PB_String_Multiline)
CloseGadgetList()
ProcedureReturn win
EndProcedure
ProcedureDLL.l CS_Properties(keys$)
WINDOWCLOSED=0
SetGadgetText(GADGET_KEYS,keys$)
HideWindow(0,0)
Repeat
eventid=WaitWindowEvent()
Select eventid
Case #PB_Event_CloseWindow
WINDOWCLOSED=1
EndSelect
Delay(1)
Until WINDOWCLOSED=1
SVAR.s=GetGadgetText(GADGET_KEYS)
HideWindow(0,1)
ProcedureReturn @SVAR
EndProcedure