Drag n' Drop files in Vista RC1?
Dear all,
I find a very strange issue in Vista RC1.
If we wanna add "requireAdministrator" in the program,
(Refhttp://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnlong/html/AccProtVista.asp)
The program will still fail to get the "WM_DROPFILES" message from Vista.
Does anyone have the same problem?...Orz
Best Regards,
Shuyang
p.s. The following is my manifest
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<assemblyIdentity
version="1.0.0.0"
processorArchitecture="X86"
name="Microsoft.Windows.XPStyle"
type="win32"
/>
<description>Your app description here</description>
<dependency>
<dependentAssembly>
<assemblyIdentity
type="win32"
name="Microsoft.Windows.Common-Controls"
version="6.0.0.0"
processorArchitecture="X86"
publicKeyToken="6595b64144ccf1df"
language="*"
/>
</dependentAssembly>
</dependency>
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
<security>
<requestedPrivileges>
<requestedExecutionLevel
level="requireAdministrator"
uiAccess="false"/>
</requestedPrivileges>
</security>
</trustInfo>
</assembly>
Dear Raymond,
My application needs "Drag n' Drop" and "Write registry key into HKEY_CLASSES_ROOT"
I've tried "requireAdministrator" and "highestAvailable" in the manifest.xml for registry key writing
But they would both disallow the "Drag n' Drop" function.
Is there a way to allow "Drag n' Drop" and "Write registry key into HKEY_CLASSES_ROOT" in the application?
Best regards,
Shuyang
You can use your imagination. For example, have two processes, one that does the UI and accepts the drag/drop, and another that does the HKCR stuff. But generally speaking applications should not be messing with HKCR at runtime; they should only update it at install time.
Dear Raymond,
It seems that WM_COPYDATDA does not work on the "requireAdministrator" program.
(Please ref to the topic WM_COPYDATA and manifest.xml)
I try to use "Event" to let two programs communicate each other.
The Event is created in the "requireAdministrator" program and the other program without "requireAdministrator" would signal it.
However, I find out that the program without "requireAdministrator" can not signal the event which is created by the "requireAdministrator" program.
This design only works when the event is created in the program without "requireAdministrator".
Does it the right behavior or it will be fixed in the future version of Vista?
Best regards,
Shuyang
This is expected. When the high-privilege process creates the event, the default security attributes permit only other high-privilege processes to access it. If you want a lower-privilege process to be able to access the event, you need to set custom security on the event.
Use the LPSECURITY_ATTRIBUTES parameter of CreateEvent to set custom security on an event. Note that this is not for the faint of heart. If you mess up, you can create a security hole. (The same security hole that the default security attributes are trying to protect you from.)