求救!关于CreateWindow建立窗口失败(50分)

  • 主题发起人 主题发起人 chinaweiling
  • 开始时间 开始时间
C

chinaweiling

Unregistered / Unconfirmed
GUEST, unregistred user!
各位大侠,小弟近日使用CreateWindow()来创建窗口,窗口类能注册成功,但一直无法调用CreateWindow
还请各位帮助!!
HANDLE __fastcall TSnoop2k::XSocketAllocateHWnd(TObject * Obj)
{
bool ClassRegistered;
WNDCLASS TempClass;
HANDLE ClassHandle;
XSocketWindowClass.hInstance=HInstance;
XSocketWindowClass.style=0;
XSocketWindowClass.lpfnWndProc=XSocketWindowProc;
XSocketWindowClass.cbClsExtra=0;
XSocketWindowClass.cbWndExtra=0;
XSocketWindowClass.hInstance=0;
XSocketWindowClass.hIcon=0;
XSocketWindowClass.hCursor=0;
XSocketWindowClass.hbrBackground=0;
XSocketWindowClass.lpszMenuName=NULL;
XSocketWindowClass.lpszClassName="TTest";
ClassRegistered = GetClassInfo(HInstance,XSocketWindowClass.lpszClassName,&XSocketWindowClass);
if(!ClassRegistered)
if(!RegisterClass(&XSocketWindowClass))
return(0);
ClassHandle= CreateWindow(XSocketWindowClass.lpszClassName,"",WS_POPUP,100, 100,100, 100,NULL,0,HInstance,NULL);
//ClassHandle一直为NULL
}

LRESULT __stdcall XSocketWindowProc(HANDLE ahWnd,UINT auMsg,WPARAM awParam,LPARAM alParam)
{
return(0);
}
 
你将所有的XSocketWindowClass 改为TempClass试试。
 
后退
顶部