In MFC How can we retrieve icon of an exe file?


Ans: The executable files of Paint Brush, Notepad, PowerPoint etc. have their own icons. If you want to use icon of one of these executables for your window use ExtractIcon( ) API function as shown below.

HICON hicon ;

hicon = ::ExtractIcon ( AfxGetApp( ) -> m_hInstance, “C:\\Windows\\pbrush.exe”, 0 ) ;

SetIcon ( hicon, FALSE ) ;

This code snippet shows how to set icon of Paint application to our window.

It's very calm over here, why not leave a comment?

Leave a Reply




Categories

UserOnline

Improve the web with Nofollow Reciprocity.

Powered by Yahoo! Answers