Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.


no window caption?

This topic is 5577 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

When I first create this window, there is no window caption, but if I call SetWindowText() right after CreateWindow(), it works.
memset( &wc, 0x0, sizeof( WNDCLASSEX ) );
wc.cbSize       = sizeof( WNDCLASSEX );
wc.cbWndExtra   = 4;
wc.hCursor      = LoadCursor( NULL, IDC_ARROW );
wc.hInstance    = GetModuleHandle( NULL );
wc.lpfnWndProc  = CWindows::WndProc;
wc.lpszClassName= "CWindows";
wc.style        = CS_OWNDC;
// register class and create window

RegisterClassEx( &wc );
m_hWnd = CreateWindowEx( WS_EX_ACCEPTFILES, "CWindows", "main window", WS_VISIBLE|WS_SYSMENU,
    0, 0, 640, 480, NULL, NULL, GetModuleHandle( NULL ), this );
if( !m_hWnd ) return E_FAIL;
SetWindowText( m_hWnd, "main window" );
oh, and those four extra bytes are for the long-winded SetWindowLongPtr() trick to make the WndProc a member function.

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!