   How to change a window's icon after it has been created?
  I need to change the icon of my window dynamically, when I created it I used LoadImage to load the icon then passed it to the hIcon property of the WNDCLASSEX class.Now I would like to load a new icon and set the window icon to it after the window has been created, so how could I do this?Also is there a way to get the file name of the current icon the window is using?   
  I don't know about getting the filename of the current icon, but for setting the window icon, take a look at SetClassLongPtr().   ;Quote:Original post by jykI don't know about getting the filename of the current icon, but for setting the window icon, take a look at SetClassLongPtr().Tried it and nothing happened but it did lead me to something that worked:HANDLE icon = LoadImage(NULL, file.c_str(), IMAGE_ICON, 0, 0, LR_LOADFROMFILE);SendMessage(hWnd, (UINT)WM_SETICON, ICON_BIG, (LPARAM)icon);Thanks though!   ;Quote:Original post by CodaKillerAlso is there a way to get the file name of the current icon the window is using?No, there is no way to do this - You never pass the filename of an icon to windows, it doesn't have any way to find out if a HICON is loaded from a file and get the filename the resource was loaded from.   