VC++: How can we retrieve icon of an exe file?
How can we retrieve icon of an exe file?
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.




Comments
Log in or create a user account to comment.