饼
饼干
Unregistered / Unconfirmed
GUEST, unregistred user!
小弟是新手,初数delphi 请各位高手路过,指点迷津!!<br>不太了解window API,和Tmessage类,还有消息,也没看到书上讲,谁知道有介绍这方面的书(delphi7 )请发个地址或发到我的E-mail!地址是:langwei2727@sina.com<br>第一次做托盘,什么都不太明白,请高手指点<br><br>Tpoint //是什么类型??????<br>Tmessage.LParam //是什么属性???<br>Tmessage.WParam //是什么属性???<br>wm_user //是什么??<br>sc_minimize //是什么??<br>procedure mousemsg1(var msg:tmessage);message MI_iconevent;//message MI_iconevent 表示什么<br>原码如下,?号都是不太明白的地放,请指点<br>const <br> iid=100; <br> mousemsg=wm_user+1; <br><br><br>procedure mousemsg1(var msg:tmessage);message mousemsg; <br>procedure mymsgproc(var msg:tmessage);message wm_syscommand; <br><br><br>procedure tform1.mymsgproc(var msg:tmessage); <br>begin <br> inherited; <br> case msg.WParam of //????<br> SC_MINIMIZE: //?????<br> begin <br> button7click(self); <br> end <br> else <br> inherited; <br> end; <br>end; <br>procedure tform1.mousemsg1(var msg:tmessage); <br>var <br> mousept:tpoint; //???<br>begin <br> inherited; <br> if msg.LParam =wm_rbuttonup then begin <br> getcursorpos(mousept); <br> popupmenu1.Popup(mousept.X,mousept.y) ; <br> end; <br>end; <br>procedure TForm1.Button7Click(Sender: TObject); <br>begin <br> /////////////////////////////////////// <br> ntida.cbSize :=sizeof(tnotifyicondata); //以下的这几个属性是什么意思??<br> ntida.Wnd :=handle; <br> ntida.uID :=iid; <br> ntida.uFlags :=nif_icon+nif_tip+nif_message;//nif_icon+nif_tip+nif_message,这是什么??? <br> ntida.uCallbackMessage :=mousemsg; <br> ntida.hIcon :=application.Icon.Handle ; //application.Icon.Handle ??<br> ntida.szTip :='icon'; <br> <br> shell_notifyicon(NIM_ADD,@ntida); //??????<br> <br> Application.Minimize ; //???<br> showwindow(handle,SW_HIDE); //??<br> showWindow(Application.Handle ,SW_HIDE); <br>end; <br>////////////////////////////////////////////////////////// <br>procedure TForm1.N2Click(Sender: TObject); <br>begin <br> /////////////////////////////////////// <br> ntida.cbSize :=sizeof(tnotifyicondata); <br> ntida.Wnd :=handle; <br> ntida.uID :=iid; <br> ntida.uFlags :=nif_icon+nif_tip+nif_message; <br> ntida.uCallbackMessage :=mousemsg; <br> ntida.hIcon :=application.Icon.Handle ; <br> ntida.szTip :='icon'; <br> ///////////////////////// <br> shell_notifyicon(NIM_DELETE,@ntida); <br> //////////////////////////////////////// <br> showwindow(handle,SW_SHOW); <br> showwindow(application.Handle ,SW_SHOW); <br>end;