SETICON error

Jun 24, 2008
223
0
Siegen, Germany
In Windows 10 (64-bit, latest version of 4console.dll, and tcc.exe), I keep getting the following error message:

> seticon c:\Windows\Resources\icons\tcc_blk.ico
SETICON error: code = -4

> dir c:\Windows\Resources\icons\tcc_blk.ico
10.06.2009 07:56 13.262 tcc_blk.ico

the icon file is loaded though. The error does not appear in Windows 7. Any clues?
 
May 20, 2008
12,165
133
Syracuse, NY, USA
SetConsoleIcon is undocumented, so I have no documentation and its behavior may have changed. And I don't have Windows 10 to test on. After trying to get a handle (hIcon) to the icon you want, SETICON does this.
Code:
if ( hIcon != NULL )
   {
       rv = -4;
       hOldIcon = GetConsoleIcon();
       if ( SetConsoleIcon(hIcon) )
       {
           rv = 0;
           ...

So, apparently, it's succeeding (you said it works, right?) but returning FALSE
 
May 20, 2008
12,165
133
Syracuse, NY, USA
I still don't have Windows10 to test on. Is it the same problem as above ... working but giving an error message? If it does work, you could (temporarily) redirect the error message to NUL (2> NUL). I'll look at it this weekend but I'll be flying blind.
 
May 20, 2008
12,165
133
Syracuse, NY, USA
I put a new build of 4CONSOLE on ftp://lucky.syr.edu. I didn't change the logic in SETICON, so it may still succeed but say it didn't. But I did change the error handling, so we might get a more enlightening error message.
 
Jun 24, 2008
223
0
Siegen, Germany
@vince
Thanks for the new DLL. However, now I receive the error (Windows 10 only) in the attached image...
 

Attachments

  • 01.png
    01.png
    14.2 KB · Views: 184
Jun 24, 2008
223
0
Siegen, Germany
@vince
The icon is not changed (I got this wrong in my initial post, as the first TCC started would have a different icon statically assigned), and %_? is -4.

Thanks for looking into this!