⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 wpw_wapi_shell_95.html

📁 VC programing
💻 HTML
字号:
<HTML>

<HR><A NAME=WINAPI_SHELL_FILE_ASSOCIAT>
Return to <a href="wpw_wapi_index.html#TOC">Table of Contents for this chapter</a><br>
<H4>Subject: File Association</H4><PRE>
In article <DA8xsn.1wH@emr1.emr.ca> jagrant@emr1.emr.ca "John Grant" writes:

>WriteProfileString can be used to add an entry to [Extensions] in win.ini to
>create a 'file association', but apparently that's not the correct way to do
>it.  Instead the install app should:
>     (a) use regedit/s with a previously created .reg file
>or   (b) use the Reg...() functions
>Right?

Right!

>Ok, so if the registration database is preferred, then why do I see all of
>those entries in the [extensions] section of win.ini?  Not just for Windows
>applets like Notepad & Write, but also for large commercial apps that also
>have entries in the registration database (Word, PowerPoint etc)...

I suspect for reasons of backward compatibility with Windows 3.0, which
didn't have the Registry.

>It appears that if an entry is added using regedit, the regedit app does
>not make a corresponding entry in win.ini.  So how are they created?  Do the
>install procedures for those apps do the regedit/s thing *AND* also make
>corresponding entries in win.ini?  Why?

Again, backwards compatibility (pure guess!)?

>When ShellExecute() is used, Windows uses FindExecutable() in <shellapi.h>
>to find the .EXE to run, right?  Does it use:
>        (a) the info in the registration database exclusively
>        (b) the entries in the [extensions] section of win.ini exclusively
>        (c) both, until it finds a match

"ShellExecute" is one of the REGISTRY APIs so I'd (again) guess that it
uses the registry key.

Chris
-- 
--------------------------------------------------------------------------
| Chris Marriott, Warrington, UK      | Author of SkyMap v2 shareware    |
| chris@chrism.demon.co.uk            | astronomy program for Windows.   |
|      For more info, see http://www.winternet.com/~jasc/skymap.html     |
|      Author member of Association of Shareware Professionals (ASP)     |
--------------------------------------------------------------------------
 
</PRE> 

</HTML>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -