View Issue Details

IDProjectCategoryView StatusLast Update
0016356LazarusLCLpublic2010-05-02 14:58
ReporterJ. Gareth Moreton Assigned ToPaul Ishenin  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
Product Version0.9.28.3 (SVN) 
Fixed in Version0.9.29 (SVN) 
Summary0016356: TImage and other icon-using controls don't accept Windows handles.
DescriptionSometimes, you might only have a Windows handle available for an icon - this is especially true if the icon is stored in a resource DLL or is a system icon (e.g. the glyphs seen in message boxes). Any attempt to set the handle property of a controls results in a blank picture, and analysis of LCL code seems to indicate that the feature is unimplemented.

In most cases there are simple workarounds, but for file managers that mimic Windows Explorer, this is an annoying hindrance.
Tagsicon, ListView, vista, win32
Fixed in Revision25024
LazTarget-
WidgetsetWin32/Win64
Attached Files

Activities

Paul Ishenin

2010-04-27 02:27

manager   ~0037041

Please attach a simple test application.

2010-04-27 13:01

 

icontest.ico (137,040 bytes)   
icontest.ico (137,040 bytes)   

2010-04-27 13:01

 

icontest.lpi (4,197 bytes)

2010-04-27 13:01

 

icontest.lpr (413 bytes)

2010-04-27 13:02

 

icontest.rc (280 bytes)   
#define RT_MANIFEST  24
#define CREATEPROCESS_MANIFEST_RESOURCE_ID 1
#define ISOLATIONAWARE_MANIFEST_RESOURCE_ID 2
#define ISOLATIONAWARE_NOSTATICIMPORT_MANIFEST_RESOURCE_ID 3

CREATEPROCESS_MANIFEST_RESOURCE_ID RT_MANIFEST "icontest.manifest"
MAINICON ICON "icontest.ico"
icontest.rc (280 bytes)   

2010-04-27 13:02

 

mainform.lfm (997 bytes)

2010-04-27 13:02

 

mainform.pas (933 bytes)

2010-04-27 13:02

 

mainform.lrs (1,116 bytes)

J. Gareth Moreton

2010-04-27 13:07

reporter   ~0037045

I might have uploaded more files than what was necessary, but hopefully here is a self-contained project that shows the failure of attaching a system icon to a TImage.

I know that comparisons to Delphi aren't the best, but this code would display the exclamation mark icon under Delphi. Is there an alternative means of doing so under Lazarus?

J. Gareth Moreton

2010-04-27 18:44

reporter   ~0037049

My main project is a bit too large and complex to display on here, but I run into a similar problem when trying to add icons via their handles to a TImageList.

Anton Kavalenka

2010-04-28 09:34

reporter   ~0037054

TImageList.AddIcon is not implemented only AddBitmap works

Paul Ishenin

2010-04-28 10:53

manager   ~0037056

Please test and close if ok.

J. Gareth Moreton

2010-04-29 20:04

reporter   ~0037102

TImage now works like a charm - thanks very much. TImageList still needs the missing functionality implemented though.

J. Gareth Moreton

2010-05-02 14:58

reporter   ~0037158

We'll deal with TImageList another day, I figure! Thanks again for fixing TImage.

Issue History

Date Modified Username Field Change
2010-04-27 02:22 J. Gareth Moreton New Issue
2010-04-27 02:22 J. Gareth Moreton Widgetset => Win32/Win64
2010-04-27 02:25 J. Gareth Moreton Tag Attached: icon
2010-04-27 02:25 J. Gareth Moreton Tag Attached: ListView
2010-04-27 02:25 J. Gareth Moreton Tag Attached: vista
2010-04-27 02:25 J. Gareth Moreton Tag Attached: win32
2010-04-27 02:27 Paul Ishenin LazTarget => -
2010-04-27 02:27 Paul Ishenin Note Added: 0037041
2010-04-27 02:27 Paul Ishenin Status new => feedback
2010-04-27 13:01 J. Gareth Moreton File Added: icontest.ico
2010-04-27 13:01 J. Gareth Moreton File Added: icontest.lpi
2010-04-27 13:01 J. Gareth Moreton File Added: icontest.lpr
2010-04-27 13:02 J. Gareth Moreton File Added: icontest.rc
2010-04-27 13:02 J. Gareth Moreton File Added: mainform.lfm
2010-04-27 13:02 J. Gareth Moreton File Added: mainform.pas
2010-04-27 13:02 J. Gareth Moreton File Added: mainform.lrs
2010-04-27 13:07 J. Gareth Moreton Note Added: 0037045
2010-04-27 18:44 J. Gareth Moreton Note Added: 0037049
2010-04-28 09:34 Anton Kavalenka Note Added: 0037054
2010-04-28 10:53 Paul Ishenin Fixed in Revision => 25024
2010-04-28 10:53 Paul Ishenin Status feedback => resolved
2010-04-28 10:53 Paul Ishenin Fixed in Version => 0.9.29 (SVN)
2010-04-28 10:53 Paul Ishenin Resolution open => fixed
2010-04-28 10:53 Paul Ishenin Assigned To => Paul Ishenin
2010-04-28 10:53 Paul Ishenin Note Added: 0037056
2010-04-28 11:07 Dmitry Boyarintsev Status resolved => assigned
2010-04-28 11:07 Dmitry Boyarintsev Assigned To Paul Ishenin => Dmitry Boyarintsev
2010-04-28 11:08 Dmitry Boyarintsev Assigned To Dmitry Boyarintsev => Paul Ishenin
2010-04-28 11:12 Dmitry Boyarintsev Status assigned => resolved
2010-04-29 20:04 J. Gareth Moreton Note Added: 0037102
2010-05-02 14:58 J. Gareth Moreton Status resolved => closed
2010-05-02 14:58 J. Gareth Moreton Note Added: 0037158