2

The Windows 7 UX guide has nice illustrations and examples of icons, but I really can't find them in the SDK. Are they hiding somewhere, or are they not available ?

Andreas Rejbrand
  • 105,602
  • 8
  • 282
  • 384
mmmm
  • 2,431
  • 2
  • 35
  • 56

2 Answers2

6

If you are talking about the common UI icons, then you are supposed to get them programmatically. For instance, you can use

var
  errIcon: HICON;
begin
  errIcon := LoadIcon(0, IDI_ERROR);
  DrawIcon(Canvas.Handle, 10, 10, errIcon),

(Delphi code) to draw an error icon.

Windows UI standard icons

See LoadIcon, DrawIcon at MSDN. You might also wish to study STATIC controls.

To draw other visual elements, you need to use the visual themes API, e.g. the DrawThemeBackground function that accepts a class, part, and state and then draws it:

Chevron

Andreas Rejbrand
  • 105,602
  • 8
  • 282
  • 384
  • What about the chevron examples, which are used expander controls (and in WPF as well)? – mmmm Mar 02 '11 at 17:14
  • @Mmarquee: You have to use the visual theme functions for that: See my Q and A at http://stackoverflow.com/questions/4009701/windows-visual-themes-gallery-of-parts-and-states. – Andreas Rejbrand Mar 02 '11 at 17:15
  • Great, this looks exactly what I need. Cheers Andreas – mmmm Mar 03 '11 at 10:23
1

SHGetStockIconInfo has a decent list of system icons.

Anders
  • 97,548
  • 12
  • 110
  • 164
  • Nearly, but this still doesn't have the rounded chevron. I'm lost as to where it lives. – mmmm Mar 02 '11 at 20:22
  • 1
    @Mmarquee: I thought I told you? You need [`DrawThemeBackground`](http://msdn.microsoft.com/en-us/library/bb773289(VS.85).aspx). Have a look at the `TASKDIALOG` class, the `TDLG_EXPANDOBUTTON` part, and the `TDLGEBS_NORMAL` state. See [this image](http://privat.rejbrand.se/chevron.png). – Andreas Rejbrand Mar 02 '11 at 22:12