▣ 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(새 창으로 열기)
Creative Commons License
Creative Commons License

TRACKBACK http://blog.niu.kr/trackback/52 관련글 쓰기

댓글을 달아 주세요

<PREV 1 ... 17 18 19 20 21 22 23 24 25 ... 54 NEXT>