Question : How can I convert a custom control that calls User32 and Shell32 to work on Mono?

Hi Guys,

I have a custom control, a specialised message box, which imports User32.dll and Shell32.dll in order to retrieve the system icons for Information, Question, Error, etc.  This is obviously causing the application to fail under Mono, so I need to handle this so that under Mono it loads the icons from a resource but under windows it retrieves the relevant system icons from the OS.

How do I go about achieving this?

Chris Bray

Answer : How can I convert a custom control that calls User32 and Shell32 to work on Mono?

Hi Guys,

Sorted it for myself again....

The basic answer is to use the SystemIcons enumeration to retrieve icons and SystemSounds class to play to appropriate sounds and between them you can implement the basic functionality.

Unfortunately that does somewhat limit what can be achieved with the control because only a subset of system sounds and icons are provided.

Chris Bray
Random Solutions  
 
programming4us programming4us