How do you set the title name and icon. I use C++ with sdl an devC++.
Printable View
How do you set the title name and icon. I use C++ with sdl an devC++.
im guessing windows?
and im guessing you wanna change the icon and title in the windows title bar?
well, i haven't messed with the icons enough to say but its a little more complicated than changing the text.
heres how to chang the window title anywhere in the program you have a handle
#include <windows.h>
char text[] = "oo Title Changed!! oo"
SetWindowText(my_window_handle, text);
function prototype:
BOOL SetWindowText(
HWND hWnd,
LPCTSTR lpString
);
If you have an icon as a resource:
MainWindow is the window, ProgramIcon is the ID of the icon and CurInst is the first HINSTANCE parameter in WinMain.Code:SetClassLong(MainWindow, GCL_HICON, (LONG)LoadIcon(CurInst, MAKEINTRESOURCE(ProgramIcon)));
ShowWindow(MainWindow, SW_HIDE);
ShowWindow(MainWindow, SW_SHOW);
The reason I hide then show the window again is that the icon will be misplaced otherwise...
Look here:Quote:
Originally posted by willgell
How do you set the title name and icon. I use C++ with sdl an devC++.
http://sdldoc.csn.ul.ie/sdlwmsetcaption.php
Anytime you have a question about SDL browse that website first.