K kuerten Unregistered / Unconfirmed GUEST, unregistred user! 2003-05-28 #1 我的程序只有一个窗体,borderstyle=NONE,最小化后会缩到桌面的左下角, 如何令它如正常窗体一样缩到任务栏?
Q quejian Unregistered / Unconfirmed GUEST, unregistred user! 2003-05-28 #3 加个按钮 procedure TForm1.Button1Click(Sender: TObject); begin PostMessage(application.handle,WM_SYSCOMMAND,SC_MINIMIZE,0); end;
加个按钮 procedure TForm1.Button1Click(Sender: TObject); begin PostMessage(application.handle,WM_SYSCOMMAND,SC_MINIMIZE,0); end;
W wangzheking Unregistered / Unconfirmed GUEST, unregistred user! 2003-06-04 #4 const WM_MIDASICON = WM_USER + 1; procedure ModifyTrayIcon(ActionWORD);//圖標加入窗口右下角 var l_NIData : TNotifyIconData; begin try With l_NIData do begin cbSize := Sizeof(TNotifyIconData); uID := 0; uFlags := NIF_MESSAGE or NIF_ICON or NIF_TIP; Wnd := Handle; uCallBackMessage := WM_MIDASICON; hIcon := Application.Icon.Handle; StrPCopy(szTip,Application.Title); end; Shell_NotifyIcon(Action,@l_NIData); except; end; end;
const WM_MIDASICON = WM_USER + 1; procedure ModifyTrayIcon(ActionWORD);//圖標加入窗口右下角 var l_NIData : TNotifyIconData; begin try With l_NIData do begin cbSize := Sizeof(TNotifyIconData); uID := 0; uFlags := NIF_MESSAGE or NIF_ICON or NIF_TIP; Wnd := Handle; uCallBackMessage := WM_MIDASICON; hIcon := Application.Icon.Handle; StrPCopy(szTip,Application.Title); end; Shell_NotifyIcon(Action,@l_NIData); except; end; end;
任 任豆豆 Unregistered / Unconfirmed GUEST, unregistred user! 2003-06-05 #6 ... private procedure WMSysCommand(var Message: TWMSysCommand);message WM_SYSCOMMAND;// ...... procedure TForm1.WMSysCommand(var Message: TWMSysCommand); begin Inherited; //最小化 if (Message.CmdType and $FFF0 = SC_MINIMIZE) then Showwindow(Form1.Handle,sw_hide); end;
... private procedure WMSysCommand(var Message: TWMSysCommand);message WM_SYSCOMMAND;// ...... procedure TForm1.WMSysCommand(var Message: TWMSysCommand); begin Inherited; //最小化 if (Message.CmdType and $FFF0 = SC_MINIMIZE) then Showwindow(Form1.Handle,sw_hide); end;
F finalrinoa Unregistered / Unconfirmed GUEST, unregistred user! 2003-06-05 #7 做一个按钮,然后加入 sendmessage(handle,WM_SYSCOMMAND,SC_MINIMIZE,0);