0

I need to get the icon name of a process that used SDL-1.2.15 to display window.

This is SDL Description about SDL-window title and icon name :

#include "SDL.h"

void SDL_WM_SetCaption(const char *title, const char *icon);

Sets the title-bar and icon name of the display window.

title is a UTF-8 encoded null-terminated string which will serve as the window title (the text at the top of the window). The function does not change the string. You may free the string after the function returns.

icon is a UTF-8 encoded null-terminated string which will serve as the iconified window title (the text which is displayed in the menu bar or desktop when the window is minimized). As with title this string may be freed after the function returns.

For example the ffplay used SDL and I can run it like this:

 Process p= new Process();
 p.StartInfo.FileName = "ffplay.exe";
 p.StartInfo.Arguments = "-i test.avi";
 p.Start();

Then I can get the title of window with GetWindowText API, But I can't get the icon name.

Please tell me how can I get the icon name. (Sorry for my English)

UPDATE : I don't need to icon I need to the text which is displayed in the menu bar or desktop when the window is minimized.(that called icon name) Please read the SDL-Description.

Also I saw this : Getting the icon associated with a running application

But it does not work for me, Because Icon.ExtractAssociatedIcon can not get icon name. So my question is not duplicate.

UPDATE : I edited title of my question.

Community
  • 1
  • 1
Maria
  • 344
  • 8
  • 30
  • 2
    possible duplicate of [Getting the icon associated with a running application](http://stackoverflow.com/questions/304109/getting-the-icon-associated-with-a-running-application) – Oceans Sep 22 '15 at 08:21
  • If you want to get icon of **window**, then you can use winapi, something like `GetClassLong(hwnd, GCL_HICON)`. There is also associated with exe file icon (simply first icon in resources), for this see [this](http://stackoverflow.com/a/9968661/1997232) answer. – Sinatr Sep 22 '15 at 08:28
  • I don't need to icon I need to the text which is displayed in the menu bar or desktop when the window is minimized.(that called icon name) Please read the SDL-Description . – Maria Sep 22 '15 at 08:49
  • @Mitra, have you tried [SDL_WM_GetCaption()](http://sdl.beuc.net/sdl.wiki/SDL_WM_GetCaption)? Also, for what it's worth, I believe the icon name is an X Window concept, it may not have an alternative on MS Windows. – Frédéric Hamidi Sep 22 '15 at 09:08
  • @Frédéric ,I don't know what is "X Window " but I will try `SDL_WM_GetCaption()` . Thank you. – Maria Sep 22 '15 at 09:24

0 Answers0