psidex
psidex

Reputation: 465

Is there a function like ExtractIconEx but for in-memory data instead of from a file

In the zserge/tray project, in the windows tray_update function, the ExtractIconEx function is used to construct the icon handle (HICON icon). The function is passed tray->icon as the first argument, which is a string that points to a .ico file.

My question is, is there a function to get an icon handle using data from a variable (i.e. storing the binary of the .ico file in an array)?

Example of storing file data in array:

unsigned char rawIconData[] = {
  0x12, 0x34, // ...
};

Upvotes: 0

Views: 218

Answers (1)

Ben Voigt
Ben Voigt

Reputation: 283901

There is CreateIconFromResourceEx, but it will only give you one icon size (you can choose which) instead of returning an array of icons as ExtractIconEx does.

Upvotes: 1

Related Questions