api的不知道,查注册表发现很多程序的extenteditor的键值直接是notepad.exe,不知道它们怎么做的?
我的方法
var
path:array[0..254] of char;
str:string;
long:word;
begin
long:=length(path);
GetWindowsDirectory(pchar(@path),long);
str:=string(@path)+'\notepad.exe';
end;str为路径;
我的方法
var
path:array[0..254] of char;
str:string;
long:word;
begin
long:=length(path);
GetWindowsDirectory(pchar(@path),long);
str:=string(@path)+'\notepad.exe';
end;str为路径;
var P:array[0..255] of char;
Str:string;
begin
GetWindowDirectory(P,sizeof(P));
str:=p;
str:=str+'\notepad.exe';
end;
相同的 ,如果想得到系统目录,
就用
GetSystemDirectory(); 参数和上面一样.如果想知道其他的函数,可以查阅DelPhi的帮助,挺好用的.
Windows下的system目录: Use "GetSystemDirectory()"
temp目录: Use "GetTempPath ()"
当前目录: Use "GetCurrentDirectory()" 每个函数都是两个参数,
请注意前两个函数的第一个参数为 目录变量名,后一个为缓冲区; 后两个相反.
然后加上所要调用的对应程序的相对目录即可,如果调用的对应程序与主程序
位于同一目录下就不用加上相对目录了如果你想那样的话,就的在之前自己建立一个notepad 设立路径,(IE有一个固定的在 windows\system\mshtml.dll)
然后自己调用了。用ShellExecuteA ,如果想写,也可以覆盖。