Set window icon ( Freeglut )

Hello all!

Ive tried everything i found in internet and still nothing seems to work.
Ive made launcer.exe what will call dll where inside of it is freeglut_static.lib
So the window is created inside of .dll i guess.

Here's what ive tried:
.:In Freeglut project:.
freeglut.rc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42

/* 0 ICON DISCARDABLE "OpenGL.ico" */
#include <resource.h>
IDI_TESTWINDOW       ICON         "icon.ico"


1 VERSIONINFO
 FILEVERSION 2,8,0,0
 PRODUCTVERSION 2,8,0,0
 FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
 FILEFLAGS 0x1L
#else
 FILEFLAGS 0x0L
#endif
 FILEOS 0x40004L
 FILETYPE 0x1L
 FILESUBTYPE 0x0L
BEGIN
    BLOCK "StringFileInfo"
    BEGIN
        BLOCK "080904b0"
        BEGIN
            /* VALUE "Comments", "\0" */
            /* VALUE "CompanyName", "\0" */
            VALUE "FileDescription", "Freeglut OpenGL Utility Toolkit\0"
            VALUE "FileVersion", "2, 8, 0, 0\0"
            VALUE "InternalName", "freeglutdll\0"
            VALUE "LegalCopyright", "Copyright © 1999-2000 Pawel W. Olszta, 2000-2011 Stephen J. Baker\0"
            /* VALUE "LegalTrademarks", "\0" */
            VALUE "OriginalFilename", "freeglut.dll\0"
            /* VALUE "PrivateBuild", "\0" */
            VALUE "ProductName", "Freeglut OpenGL Utility Toolkit\0"
            VALUE "ProductVersion", "2, 8, 0, 0\0"
            /* VALUE "SpecialBuild", "\0" */
        END
    END
    BLOCK "VarFileInfo"
    BEGIN
        VALUE "Translation", 0x809, 1200
    END
END


Resource.h
 
#define IDI_TESTWINDOW	107 


freeglut_window.c/GLboolean fgSetupPixelFormat(...)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
       WNDCLASSEX wndCls;

        /* create a dummy window */
        ZeroMemory(&wndCls, sizeof(wndCls));
        wndCls.lpfnWndProc = DefWindowProc;
        wndCls.hInstance = fgDisplay.Instance;
        wndCls.style = CS_OWNDC | CS_HREDRAW | CS_VREDRAW;
        wndCls.lpszClassName = _T("FREEGLUT_dummy");
		wndCls.hIcon = LoadIcon(wndCls.hInstance, MAKEINTRESOURCE(IDI_TESTWINDOW) );
		wndCls.hIconSm = LoadIcon(wndCls.hInstance, MAKEINTRESOURCE(IDI_TESTWINDOW));
        RegisterClassEx( &wndCls );
		

        hWnd=CreateWindow(_T("FREEGLUT_dummy"), _T(""),  WS_CLIPSIBLINGS | WS_CLIPCHILDREN | WS_OVERLAPPEDWINDOW , 0,0,0,0, 0, 0, fgDisplay.Instance, 0 );



#2 - sending icon message
dll main() [After glut initalizing]
1
2
3
4
HWND uu  = FindWindow(NULL,(LPCWSTR)"Mywindow");
HANDLE hIcon = LoadImage(NULL, L"glut.ico", IMAGE_ICON, 32, 32, LR_LOADFROMFILE);
SendMessage(uu, WM_SETICON, ICON_SMALL, (LPARAM)hIcon);
SendMessage(uu, WM_SETICON, ICON_BIG, (LPARAM)hIcon);



Really ran out of ideas... :/
Can someone help me with this?
Thanks!
BUMP!
Alas, you are going to need to do a little bit twiddling.

First, you'll have to identify the window class associated with the code in the DLL. Modify both its name and its associated window icon for that DLL only. Then you'll have to modify your launcher' s icon to match.

Good luck!
I think im not gonna use freeglut, glut, sdl or anyohter crap that create window. Im gonna create window for opengl by myself.
I found that freeglut doesnt support shaders, SDL2 doesnt support gluPerspective...

The only thing that make creating game engine hard is using libraries what ohters have created. Everything what is not created by me is making new problems.
Gyiove wrote:
Everything what is not created by me is making new problems.
That's a bad attitude. Are you sure you're not just misreading documentation? Are you sure that the issue you're having cannot be reported as a bug or missing feature?

The "problems" you will have trying to use an existing library will be miniscule compared to the problems you will have trying to do everything from scratch.
Topic archived. No new replies allowed.