service如何在Win98安裝並啟動 |
尚未結案
|
edwardweng
一般會員 ![]() ![]() 發表:29 回覆:5 積分:6 註冊:2003-04-16 發送簡訊給我 |
|
seaturn99
版主 ![]() ![]() ![]() ![]() 發表:69 回覆:427 積分:214 註冊:2003-08-25 發送簡訊給我 |
edwardweng 您好 : Windows NT 4.0 以上系統才支援 Service 的機制...
您可以發現 Win98/ME 根本沒有 "服務" 這個程式功能可以調整 service .. 節錄 Delphi Online Help :
TService encapsulates a Windows NT service. Unit SvcMgr Description TService encapsulates a Windows NT service in an NT service application. A Win32 service is accessed via the Service Control Manager and can be started automatically at system boot, by a user through the Services control panel applet, or by a Win32-based application that uses the service functions. Services can execute even when no user is logged on to the system. Windows NT also supports a driver service that does not interact with the SCM. 撰寫成 VxD 載入,利用機碼 (Registry),或利用啟動 Folder ,再將程式引藏於 system tray 內,可以達到類似的功能目的.. ----
我只會兩件事,這也不會,那也不會 眼見不一定為真
---- 發表人 - SouthWind 於 2004/11/22 13:44:13
|
P.D.
版主 ![]() ![]() ![]() ![]() ![]() ![]() 發表:603 回覆:4038 積分:3874 註冊:2006-10-31 發送簡訊給我 |
引言: 請問我有寫一個service,在2000或xp安裝和啟動都正常,但是為什麼在98下就無法安裝和啟動,還是在98下另有其它的寫法…可否解答一下…謝謝~~ 活到老,學到老 天天都有新鮮事 若有任何問題,歡迎寫信給我 e-mail: edward@coolboom.com.twWIN95/98 必須寫成 TrayIcon的模式, 就是下拉到右下角的常駐方式, 可以參考下列, 建立一個標準的FORM, 加入以下紅色的部份, 其他的按你原來的寫法即可 unit P_DataTray; interface uses Windows..... type TDataTrayForm = class(TForm) ..... private ..... protected procedure ModifyTrayIcon(Action: DWORD); procedure WndProc(var msg: TMessage); override; public { Public declarations } IconNotifyData: TNotifyIconData; .... end; var DataTrayForm: TDataTrayForm; const MYMB_SHOW_INFO = $10000000; const MYMB_CLOSE_INFO = $20000000; const MYMB_MESSAGE = $40000000; implementation uses .... {$R *.DFM} procedure TDataTrayForm.ModifyTrayIcon(Action: DWORD); begin BorderIcons := []; with IconNotifyData do begin hIcon := Application.Icon.Handle; uCallbackMessage := WM_USER 1; cbSize := sizeof(IconNotifyData); Wnd := Handle; uID := 0; uFlags := NIF_MESSAGE NIF_ICON NIF_TIP; end; strPCopy(IconNotifyData.szTip, 'DataTray 標題'); shell_NotifyIcon(Action, @IconNotifyData); ShowWindow(Application.Handle, SW_HIDE); end; procedure TDataTrayForm.WndProc(var msg: TMessage); var mousePos: TPoint; begin case msg.Msg of WM_USER 1: begin case msg.LParam of WM_LBUTTONDOWN: begin GetCursorPos(mousePos); Show(); end; end; case msg.LParam of WM_RBUTTONDOWN: begin GetCursorPos(mousePos); PopupMenu1.Popup(mousePos.x, mousePos.y); //right click, so popup menu end; end; end; end; inherited; end; procedure TDataTrayForm.FormCreate(Sender: TObject); begin .... // 初值設定 ModifyTrayIcon(NIM_ADD); end; procedure TDataTrayForm.FormClose(Sender: TObject; var Action: TCloseAction); begin ..... ModifyTrayIcon(NIM_DELETE); Action:= caFree; DataTrayForm:= nil; end; .... end.發表人 - P.D. 於 2004/11/23 03:07:22 |
edwardweng
一般會員 ![]() ![]() 發表:29 回覆:5 積分:6 註冊:2003-04-16 發送簡訊給我 |
引言:請問使用TNotifyIconData 要Uses 什麼,會出錯 活到老,學到老 天天都有新鮮事 若有任何問題,歡迎寫信給我 e-mail: edward@coolboom.com.tw引言: 請問我有寫一個service,在2000或xp安裝和啟動都正常,但是為什麼在98下就無法安裝和啟動,還是在98下另有其它的寫法…可否解答一下…謝謝~~ 活到老,學到老 天天都有新鮮事 若有任何問題,歡迎寫信給我 e-mail: edward@coolboom.com.twWIN95/98 必須寫成 TrayIcon的模式, 就是下拉到右下角的常駐方式, 可以參考下列, 建立一個標準的FORM, 加入以下紅色的部份, 其他的按你原來的寫法即可unit P_DataTray; interface uses Windows..... type TDataTrayForm = class(TForm) ..... private ..... protected procedure ModifyTrayIcon(Action: DWORD); procedure WndProc(var msg: TMessage); override; public { Public declarations } IconNotifyData: TNotifyIconData; .... end; var DataTrayForm: TDataTrayForm; const MYMB_SHOW_INFO = $10000000; const MYMB_CLOSE_INFO = $20000000; const MYMB_MESSAGE = $40000000; implementation uses .... {$R *.DFM} procedure TDataTrayForm.ModifyTrayIcon(Action: DWORD); begin BorderIcons := []; with IconNotifyData do begin hIcon := Application.Icon.Handle; uCallbackMessage := WM_USER 1; cbSize := sizeof(IconNotifyData); Wnd := Handle; uID := 0; uFlags := NIF_MESSAGE NIF_ICON NIF_TIP; end; strPCopy(IconNotifyData.szTip, 'DataTray 標題'); shell_NotifyIcon(Action, @IconNotifyData); ShowWindow(Application.Handle, SW_HIDE); end; procedure TDataTrayForm.WndProc(var msg: TMessage); var mousePos: TPoint; begin case msg.Msg of WM_USER 1: begin case msg.LParam of WM_LBUTTONDOWN: begin GetCursorPos(mousePos); Show(); end; end; case msg.LParam of WM_RBUTTONDOWN: begin GetCursorPos(mousePos); PopupMenu1.Popup(mousePos.x, mousePos.y); //right click, so popup menu end; end; end; end; inherited; end; procedure TDataTrayForm.FormCreate(Sender: TObject); begin .... // 初值設定 ModifyTrayIcon(NIM_ADD); end; procedure TDataTrayForm.FormClose(Sender: TObject; var Action: TCloseAction); begin ..... ModifyTrayIcon(NIM_DELETE); Action:= caFree; DataTrayForm:= nil; end; .... end.發表人 - P.D. 於 2004/11/23 03:07:22 |
P.D.
版主 ![]() ![]() ![]() ![]() ![]() ![]() 發表:603 回覆:4038 積分:3874 註冊:2006-10-31 發送簡訊給我 |
本站聲明 |
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。 2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。 3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇! |