N
nisky
Unregistered / Unconfirmed
GUEST, unregistred user!
procedure TForm1.Button4Click(Sender: TObject);<br>var<br> edittemp:HWND;<br> SetResult,ErrorCodeWORD;<br> NewCursor:HCursor;<br>begin<br> edittemp:=CreateWindowEx(0,'edit','OldEdit',WS_OVERLAPPED,100,100,<br> 300,300,0,0,hInstance,nil);<br> if edittemp<>0 then<br> begin<br> ShowWindow(edittemp,SW_SHOWNORMAL);<br> UpdateWindow(edittemp);<br> end<br> else begin<br> Showmessage('创建窗口实例失败!');<br> exit;<br> end;<br> NewCursor:=LoadCursor(0,IDC_WAIT);<br> if Newcursor=0 then<br> Showmessage('Cursor Error!');<br> SetLastError(0);<br> SetResult:=SetWindowLong(edittemp,GCL_HCURSOR,Integer(NewCursor));<br> if SetResult=0 then<br> begin<br> Showmessage('修改属性失败!');<br> ErrorCode:=GetlastError;<br> Showmessage(Inttostr(Loword(ErrorCode)));<br> DestroyWindow(edittemp);<br> exit;<br> end;<br><br> DestroyWindow(edittemp);<br> editEx:=CreateWindowEx(0,'edit','NewEdit',WS_OVERLAPPED,100,100,<br> 300,300,0,0,hInstance,nil);<br> if editEx<>0 then<br> begin<br> ShowWindow(editEx,SW_SHOWNORMAL);<br> UpdateWindow(editEx);<br> end<br> else begin<br> Showmessage('创建窗口实例失败!');<br> exit;<br> end;<br>end;<br>