Re: GDI ???
- Posted by "Thomas Parslow (PatRat)" <patrat at rat-software.com> Apr 10, 2001
- 449 views
> Hi, > > i'm writing a graphical alarm presentation program (fire ) > > i have to create about 1000 transparent ( i use 4200 as parameter) PushButtons > for the detectors . > then I transblt a Dib above it, this way i get a clickable transparent image > (since icons don't work ok on a bitmap background) > > > I have a problem : > > I can't create 1000 buttons at once , > > Win32lib gives me an error (unable to SaveDC...) > > GDI resource = 0% ????? > > How can i avoid this , i need all of the buttons to work to detect what Dib > was clicked. > > Can i Free GDI resources, without destroying the PushButton ??? > > I tried getDC and ReleaseDC, but still it doesn't work) (Handle error) > > Win2000/NT doesn't have a problem with this only Win95,98,Me > > > Renzo Beggia > Email : renzo.beggia at vsk.be I think I see what the problem is now, before I assumed you where using getDC then not using matching releaseDC's. Your creating invisible buttons to catch clicks, right? Probably what you need to do is catch mouse events yourself: You should use the onMouse and onClick events of the window it's self, then check the mouse position against the position of every icon, find out which one it's within, then perform the appropriate action. Does that make any sense? Thomas Parslow (PatRat) ICQ #:26359483 Rat Software http://www.rat-software.com/ Please leave quoted text in place when replying