static int windowsInit( HINSTANCE hinstance ) { WNDCLASS wc; /* Window class */ HMENU hSysMenu; emfInstSet( ( int ) hinstance ); wc.style = CS_HREDRAW | CS_VREDRAW; wc.hbrBackground = ( HBRUSH )( COLOR_WINDOW + 1 ); wc.hCursor = LoadCursor( NULL, IDC_ARROW ); wc.cbClsExtra = 0; wc.cbWndExtra = 0; wc.hInstance = hinstance; wc.hIcon = NULL; wc.lpfnWndProc = ( WNDPROC ) websWindProc; wc.lpszMenuName = wc.lpszClassName = name; if ( ! RegisterClass( &wc ) ) { return -1; } /* * Create a window just so we can have a taskbar to close this web server */ hwnd = CreateWindow( name, title, WS_MINIMIZE | WS_POPUPWINDOW, CW_USEDEFAULT, 0, 0, 0, NULL, NULL, hinstance, NULL ); if ( hwnd == NULL ) { return -1; } /* * Add the about box menu item to the system menu * a_assert: IDM_ABOUTBOX must be in the system command range. */ hSysMenu = GetSystemMenu( hwnd, FALSE ); if ( hSysMenu != NULL ) { AppendMenu( hSysMenu, MF_SEPARATOR, 0, NULL ); AppendMenu( hSysMenu, MF_STRING, IDM_ABOUTBOX, T( "About WebServer" ) ); } ShowWindow( hwnd, SW_SHOWNORMAL ); UpdateWindow( hwnd ); hwndAbout = NULL; return 0; }
static int windowsInit(HINSTANCE hinstance) { /* * Restore this code if you want to call Create Window */ #if 0 WNDCLASS wc; /* Window class */ emfInstSet((int) hinstance); wc.style = 0; wc.hbrBackground = NULL; wc.hCursor = NULL; wc.cbClsExtra = 0; wc.cbWndExtra = 0; wc.hInstance = hinstance; wc.hIcon = NULL; wc.lpfnWndProc = (WNDPROC) websWindProc; wc.lpszMenuName = NULL; wc.lpszClassName = name; if (! RegisterClass(&wc)) { return -1; } /* * Create a window just so we can have a taskbar to close this web server */ hwnd = CreateWindow(name, title, WS_VISIBLE, CW_USEDEFAULT, 0, 0, 0, NULL, NULL, hinstance, NULL); if (hwnd == NULL) { return -1; } ShowWindow(hwnd, SW_MINIMIZE); UpdateWindow(hwnd); #endif return 0; }