Mega Code Archive

 
Categories / Delphi / System
 

How to use windows intern icons

Title: How to use windows-intern icons Question: How to load icons from the system and display it in own applications! Answer: First you need the constants that define the icons. They are defined in the API unit (windows.pas) from Delphi: IDI_HAND IDI_EXCLAMATION or IDI_QUESTION This simple example draws the question icon into a panel: var DC: HDC; Icon: HICON; begin DC:= GetWindowDC(Panel1.Handle); Icon:= LoadIcon(0, IDI_QUESTION); DrawIcon(DC, 5,5, Icon); ReleaseDC(Panel1.Handle, DC); end;