--- In [email protected], "brucexs" <bswit...@...> wrote:
>
> --- In [email protected], "Sheri" <sherip99@> wrote:
> >
> > I imagine the issue of needing to destroy fonts also exists with
> > the PowerPro Debug window and the other script debugger.
> 
> Not sure why you are including me in the title for this question.  
> 
> You are correct that fonts need to be destroyed when you are done
> with them. 
> 
> I am pretty sure that closing a window does not automatically
> destroy any fonts associated with that window. 

The event I suggested to Alan probably is overly complex, I think a
simple loop at close time would do the job. In lieu of that, I've just
added a caption button to my altered Debug Window to run this bit
which (hopefully) does the deed.

@KillDebugFonts
local WM_GETFONT=49
local dll_status
local hWin=win.handle("PowerPro Debug")
local debugctrls=win.childhandlelist(hWin)
For each word debugitem in debugctrls
local fonthandle=win.sendmessage(debugitem, WM_GETFONT, 0, 0)
dll.call("DeleteObject|ui",fonthandle)
endfor
win.close("PowerPro Debug")
quit

I ran the above with the window showing and without the win.close, and
the text changed to system font so I know it did something. But if I
rerun the WM_GETFONT messages, the same fonthandle numbers continue to
be returned so possibly there is more to do.

Regards,
Sheri

Reply via email to