SDL_WM_SetCaption problem

I’m using SDL 1.2.5 (the latest version) on Windows ME.
In a program I tryed:

SDL_WM_SetCaption(“MyTitle”, “MyIcon.ico”);

but it doesn’t work! It seems that the second parameter is ignored because
it doesn’t assign the icon to the window!!!
I have to do this:

SDL_WM_SetCaption(“MyTitle”, “”);
SDL_WM_SetIcon(SDL_LoadBMP(“MyIcon.bmp”), NULL);

to have a caption and an icon.
Why doesn’t the SetCaption work ?

Thanks.
Simone Bondi.

I think it’s perhaps a badly-named argument, there.
I think the 2nd arg to the “SetCaption” function sets the label of
the window when it’s iconified.

e.g., you can have something like:

AGame v.1.3 - Level 37

and then when it’s iconified, it’ll say just:

AGame

-bill!On Mon, Dec 09, 2002 at 11:06:07PM +0100, Simone Bondi wrote:

I’m using SDL 1.2.5 (the latest version) on Windows ME.
In a program I tryed:

SDL_WM_SetCaption(“MyTitle”, “MyIcon.ico”);

but it doesn’t work! It seems that the second parameter is ignored because
it doesn’t assign the icon to the window!!!

I think it’s perhaps a badly-named argument, there.
I think the 2nd arg to the “SetCaption” function sets the label of
the window when it’s iconified.
e.g., you can have something like:
AGame v.1.3 - Level 37
and then when it’s iconified, it’ll say just:
AGame

If so, then the documentation is wrong…
… but I’ve quickly look at the SDL source and the second parameter seems
not used…

(I’m copying from SDL_syswm.c)

void WIN_SetWMCaption(_THIS, const char *title, const char icon)
{
#ifdef _WIN32_WCE
/
WinCE uses the UNICODE version /
int nLen = strlen(title)+1;
LPWSTR lpszW = alloca(nLen
2);
MultiByteToWideChar(CP_ACP, 0, title, -1, lpszW, nLen);
SetWindowText(SDL_Window, lpszW);
#else
SetWindowText(SDL_Window, title);
#endif
}

Thanks.

If so, then the documentation is wrong…

The documentation reads:

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

An “icon name” isn’t a “filename of an icon”.

… but I’ve quickly look at the SDL source and the second parameter seems
not used…
(I’m copying from SDL_syswm.c)

It’s not implemented in all architectures, because not all architectures
support having separate titlebar and icon text. (Actually, "icon name"
refers to the text on the icon of the app, and Windows hasn’t had
icons representing running applications since 3.x’s interface.)On Tue, Dec 10, 2002 at 09:50:24AM +0100, Simone wrote:


Glenn Maynard

The documentation reads:
"Sets the title-bar and icon name of the display window."
An “icon name” isn’t a “filename of an icon”.

Ops… :frowning:
I thought that the “icon name” was the name of the icon (file).

It’s not implemented in all architectures, because not all architectures
support having separate titlebar and icon text. (Actually, "icon name"
refers to the text on the icon of the app, and Windows hasn’t had
icons representing running applications since 3.x’s interface.)

thank you very much !

Bye!
Simone Bondi.