1。可以吧程序方到启动里
2。用api函数测试如果再空闲时就启动time计数器控件然后就行了
2。用api函数测试如果再空闲时就启动time计数器控件然后就行了
解决方案 »
- 一个DBGridEh的过滤问题,在线等待,急...
- 关于DLL中类型转化的问题,C++中的Set怎么在Delphi中使用啊!!高手帮帮
- 关于checklistbox
- 有关DLL问题请高手指点
- 谁能给我个消息处理的例子!谢谢
- delphi如何实现IObjectSafety接口让自己写的控件相对IE为安全控件
- ?无法运行regsrv程序,怎么办?
- 字符串结尾是以什么来标识的?
- 求助:关于RaidoRroup窗口
- 如何消除onkeydown中的beep声
- $$$$---如何判定edit.text中输入的内容是“指定的某中格式”----$$$$
- delphi有没有动态记录表控件或类,可以自定义字段,添加、查找、更新、删除记录等功能
1、比方一些实时监控程序,象KILL、瑞星等杀毒软件,在系统启动时便自动运行了,我看它们也不在启动里啊。
2、如何判断系统是否处于空闲状态,用哪个API函数 ?
路径是:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run
procedure AddToAutoRun(szCaption,szExeName:string);
var
reg:tregistry;
begin
reg:=tregistry.create;
reg.rootkey:=hkey_local_machine;
if reg.Openkey('Software\Microsoft\Windows\CurrentVersion\Run',true) then
reg.writestring(szCaption,szExeName);
reg.free;
end;用法:
AddToAutoRun('随便一个名字','你的可执行文件名');
例如:
AddToAutoRun('MyAutoRun',paramstr(0));
依照你的方式做,好象程序并没有启动啊。
.Registry的HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run
.加到启动中
.在 win.ini 中加入 Run= \path\your application name
.如果你的程序是个事务,那它是在加载 Windows时就执行了。2. 有两种可能
.你的程序是个一般 Win32应用程序, 用子类化Application.Handle后, 用Screen server消息作。
.是个事务, 因为你的程序是运行在 1级,可以得到空闲通知
procedure AddToAutoRun(szCaption,szExeName:string);
var
reg:tregistry;
begin
reg:=tregistry.create;
reg.rootkey:=hkey_local_machine;
if reg.Openkey('Software\Microsoft\Windows\CurrentVersion\Run',true) then
reg.writestring(szCaption,szExeName);
reg.free;
end;这段程序已经把你的程序写到注册表里了!
你可以到注册表里
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run
下看看!如有就OK了,你下次在启动机器时就可以了!
1 用注册表编辑器删除。(废话)
2 运行 开始/程序/附件/系统工具/系统信息,在工具菜单下单击系统配置项,在启动页下可以使已经添加的项失效。
3 当然用程序,方法和写入一样,换一个函数就行了。查一查HELP吧。BTW,你几年级了,是MM吗?(不想说也没关系)。
The RegDeleteValue function removes a named value from the specified registry key.
LONG RegDeleteValue(
HKEY hKey, // handle to key
LPCTSTR lpValueName // address of value name
);
Parameters
hKey
Handle to a currently open key or any of the following predefined reserved handle values:
HKEY_CLASSES_ROOT
HKEY_CURRENT_CONFIG
HKEY_CURRENT_USER
HKEY_LOCAL_MACHINE
HKEY_USERS
Windows NT: HKEY_PERFORMANCE_DATA
Windows 95 and Windows 98: HKEY_DYN_DATA lpValueName
Pointer to a null-terminated string that names the value to remove. If this parameter is NULL or points to an empty string, the value set by the RegSetValue function is removed.
Return Values
If the function succeeds, the return value is ERROR_SUCCESS.If the function fails, the return value is a nonzero error code defined in WINERROR.H. You can use the FormatMessage function with the FORMAT_MESSAGE_FROM_SYSTEM flag to get a generic description of the error.
删除:
uses registry;
procedure DeleteAutoRun(szCaption:string);
var
reg:tregistry;
begin
reg:=tregistry.create;
reg.rootkey:=hkey_local_machine;
if reg.Openkey('Software\Microsoft\Windows\CurrentVersion\Run',true) then
reg.DeleteValue(szCaption);
reg.free;
end;
其中,szCaption就是你上次写的名字!