Wher is my Taskbar Icon?

Started by
1 comment, last by chippydip 24 years, 1 month ago
Hey, This isn't a real big deal, but it would be nice if I could get an icon to show up on my program's taskbar button. I've been able to get the Application's icon to work, but the taskbar one still eludes me Here's my window intialization:

// =============================================================================
//  Function:   InitApp
//  Purpose:    This sets the fields of a WNDCLASSEX object and then uses it
//              to register a new windows class. Finally, it creates a new
//              fullscreen window and returns a handle to this window.
// =============================================================================

HWND InitApp (HINSTANCE instance)           // Application instance handle
{
    // Local variables

    WNDCLASSEX winClass;

    // Fill in the WNDCLASSEX object with some default values

    winClass.cbSize         = sizeof(WNDCLASSEX);
                                            // Set the size just to be safe
    winClass.style          = CS_DBLCLKS / CS_OWNDC / CS_HREDRAW / CS_VREDRAW;
                                            // Use a standard game style
    winClass.lpfnWndProc    = WinProc;      // Our message handling function
    winClass.cbClsExtra     = 0;            // Extra class info space (not used)
    winClass.cbWndExtra     = 0;            // Window info space (not used)
    winClass.hInstance      = instance;     // Application instance handle
    winClass.hIcon          = LoadIcon(NULL, MAKEINTRESOURCE(IDI_BIGICON));
                                            // Large icon to be used by windows
    winClass.hCursor        = LoadCursor(NULL, MAKEINTRESOURCE(IDC_ARROW));
                                            // Cursor to be used by windows
    winClass.hbrBackground  = (HBRUSH) GetStockObject(BLACK_BRUSH);
                                            // Brush used to clear the screen
    winClass.lpszMenuName   = NULL;         // No menus used
    winClass.lpszClassName  = WIN_CLASS_NAME;
                                            // Name of the new window class
    winClass.hIconSm        = LoadIcon(NULL, MAKEINTRESOURCE(IDI_SMALLICON));
	                                        // Small icon to be used by windows

    // Register the window class
    if (!RegisterClassEx(&winClass))
        exit(10);

    // Create a new window

    return CreateWindowEx(NULL,             // Advanced...
                          WIN_CLASS_NAME,   // Name used to register winClass
                          WIN_TITLE,        // Name used in window title bar
                          WS_POPUP / WS_VISIBLE,
                                            // A basic, full screen style
                          0, 0,             // Window postion
                          GetSystemMetrics(SM_CXFULLSCREEN),
                                            // Set window width to the width of the desktop
                          GetSystemMetrics(SM_CYFULLSCREEN),
                                            // Set window height to the height of the desktop
                          NULL,             // Handle to parent window
                          NULL,             // Handle to window's menu
                          instance,         // Application instance
                          NULL);            // Advanced...
}
Which is supposed to load a different icon for the large and small icons (just so I can see what's going on.) Both icons are 32x32 (MSVC++ didn't seem to want to let me make a 16x16 small ICON ... This might be the problem, but I don't know.) Any help would be greatly appreciated Edited by - chippydip on 3/19/00 7:46:04 PM Edited by - chippydip on 3/19/00 7:47:33 PM
Advertisement
I think you posted this to the wrong forum, try one of the general programming ones and people should be able to help a bit more
oops, I guess I did... I''ll repost it there... tks

This topic is closed to new replies.

Advertisement