C
cjianwen
Unregistered / Unconfirmed
GUEST, unregistred user!
如题,下面的代码,为什么只对本窗体上的控件有效,偶用 spy++ 找到句柄后,点击无效,高手帮忙,谢谢!<br>procedure TForm1.Button1Click(Sender: TObject);<br>var<br> d: TNMDATETIMECHANGE;<br> t:_SYSTEMTIME;<br> dt: TDateTime;<br> h,h2: hwnd;<br>begin<br> //d.nmhdr.hwndFrom := DateTimePicker1.Handle;<br> h := $00240EC2;<br> //h := DateTimePicker1.Handle;<br> ShowMessage(IntToHex(h,16));<br> d.nmhdr.hwndFrom := h;<br> d.nmhdr.idFrom := 0;<br> d.nmhdr.code:=DTN_DATETIMECHANGE;<br> d.dwFlags := GDT_VALID;//加上这个看看<br> dt := StrToDate('2006-1-1');<br> DateTimeToSystemTime(dt,t);<br> d.st := t;<br> //SendMessage(DateTimePicker1.Handle ,WM_NOTIFY,0,Longint(@d))<br> SendMessage(h ,WM_NOTIFY,0,Longint(@d));<br> h2 := $1407EA;<br> SendMessage(h2,WM_SETTEXT,0,Integer(pchar('asfdkls'))); //我测试发现对 edit控件有效<br>end;