--- In [email protected], "Sheri" <sheri...@...> wrote: > > > I bunch of messages ago everyone agreed WM_GETFONT probably didn't > > work across process boundaries, cause it required passing a point to a > > LOGFONT struct. But try this: > > > > local sTitle = "Untitled - Notepad" > > local sApp = "notepad.exe" > > local sctrlClass = "c=Edit" > > > > do(sApp) > > wait.for(500) > > local hHan = win.childhandlelist(sTitle, sctrlClass) > > win.debug(hHan) > > > > win.debug("Font of notepad edit control: " ++ dialog.get_value(hHan, > > "font")) > > > > For me returns Lucida Sans. Which seems to suggest it's correctly > > picking up font of edit box. How? Don't ask me. > > Works for me too. I think we had only previously tried set_font on a > window in another process. I believe I read somewhere that if a GDI > pointer is returned across process you will lose whatever happened to > be in a like handle if one existed. ?
Got me. Hadn't heard that. I haven't experimetned with set_font across process boundaries. There are all sorts of other issues involved with messing with a font used by a foreign process. Even if it can be done, that process is no longer necessarily aware what font it's using. Dangerous. But will test anyway. > You didn't mention the resource issue. Its definitely much improved, > but there is still a GDI leak. Oh yeah, that. > I noticed soon after posting the htm file that GDIView's detail > doesn't always add up to the "All GDI" total shown. The "All GDI" > figure does agree with "GDI Objects" available in Task Manager (at > least in XP). I wrote the author, but have not received a reply; I > suspect he should be plugging the difference between "All GDI" and the > sum of the detail items into "Other GDI". > > For following stuff I was running empty.pcf. > > After the first run of regexdialog, "All GDI" now goes up by 65 I > think. Subsequent runs it increases by 8. I ran regexdialog (followed > its onQuit function), and in a loop set to process 1300 times. At some > point it gave this error (in a window which was only partially drawn): > > ERROR: dialog.create: Can't load image, icon;bad file name? line 5 > > In GDIView, "All GDI" was maxed out for powerpro, but none of the > detail items looked bad. > > I had downloaded another GDI audit tool called bear.exe > <http://www.geocities.com/the_real_sz/misc/Bear.zip> Thanks, I'll have a look. > Not as handy as GDIView and no documentation, but it does give some > additional information. > After canceling the above error, below are the figures bear had for > powerpro. Notice the high "Icon/Cursor" figure. Its more than half of > the total GDI. Okay, thanks, I'll chase down icons and cursors. Quite likely I haven't been cleaning up after myself. The version you have of dialog plugin will mess up choose_font. I got that fixed, and I think I have code worinking okay for richedit controls, but haven;t yet tried non-local ones. Unfortunately I just changed locations and left the archive behind, so will post it next week.
