Note that there are some explanatory texts on larger screens.

plurals
  1. POWindows Programming: WNDCLASS structure: hIcon member Problem
    primarykey
    data
    text
    <p>I've Created a custom .ico with VS2010 for a game I'm making with DirectX</p> <p>When I set the .ico file as hIcon member of my wndClass, it will show in the taskbar, but not in the title bar.</p> <p>I've read the other threads about this, I've searched google, msdn: no luck... I've tried just about anything I could come up with, it still wouldn't show.</p> <p>The weird thing is: when I switch the hIcon to a default icon (like IDI_ERROR) it will show both in taskbar and in title bar, but not with my custom made .ico</p> <p>Can anyone help me?</p> <p>Here is my code:</p> <pre><code>HICON Icon = LoadIcon( NULL, MAKEINTRESOURCE(ID_ICON_MYTETRIS) ); WNDCLASS wndClass; ZeroMemory(&amp;wndClass,sizeof(wndClass)); wndClass.style = CS_HREDRAW | CS_VREDRAW; wndClass.lpfnWndProc = WndProc; wndClass.cbClsExtra = 0; wndClass.cbWndExtra = 0; wndClass.hInstance = hInstance; wndClass.hCursor = LoadCursor( NULL, IDC_ARROW ); wndClass.hIcon = Icon; wndClass.hbrBackground = static_cast&lt;HBRUSH&gt;(GetStockObject(WHITE_BRUSH)); wndClass.lpszMenuName = NULL; wndClass.lpszClassName = _T("WindowClass0"); if (RegisterClass(&amp;wndClass) == false) { return -1; } RECT rc = {0,0,300,225}; AdjustWindowRect(&amp;rc, WS_OVERLAPPEDWINDOW, FALSE); HWND hWnd = CreateWindow(_T("WindowClass0") ,_T("2D_DirectX_Tetris") ,WS_OVERLAPPED | WS_SYSMENU | WS_MINIMIZEBOX ,CW_USEDEFAULT ,CW_USEDEFAULT ,rc.right - rc.left ,rc.bottom - rc.top ,NULL ,NULL ,hInstance ,NULL ); if( hWnd == false) { return -1; } ShowWindow( hWnd, iCmdShow ); </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload