VB6 IDE solving UAC and Visual Style issues-VBForums
Results 1 to 1 of 1

Thread: VB6 IDE solving UAC and Visual Style issues

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Jun 2012
    Posts
    830

    VB6 IDE solving UAC and Visual Style issues

    Hello,

    the VB6 IDE (VB6.exe) has issues when the UAC (Windows Vista and 7) is activated.
    This may cause that opening .vbp files for example will fail.

    To solve this it is just required to add a resource directly into the VB6.exe.

    The source code of "RequireAdmin.res" is:

    Code:
    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
       <trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
          <security>
             <requestedPrivileges>
                <requestedExecutionLevel level="requireAdministrator" uiAccess="false"/>
             </requestedPrivileges>
          </security>
       </trustInfo>
    </assembly>
    In the attachment I have added the same as a compiled resource.

    Use a resource hacker to put the resource file directly into the VB6.exe.
    I used following resource hacker for that job: http://www.angusj.com/resourcehacker/
    (File -> Open ... VB6.exe -> Action -> Add a new Resource ...)

    The result is now that every time the VB6.exe will be accessed it is ensured that the admin rights are on.
    Opening .vbp files works therefore without any problems.

    I have also attached another compiled resource file with visual styles included, just for those who want it too.

    The source code of "VisualStylesAndRequireAdmin.res" is:
    Code:
    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
       <trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
          <security>
             <requestedPrivileges>
                <requestedExecutionLevel level="requireAdministrator" uiAccess="false"/>
             </requestedPrivileges>
          </security>
       </trustInfo>
       <dependency>
          <dependentAssembly>
             <assemblyIdentity type="win32" name="Microsoft.Windows.Common-Controls" version="6.0.0.0" language="*" processorArchitecture="*" publicKeyToken="6595b64144ccf1df"/>
          </dependentAssembly>
       </dependency>
    </assembly>
    After replacing the .exe it may be necessary to restart the computer.
    Attached Files Attached Files
    Last edited by Krool; Jul 29th, 2017 at 11:08 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Featured


Click Here to Expand Forum to Full Width

Survey posted by VBForums.