Board index » delphi » Icon for non-visual component
Jim Zubrick
![]() Delphi Developer |
Thu, 03 Jan 2002 03:00:00 GMT
Icon for non-visual component
I've used a freeware TSockets component that uses the code below to
display an icon during the design phase. When running, the icon does disappear, but there's an area that seems to cover up or interfere with visual components. If I'm lucky, there's a place on the form I can put the design icon that's out of the way, but I'd like to do this a bit more professionally....like the Timer design icon or the design icons for all the nonb-visual components that come with the VCL I've looked at the source code for the Timer component, but this doesn't seem to be here. Any help? procedure TSockets.TWMPaint(var msg: TWMPaint); var icon: HIcon; dc: HDC; begin if csDesigning in ComponentState then begin icon := LoadIcon(HInstance,MAKEINTRESOURCE('TSOCKETS')); dc := GetDC(Handle); Width := 32; Height := 32; DrawIcon(dc,0,0,icon); ReleaseDC(Handle,dc); FreeResource(icon); end; ValidateRect(Handle,nil); end; [Gary T. Desrosiers, 1995} And it seems that there's a lot of reliance on the Windows API [all that |