Before you create the browser window, you must register the window by configuring the WNDCLASS structure, and then registering this window by calling the RegisterClass function.
The following code example shows how to register a window.
// Standard Win32 window class registration.
BOOL RegisterBrowserWnd()
{
static BOOL bRegistered = FALSE;
WNDCLASS wc;
if(!bRegistered)
{
wc.style = 0;
wc.lpfnWndProc = (WNDPROC)CBrowser::s_BrowseWndProc;
wc.cbClsExtra = 0;
wc.cbWndExtra = 0;
wc.hInstance = g_hInstance;
wc.hIcon = NULL;
wc.hCursor = LoadCursor(NULL, IDC_ARROW);
wc.hbrBackground = (HBRUSH)GetSysColorBrush(COLOR_WINDOW);
wc.lpszMenuName = NULL;
wc.lpszClassName = TEXT("Browser_main");
if (RegisterClass(&wc))
bRegistered = TRUE;
}
return bRegistered;
}
See Also
Creating a Browser Window | Creating an Internet Browser
Send Feedback on this topic to the authors