Hi,
Using APIs like WIN32 API can be a bit tedious. Take for example
CreateFile function, it has lots of parameters and those parameters
are integers which take #define values or-ed together. In order
to find out about those parameters I usually google "msdn CreateFile"
(I don't know why MSDN is dog slow on my machine, when I press F1
it takes like one minute to start up)
I would be really glad if Visual Assist would find out those parameters for me (from MSDN locally, online, some kind of webservice)
CreateFile resides in "ms-help://MS.VSCC.v90/MS.MSDNQTR.v90.en/fileio/fs/createfile.htm", it would be a matter of parsing the html file
and sending the <dd> paragraph after dwShareMode:
<dt><em>dwShareMode</em> [in] </dt>
<dd>
<p>The requested sharing mode of the file or device, which can be read, write, both, delete, all of these, or none (refer to the following table). Access requests to attributes or extended attributes are not affected by this flag.</p>
<p>If this parameter is zero and <strong>CreateFile</strong> succeeds,
the file or device cannot be shared and cannot be opened again until the handle to the file or device is closed. For more information, see
the Remarks section.</p>
<p>You cannot request a sharing mode that conflicts with the access mode that is specified in an existing request
that has an open handle. <strong>CreateFile</strong> would fail and the <a id="ctl00_mainContentContainer_ctl09" onclick="javascript:Track('ctl00_mainContentContainer_ctl00|ctl00_mainContentContainer_ctl09',this);" href="http://msdn.microsoft.com/en-us/library/ms679360(VS.85).aspx"><strong>GetLastError</strong></a> function would return ERROR_SHARING_VIOLATION.</p>
<p>To enable a process to share a file or device while another process has the file or device open, use a compatible combination of one or
more of the following values. For more information about valid combinations of this parameter with the <em>dwDesiredAccess</em> parameter, see
<a id="ctl00_mainContentContainer_ctl10" onclick="javascript:Track('ctl00_mainContentContainer_ctl00|ctl00_mainContentContainer_ctl10',this);" href="http://msdn.microsoft.com/en-us/library/aa363874(VS.85).aspx">Creating and Opening Files</a>.</p>
<p class="note"><strong>Note</strong> The sharing options for each open handle remain in effect until that handle is closed, regardless of process context.</p>
<table>
<tr><th>Value</th><th>Meaning</th></tr>
<tr><td>
<dl><dt>0</dt><dt>0x00000000</dt></dl>
</td><td><p>Prevents other processes from opening a file or device if they request delete, read, or write access.</p>
</td></tr>
<tr><td>
<dl><dt>FILE_SHARE_DELETE</dt><dt>0x00000004</dt></dl>
</td><td><p>Enables subsequent open operations on a file or device to request delete access.</p>
<p>Otherwise, other processes cannot open the file or device if they request delete access.</p>
<p>If this flag is not specified, but the file or device has been opened for delete access, the function fails.</p>
<p class="note"><strong>Note</strong> Delete access allows both delete and rename operations.</p>
</td></tr>
<tr><td>
<dl><dt>FILE_SHARE_READ</dt><dt>0x00000001</dt></dl>
</td><td><p>Enables subsequent open operations on a file or device to request read access.</p>
<p>Otherwise, other processes cannot open the file or device if they request read access.</p>
<p>If this flag is not specified, but the file or device has been opened for read access, the function fails.</p>
</td></tr>
<tr><td>
<dl><dt>FILE_SHARE_WRITE</dt><dt>0x00000002</dt></dl>
</td><td><p>Enables subsequent open operations on a file or device to request write access.</p>
<p>Otherwise, other processes cannot open the file or device if they request write access.</p>
<p>If this flag is not specified, but the file or device has been opened for write access or has a file mapping with
write access, the function fails.</p>
</td></tr>
</table>
<p> </p>
</dd>
Here is what I had in mind: