izeOf(TWndClassEx);
WinClass.lpszClassName:=''MyWindow''; //类名.
WinClass.style:=CS_HREDRAW or CS_VREDRAW or CS_OWNDC;
WinClass.hInstance:=hInst; //
程序的实例句柄.
//设置窗口消息处理函数.
WinClass.lpfnWndProc:=@MyWinProc; //窗口过程.
WinClass.cbClsExtra:=0; //以下两个域用于在类结构和Window
s内部保存的窗口结构
WinClass.cbWndExtra:=0; //中预留一些额外空间.
WinClass.hIcon:=LoadIcon(hInstance,MakeIntResource(''MAINICON''));
WinClass.hIconsm:=LoadIcon(hInstance,MakeIntResource(''MAINICON''));
WinClass.hCursor:=LoadCursor(0,IDC_Arrow);
//GetStockObject 获取一个图形对象,在这里是获取绘制窗口背景的刷子,返回一个白色刷
子的句柄.
WinClass.hbrBackground:=HBRUSH(GetStockObject(white_Brush));
WinClass.lpszMenuName:=nil; //指定窗口类菜单.
//向Windows
注册窗口类.
if RegisterClassEx(WinClass)=0 then
begin
MessageBox(0,''Registeration Error!'',''SDK/API'',MB_OK);
Exit;
end;
//建立窗口对象.
hWnd:=CreateWindowEx(
WS_EX_OVERLAPPEDWINDOW, //扩展的窗口风格.
WinClass.lpszClassName, //类名.
''Hello Window'', //窗口标题.
WS_OVERLAPPEDWINDOW, //窗口风格.
CW_USEDEFAULT, //窗口左上角相对于屏幕
左上角的初始位置x.
&n