▣ manifest 파일을 이용하면 소스 수정없이 기본 컨트롤(버튼, 체크박스, 옵션, 스크롤, ...)들을 XP 스타일로 보여지도록 할 수 있습니다.
(XP이상에서 XP관련 테마를 사용하는 경우)

또한 Vista에서는 Admin 권한으로 실행 시키기 위한 권한 상승 창을 띄울 수 있습니다.


사용자 삽입 이미지

(manifest 적용 전)


사용자 삽입 이미지

(manifest 적용 후)



▣ 버튼 등의 컨트롤을 XP Style로 보여주기 위한 Manifest
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
   <assemblyIdentity
      name="Microsoft.Windows.MyCoolApp"
      processorArchitecture="x86"
      version="1.0.0.0"
      type="win32"/>

   <description>Application 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>
</assembly>


▣ Vista에서 권한 상승을 위한 Manifest
<?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>

    ▷ level
        - asInvoker : 부모 Process와 같은 권한으로 실행
        - highestAvailable : 현재 사용자 권한에서 가능한 최고 권한으로 실행
        - requireAdministrator : Admin 권한으로 실행. 일반 사용자인 경우 권한 상승 확인 과정 거침
    ▷ uiAccess
        - false :
        - true :


▣ XP Style + Vista 권한 상승 Manifest
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
   <assemblyIdentity
      name="Microsoft.Windows.MyCoolApp"
      processorArchitecture="x86"
      version="1.0.0.0"
      type="win32"/>

   <description>Application 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.v2">
      <security>
         <requestedPrivileges>
            <requestedExecutionLevel
               level="requireAdministrator"
               uiAccess="False"/>

         </requestedPrivileges>
      </security>
   </trustInfo>
</assembly>



Manifest 파일을 이용한 예제 프로그램


▷ Manifest 파일을 실행 파일에 리소스로 추가하거나, 예제 프로그램 처럼 별도의 텍스트 파일로 배포해도됩니다.


☞ 본문 출처 : http://www.enjoydev.com/blog/119(새 창으로 열기)

☞ 본인의 글 입니다. 이 글을 다른 곳에 게재하는 경우 본문 출처를 밝혀주시기 바랍니다.
2007/05/03 14:08 2007/05/03 14:08

트랙백 주소 :: http://optant.ismine.net/blog/trackback/119

댓글을 달아 주세요

  1. Bardisch 2009/07/03 23:12  댓글주소  수정/삭제  댓글쓰기

    감사합니다 ㅎㅎ

  2. 배상진 2010/02/14 03:28  댓글주소  수정/삭제  댓글쓰기

    감사합니다~새해복많이 받으세요..

  3. 아리울 2010/12/09 11:31  댓글주소  수정/삭제  댓글쓰기

    많은 정보 보고 갑니다^^

  4. 박현주 2011/09/19 17:03  댓글주소  수정/삭제  댓글쓰기

    안녕하세요~

    혹시 manifest를 .vbp에다 적용할수 있는 방법은 없을까요?

    activeX개발로 인해 .cab파일을 만들고 있는데요~

    윈7에서 권한상승에서 막혔네요~ㅠㅠ

    • 용재님 2011/09/19 19:12  댓글주소  수정/삭제

      정확히 어떤걸 원하시는건지 이해가 안가네요...

      .vbp는 프로젝트 파일이므로 적용 대상이 아닙니다.
      manifest는 EXE 실행 파일에 대한 정보를 입력하는것입니다.