1. GDI ???
- Posted by renzo <renzo.beggia at vsk.be> Apr 10, 2001
- 453 views
This is a multi-part message in MIME format. ------=_NextPart_000_0017_01C0C1E9.51306240 boundary="----=_NextPart_001_0018_01C0C1E9.51306240" ------=_NextPart_001_0018_01C0C1E9.51306240 charset="Windows-1252" Glacier Hi,=20 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 ,=20 Win32lib gives me an error (unable to SaveDC...) GDI resource =3D 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 ------=_NextPart_001_0018_01C0C1E9.51306240 Content-Type: text/html; charset="Windows-1252" Content-Transfer-Encoding: quoted-printable <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML><HEAD><TITLE>Glacier</TITLE> <META content=3D"text/html; charset=3Dwindows-1252" = http-equiv=3DContent-Type><BASE=20 href=3D"file://C:\Program Files\Common Files\Microsoft = Shared\Stationery\"> <STYLE>BODY { COLOR: #006666; FONT-FAMILY: Arial, Helvetica; FONT-SIZE: 10pt; = MARGIN-LEFT: 50px; MARGIN-TOP: 20px } </STYLE> <META content=3D"MSHTML 5.00.3103.1000" name=3DGENERATOR></HEAD> <BODY background=3Dcid:001601c0c1d8$8da48500$8c00000a@BEGGIA = bgColor=3D#ffffff> <DIV> </DIV> <DIV>Hi, </DIV> <DIV> </DIV> <DIV>i'm writing a graphical alarm presentation program (fire )</DIV> <DIV> </DIV> <DIV>i have to create about 1000 transparent ( i use 4200 as parameter)=20 PushButtons for the detectors .</DIV> <DIV>then I transblt a Dib above it, this way i get a clickable = transparent=20 image (since icons don't work ok on a bitmap background)</DIV> <DIV> </DIV> <DIV> </DIV> <DIV>I have a problem :</DIV> <DIV> </DIV> <DIV>I can't create 1000 buttons at once , </DIV> <DIV> </DIV> <DIV>Win32lib gives me an error (unable to SaveDC...)</DIV> <DIV> </DIV> <DIV>GDI resource =3D 0% ?????</DIV> <DIV> </DIV> <DIV>How can i avoid this , i need all of the buttons to work to detect = what=20 Dib was clicked.</DIV> <DIV> </DIV> <DIV>Can i Free GDI resources, without destroying the PushButton = ???</DIV> <DIV> </DIV> <DIV>I tried getDC and ReleaseDC, but still it doesn't work) (Handle=20 error)</DIV> <DIV> </DIV> <DIV>Win2000/NT doesn't have a problem with this only Win95,98,Me</DIV> <DIV> </DIV> <DIV> </DIV> <DIV>Renzo Beggia<BR>Email : <A=20 href=3D"mailto:renzo.beggia at vsk.be">renzo.beggia at vsk.be</A></DIV> ------=_NextPart_001_0018_01C0C1E9.51306240-- ------=_NextPart_000_0017_01C0C1E9.51306240 Content-Type: image/jpeg; name="Glacier Bkgrd.jpg" Content-Transfer-Encoding: base64
2. Re: GDI ???
- Posted by "Thomas Parslow (PatRat)" <patrat at rat-software.com> Apr 10, 2001
- 451 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