Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 191
  • Last Modified:

Adding Images into the System ImageList ?

I would like to extract the ImageIndex of same Files and show them with the System Image List.

But i need same additional Images. How can i add Images ?

Thanxs
0
Andi4553
Asked:
Andi4553
  • 5
  • 4
  • 2
  • +1
2 Solutions
 
robert_marquardtCommented:
It would help if you define what you understand by "system ImageList"
0
 
Andi4553Author Commented:
It's the System Image List from SHGetFileInfo

The extraction of the ImageIndex of the Files works fine, but i need to show same additional Images, and i don't know how i can add them to the system Image list.
0
 
robert_marquardtCommented:
From MSDN SHGetFileInfo:

Note: Once you have a handle to a system image list, you can use the Image List API to manipulate it like any other image list. Because system image lists are created on a per-process basis, you should treat them as read-only objects. Writing to a system image list may overwrite or delete one of the system images, making it unavailable or incorrect for the remainder of the process.
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
Andi4553Author Commented:
This doesn't help me !
0
 
Slick812Commented:
hello Andi4553, I agree with robert, the System creates and uses it's System Image List, so if you change it then the system may not use it correctly, or overwrite your changes when it changes the list. . .  What are you trying to do that you think you need to change the System Image List?, , , There's probally some other ways to do it. . . . . You might create your own ImageList and use that for addition Images. . . Look at TImageList
0
 
Andi4553Author Commented:
I have a TVirtualTreeView (similar to a TListView)
In this list, i show same Files AND i would like to show same "virtual" Links
And the images for this virtual Links are stored in a second ImageList.
0
 
Slick812Commented:
You might assign the "virtual" links Item List Numbers to unusual numbers (for intance maybe negative numbers or very large numbers) and then just do a Test for for negative numbers (or large number) and then use your own ImageList instead of the System ImageList

if ListNumber < 0 then
UseMyImageList(-ListNumber) else
UseSysList(ListNumber);


or maybe

if ListNumber > 665000 then
UseMyImageList(ListNumber-665000) else
UseSysList(ListNumber);
0
 
Andi4553Author Commented:
But how can i use two ImageList in one Component ?
I only have one ImageList and for every Node an ImageIndex !
0
 
Slick812Commented:
there's many ways to do this sort of thing. . . can you show some code? Can you show code for How the ImageIndex is obtained from the Tree for it to get the Image needed, do you use file system reference, like the File Path to get an ImageIndex, or do you set the ImageIndex when the node is created?
0
 
Andi4553Author Commented:
This is the code for the TVirtualStringTree

procedure TDBFileExplorer.DoGetImageIndex(Node: PVirtualNode; Kind: TVTImageKind; Column: TColumnIndex; var Ghosted: Boolean; var Index: Integer);
var tempFI      : PFileInfo;
begin
    if Column <> 0 then exit;

    tempFI      := GetNodeData(Node);

    if not(Kind in [ikNormal, ikSelected]) then exit;
    Index       := tempFI^.ImageIndex;
end;



The ImageIndex is received at the Create of the TFileInfo class and is the Index of the System Image List.
0
 
Slick812Commented:
would you know how the values for

tempFI^.ImageIndex

are set???

how do you add your tempFI^.ImageIndex  for your    "virtual" Links    nodes???
0
 
CleanupPingCommented:
Andi4553:
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
EXPERTS:
Post your closing recommendations!  No comment means you don't care.
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 5
  • 4
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now