请问如何实现双击文件图标,用自己的程序打开?双击文件图标后,文件路径是否保存在注册表某处?如何编程实现?
解决方案 »
- TCP异步通信模型,服务器接收消息,如何判断是哪个客户端发来的消息?
- 在一个程序中如何使用两种View(CView,CFormView)
- 大家帮帮我。。vc,模式子对话框关闭时,主对话框也随之关闭,怎样才能不使它关闭,你们遇到过这种情况没?
- 高分求《VISUAL C++网络程序设计实例详解》随书光盘
- 为什么我的窗口最小化会在左下脚,而且还可以移动?而且在正常状态下不能在托盘显示!
- 关于串口通信同步的问题
- 在工具栏上动画的问题
- 如何在pda上开发一个mpeg4编解码程序
- 俺问个土问题:visual Assist的用法。
- 伤心,刚回复点自信,就再招打击.......
- 如果执行accept函数返回10035(WSAEWOULDBLOCK)错误时应该怎样处理啊?
- 联众是如何耍我的!
CWinApp::RegisterShellFileTypes
void RegisterShellFileTypes( BOOL bCompat = FALSE );ParametersbCompatTRUE adds registration entries for shell commands Print and Print To, allowing a user to print files directly from the shell, or by dragging the file to a printer object. It also adds a DefaultIcon key. By default, this parameter is FALSE for backward compatibility.ResCall this member function to register all of your application’s document types with the Windows File Manager. This allows the user to open a data file created by your application by double-clicking it from within File Manager. Call RegisterShellFileTypes after you call AddDocTemplate for each of the document templates in your application. Also call the EnableShellOpen member function when you call RegisterShellFileTypes.RegisterShellFileTypes iterates through the list of CDocTemplate objects that the application maintains and, for each document template, adds entries to the registration database that Windows maintains for file associations. File Manager uses these entries to open a data file when the user double-clicks it. This eliminates the need to ship a .REG file with your application.If the registration database already associates a given filename extension with another file type, no new association is created. See the CDocTemplate class for the format of strings necessary to register this information.
可以在appwizard的第四步(如果没记错的话)advanced中修改支持文件的扩展名
然后再如上面仁兄说的加上
在app类中调用下面的函数RegisterShellFileTypes
CWinApp::RegisterShellFileTypes
void RegisterShellFileTypes( BOOL bCompat = FALSE );
我把里面的两幅图截了出来你可以先看看
http://kingeyes.51.net/b.jpg
http://kingeyes.51.net/a.jpg