@@ -27,12 +27,12 @@ public static class NativeMan
2727 public const int CS_DBLCLKS = 0x8 ;
2828 public const int WM_NCPAINT = 0x0085 ;
2929 public const int WM_ACTIVATEAPP = 0x001C ;
30+ public const int SW_SHOW = 5 ;
31+ public const int SEE_MASK_INVOKEIDLIST = 12 ;
32+ public const int WS_EX_TRANSPARENT = 0x20 ;
3033
3134 // ENUMS
3235
33- /// <summary>
34- /// Represents possible dialogbox command id values by the MB_GetString function.
35- /// </summary>
3636 public enum DialogBoxCommandID : int
3737 {
3838 IDOK = 0 ,
@@ -78,6 +78,31 @@ public struct MARGINS
7878 public int Bottom ;
7979 }
8080
81+ [ StructLayout ( LayoutKind . Sequential ) ]
82+ public struct SHELLEXECUTEINFO
83+ {
84+ public int cbSize ;
85+ public uint fMask ;
86+ public IntPtr hwnd ;
87+ [ MarshalAs ( UnmanagedType . LPTStr ) ]
88+ public string lpVerb ;
89+ [ MarshalAs ( UnmanagedType . LPTStr ) ]
90+ public string lpFile ;
91+ [ MarshalAs ( UnmanagedType . LPTStr ) ]
92+ public string lpParameters ;
93+ [ MarshalAs ( UnmanagedType . LPTStr ) ]
94+ public string lpDirectory ;
95+ public int nShow ;
96+ public IntPtr hInstApp ;
97+ public IntPtr lpIDList ;
98+ [ MarshalAs ( UnmanagedType . LPTStr ) ]
99+ public string lpClass ;
100+ public IntPtr hkeyClass ;
101+ public uint dwHotKey ;
102+ public IntPtr hIcon ;
103+ public IntPtr hProcess ;
104+ }
105+
81106 // KERNEL32 METHODS
82107
83108 [ DllImport ( "kernel32" , SetLastError = true , CharSet = CharSet . Ansi ) ]
@@ -88,6 +113,9 @@ public struct MARGINS
88113
89114 // USER32 METHODS
90115
116+ [ DllImport ( "user32.dll" , SetLastError = true , CharSet = CharSet . Unicode ) ]
117+ public static extern bool SetProcessDPIAware ( ) ;
118+
91119 [ DllImport ( "user32.dll" , SetLastError = true , CharSet = CharSet . Unicode ) ]
92120 public static extern IntPtr MB_GetString ( int strId ) ;
93121
@@ -131,6 +159,11 @@ public struct MARGINS
131159 [ DllImport ( "Gdi32.dll" , EntryPoint = "CreateRoundRectRgn" ) ]
132160 public static extern IntPtr CreateRoundRectRgn ( int nLeftRect , int nTopRect , int nRightRect , int nBottomRect , int nWidthEllipse , int nHeightEllipse ) ;
133161
162+ // SHELL32 METHODS
163+
164+ [ DllImport ( "shell32.dll" , SetLastError = true , CharSet = CharSet . Unicode ) ]
165+ public static extern bool ShellExecuteEx ( ref SHELLEXECUTEINFO lpExecInfo ) ;
166+
134167 // CUSTOM METHODS
135168
136169 public static string GetMessageBoxText ( DialogBoxCommandID messageId )
0 commit comments