source: trunk/eraser/Eraser.Util/NativeMethods/UxTheme.cs @ 2515

Revision 2515, 3.2 KB checked in by lowjoel, 2 years ago (diff)

Set svn:keywords and svn:eol-style on all the source files.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Rev URL
Line 
1/*
2 * $Id$
3 * Copyright 2008-2010 The Eraser Project
4 * Original Author: Joel Low <lowjoel@users.sourceforge.net>
5 * Modified By:
6 *
7 * This file is part of Eraser.
8 *
9 * Eraser is free software: you can redistribute it and/or modify it under the
10 * terms of the GNU General Public License as published by the Free Software
11 * Foundation, either version 3 of the License, or (at your option) any later
12 * version.
13 *
14 * Eraser is distributed in the hope that it will be useful, but WITHOUT ANY
15 * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
16 * A PARTICULAR PURPOSE. See the GNU General Public License for more details.
17 *
18 * A copy of the GNU General Public License can be found at
19 * <http://www.gnu.org/licenses/>.
20 */
21
22using System;
23using System.Collections.Generic;
24using System.Text;
25using System.Runtime.InteropServices;
26using System.Drawing;
27using System.Windows.Forms;
28
29namespace Eraser.Util
30{
31    internal static partial class NativeMethods
32    {
33        [DllImport("UxTheme.dll", CharSet = CharSet.Unicode)]
34        [return: MarshalAs(UnmanagedType.Bool)]
35        public static extern bool IsThemeActive();
36
37        /// <summary>
38        /// Causes a window to use a different set of visual style information
39        /// than its class normally uses.
40        /// </summary>
41        /// <param name="hwnd">Handle to the window whose visual style information
42        /// is to be changed.</param>
43        /// <param name="pszSubAppName">Pointer to a string that contains the
44        /// application name to use in place of the calling application's name.
45        /// If this parameter is NULL, the calling application's name is used.</param>
46        /// <param name="pszSubIdList">Pointer to a string that contains a
47        /// semicolon-separated list of class identifier (CLSID) names to use
48        /// in place of the actual list passed by the window's class. If this
49        /// parameter is NULL, the ID list from the calling class is used.</param>
50        [DllImport("UxTheme.dll", CharSet = CharSet.Unicode)]
51        public static extern void SetWindowTheme(IntPtr hwnd, string pszSubAppName,
52            string pszSubIdList);
53
54        public enum MENUPARTS : int
55        {
56            MENU_MENUITEM_TMSCHEMA = 1,
57            MENU_MENUDROPDOWN_TMSCHEMA = 2,
58            MENU_MENUBARITEM_TMSCHEMA = 3,
59            MENU_MENUBARDROPDOWN_TMSCHEMA = 4,
60            MENU_CHEVRON_TMSCHEMA = 5,
61            MENU_SEPARATOR_TMSCHEMA = 6,
62            MENU_BARBACKGROUND = 7,
63            MENU_BARITEM = 8,
64            MENU_POPUPBACKGROUND = 9,
65            MENU_POPUPBORDERS = 10,
66            MENU_POPUPCHECK = 11,
67            MENU_POPUPCHECKBACKGROUND = 12,
68            MENU_POPUPGUTTER = 13,
69            MENU_POPUPITEM = 14,
70            MENU_POPUPSEPARATOR = 15,
71            MENU_POPUPSUBMENU = 16,
72            MENU_SYSTEMCLOSE = 17,
73            MENU_SYSTEMMAXIMIZE = 18,
74            MENU_SYSTEMMINIMIZE = 19,
75            MENU_SYSTEMRESTORE = 20,
76        }
77
78        public enum POPUPCHECKSTATES
79        {
80            MC_CHECKMARKNORMAL = 1,
81            MC_CHECKMARKDISABLED = 2,
82            MC_BULLETNORMAL = 3,
83            MC_BULLETDISABLED = 4,
84        }
85
86        public enum POPUPCHECKBACKGROUNDSTATES
87        {
88            MCB_DISABLED = 1,
89            MCB_NORMAL = 2,
90            MCB_BITMAP = 3,
91        }
92
93        public enum POPUPITEMSTATES
94        {
95            MPI_NORMAL = 1,
96            MPI_HOT = 2,
97            MPI_DISABLED = 3,
98            MPI_DISABLEDHOT = 4,
99        }
100
101        public enum POPUPSUBMENUSTATES
102        {
103            MSM_NORMAL = 1,
104            MSM_DISABLED = 2,
105        }
106
107        public const int WM_THEMECHANGED = 0x031A;
108        public const int WM_DWMCOMPOSITIONCHANGED = 0x031E;
109    }
110}
Note: See TracBrowser for help on using the repository browser.