| 发表于:2007-11-08 00:53:42 楼主 |
代码如下 unit fapp; interface uses windows, messages, sysutils, variants, classes, graphics, controls, forms, dialogs,shellapi; type tform1 = class(tform) procedure formcreate(sender: tobject); procedure formclose(sender: tobject; var action: tcloseaction); private { private declarations } procedure wndproc(var msg:tmessage); procedure myminimize(sender:tobject); public { public declarations } icondata:tnotifyicondata; end; var form1: tform1; implementation {$r *.dfm} procedure tform1.formcreate(sender: tobject); begin icondata.cbsize:=sizeof(icondata); icondata.wnd:=handle; icondata.uid:=100; icondata.uflags:=nif_message+nif_icon+nif_tip; icondata.ucallbackmessage:=wm_user+1; icondata.hicon:=application.icon.handle; strpcopy(icondata.sztip,application.title); shell_notifyicon(nim_add,@icondata); application.onminimize:=myminimize; myminimize(nil); end; procedure tform1.formclose(sender: tobject; var action: tcloseaction); begin shell_notifyicon(nim_delete,@icondata); application.processmessages; application.terminate; end; procedure tform1.wndproc(var msg:tmessage); begin case msg.msg of wm_user+1: case msg.lparam of wm_lbuttondown: begin form1.show; showwindow(application.handle,sw_shownormal); end; end; end; inherited; end; procedure tform1.myminimize(sender:tobject); begin form1.hide; showwindow(application.handle,sw_hide); end; end. 双击不显示主窗体,根本没有反应,怎么回事?请高手解答 |
|
|
|
|