1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

SETICON error

Discussion in 'Plugins' started by nickles, Oct 31, 2016.

  1. nickles

    Joined:
    Jun 24, 2008
    Messages:
    220
    Likes Received:
    0
    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?
     
  2. vefatica

    Joined:
    May 20, 2008
    Messages:
    7,935
    Likes Received:
    30
    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
     
  3. nickles

    Joined:
    Jun 24, 2008
    Messages:
    220
    Likes Received:
    0
    @vince
    Any chance for a fix? If so, do you need additional info?
     
  4. vefatica

    Joined:
    May 20, 2008
    Messages:
    7,935
    Likes Received:
    30
    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.
     
  5. vefatica

    Joined:
    May 20, 2008
    Messages:
    7,935
    Likes Received:
    30
    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.
     
  6. nickles

    Joined:
    Jun 24, 2008
    Messages:
    220
    Likes Received:
    0
    @vince
    Thanks for the new DLL. However, now I receive the error (Windows 10 only) in the attached image...
     

    Attached Files:

    • 01.png
      01.png
      File size:
      14.2 KB
      Views:
      9
  7. vefatica

    Joined:
    May 20, 2008
    Messages:
    7,935
    Likes Received:
    30
    But the actual icon change takes place? Please tell me what the command returns, namely %_?
     
  8. nickles

    Joined:
    Jun 24, 2008
    Messages:
    220
    Likes Received:
    0
    @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!
     

Share This Page