Here is my source for the "init" function:
// START HERE
VALUE AppInit ( VALUE obj )
{
// Declarations
WNDCLASS wndclass;
// GO !
hApp = 0;
wndclass.style = CS_HREDRAW | CS_VREDRAW;
wndclass.lpfnWndProc = &AppDefProc;
wndclass.cbClsExtra = 0;
wndclass.cbWndExtra = 0;
wndclass.hInstance = GetModuleHandle ( NULL );
wndclass.hIcon = LoadIcon ( NULL, IDI_WINLOGO ); //
IDI_APPLICATION) ;
wndclass.hCursor = LoadCursor ( NULL, IDC_ARROW );
// API docs state that 1 must be
// added to the color constant!
wndclass.hbrBackground = (HBRUSH) ( COLOR_BTNFACE+1 );
wndclass.lpszMenuName = NULL;
wndclass.lpszClassName = __WINGKR_CLASS_NAME;
if ( RegisterClass (&wndclass) )
{
printf ("\n b4 CreateWindow");
hApp = CreateWindow ( __WINGKR_CLASS_NAME, /* window class name */
NULL, /* window caption */
WS_OVERLAPPEDWINDOW, /* window style */
CW_USEDEFAULT, /* initial x position */
CW_USEDEFAULT, /* initial y position */
CW_USEDEFAULT, /* initial x size */
CW_USEDEFAULT, /* initial y size */
NULL, /* parent window handle */
NULL, /* window menu handle */
GetModuleHandle ( NULL ), /* program instance handle */
NULL) ; /* creation parameters */
printf ("\n after CreateWindow");
if ( !hApp )
{
printf ( "\n Failure to create window" );
}
}
else
{
printf ( "\n Failure to register class" );
}
return Qnil;
}
// END HERE
Hope this helps.
Thanks.
Bryce