Using shell32.dll icons (from resources)

B

Brian Henry

Hi,

I have a custom made error form and wany to show the exclimation mark or red
X icon form shell32.dll in my application. how would i read these resources?
thanks
 
M

Mick Doherty

You don't need to read the resources.
You will find that those are already exposed in dotnet as SystemIcons.

MyBitmap = SystemIcons.Exclamation.ToBitmap
MyBitmap = SystemIcons.Error.ToBitmap
 
H

Herfried K. Wagner [MVP]

* "Brian Henry said:
I have a custom made error form and wany to show the exclimation mark or red
X icon form shell32.dll in my application. how would i read these resources?

My FAQ:

For the system icons:

Have a look at the 'SystemIcons' class.

For the system sounds:

\\\
Private Declare Auto Function MessageBeep Lib "user32.dll" ( _
ByVal wType As Int32 _
) As Boolean

Private Const MB_ICONASTERISK As Int32 = &H40 ' Information.
Private Const MB_ICONEXCLAMATION As Int32 = &H30 ' Ausrufezeichen.
Private Const MB_ICONHAND As Int32 = &H10 ' Stopschild.
Private Const MB_ICONQUESTION As Int32 = &H20 ' Fragezeichen.
Private Const MB_OK As Int32 = &H0 ' Standard-OK.
///

Usage:

\\\
MessageBeep(MB_ICONHAND)
///

Notice that Windows' messagebox supports copying its contents to the
clipboard by pressing Ctrl+C.
 
A

Andre Nogueira

Notice that Windows' messagebox supports copying its contents to the
clipboard by pressing Ctrl+C.

Thanks for the info! I wasn't aware of that... :S

André Nogueira
 
B

Brian Henry

thanks for the additional information!

Herfried K. Wagner said:
resources?

My FAQ:

For the system icons:

Have a look at the 'SystemIcons' class.

For the system sounds:

\\\
Private Declare Auto Function MessageBeep Lib "user32.dll" ( _
ByVal wType As Int32 _
) As Boolean

Private Const MB_ICONASTERISK As Int32 = &H40 ' Information.
Private Const MB_ICONEXCLAMATION As Int32 = &H30 ' Ausrufezeichen.
Private Const MB_ICONHAND As Int32 = &H10 ' Stopschild.
Private Const MB_ICONQUESTION As Int32 = &H20 ' Fragezeichen.
Private Const MB_OK As Int32 = &H0 ' Standard-OK.
///

Usage:

\\\
MessageBeep(MB_ICONHAND)
///

Notice that Windows' messagebox supports copying its contents to the
clipboard by pressing Ctrl+C.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top