This works:
Not sure how MaxIDE does it, though.
Strict ?Win32 Import "-lshell32" Extern "Win32" Function LoadIcon:Int(hWnd:Int, file$z, index:Int) = "ExtractIconA@12" Function SetClassLong:Int(hWnd:Int, nIndex:Int, dwNewLong:Int) = "SetClassLongA@12" End Extern ? Function Win32_SetIcon(Window:TGadget, IconID = 0) ?Win32 Local hWnd:Int = QueryGadget(Window, 1) Local icon:Int = LoadIcon(hWnd,AppFile,IconID) SetClassLong(hWnd,-14,icon) ? End Function
Not sure how MaxIDE does it, though.