Browse DevX
Sign up for e-mail newsletters from DevX

Tip of the Day
Language: VB4/32,VB5,VB6
Expertise: Intermediate
Apr 7, 2001



Building the Right Environment to Support AI, Machine Learning and Deep Learning

GetSystemIcon - Get a Windows standard icon as a StdPicture object

Private Declare Function LoadStandardIcon Lib "user32" Alias "LoadIconA" (ByVal _
    hInstance As Long, ByVal lIconID As Long) As Long

Enum SystemIconConstants
    IDI_Application = 32512
    IDI_Hand = 32513
    IDI_Question = 32514
    IDI_Exclamation = 32515
    IDI_Asterisk = 32516
    IDI_Windows = 32517
End Enum

' returns a Windows standard icon 
' (e.g. the icons used in the Message Boxes)
' Requires the IconToPicture function

Function GetSystemIcon(ByVal ID As SystemIconConstants) As StdPicture
   'get the standard icon's handle by calling LoadStandardIcon and then
   'convert it to a StdPicture object
   Set GetSystemIcon = IconToPicture(LoadStandardIcon(0, ID))
End Function
Marco Bellinaso
Comment and Contribute






(Maximum characters: 1200). You have 1200 characters left.



Thanks for your registration, follow us on our social networks to keep up-to-date