且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

设计文本编辑器

更新时间:2022-06-24 09:56:59

它有两个部分:您的应用程序功能+与Shell相关的系统注册表设置.

在应用程序部分,您需要处理在启动时传递给您的应用程序的命令行参数.因为这是C,所以您有一个名为main的入口点.应用程序的OS加载程序传递命令行参数argcargv,它们出现在以下签名中的一个
There are two parts of it: your application functionality + system registry settings related to the Shell.

On application part, you need to handle the command line parameters passed to your application when it is started. As this is C, you have an entry point called main. The OS loader of the applications passes the command line parameters argc, and argv as they appear in on of the following signatures
int main(int argc, char **argv);
int main(int argc, char *argv[]);
int main(int argc, char **argv, char **envp);



请参阅:
http://en.wikipedia.org/wiki/Main_function#C_and_C.2B.2B [ ^ ].

您的应用程序应解析命令行,识别文件名并尝试加载文件.

在系统注册表方面,您需要更新寄存器以注册您的应用程序与文件名模式(通常称为扩展名")识别的某些文件类型之间的关联,但该术语不正确:没有扩展名" 在现代文件系统中;文件名中最后一个".字符后的字母只是文件名的一部分).请参阅:
http://msdn.microsoft.com/zh-我们/library/windows/desktop/cc144158%28v=vs.85%29.aspx [ http://msdn.microsoft.com/zh-我们/library/windows/desktop/cc144156%28v=vs.85%29.aspx [



Please see:
http://en.wikipedia.org/wiki/Main_function#C_and_C.2B.2B[^].

Your application should parse the command line, recognize file name(s) and try to load a file.

On the system registry side, you need to update the register to register the association between your application and some file type(s) recognized by the file name pattern (usually called "extensions", but this term is incorrect: there are no "extensions" in modern file systems; the letters after the last ''.'' character in file names are just the part of the file name). Please see:
http://msdn.microsoft.com/en-us/library/windows/desktop/cc144158%28v=vs.85%29.aspx[^],
http://msdn.microsoft.com/en-us/library/windows/desktop/cc144156%28v=vs.85%29.aspx[^].

—SA