@@ -11,9 +11,17 @@ namespace AppMan
11
11
public class Win32
12
12
{
13
13
/// <summary>
14
- /// Tells if we are running on Mono runtime
14
+ /// Public static props
15
15
/// </summary>
16
- public static Boolean IsRunningOnMono = Type . GetType ( "Mono.Runtime" ) != null ;
16
+ public static Boolean IsRunningOnMono ;
17
+ public static Int32 HWND_BROADCAST = 0xffff ;
18
+ public static Int32 WM_SHOWME ;
19
+
20
+ static Win32 ( )
21
+ {
22
+ IsRunningOnMono = Type . GetType ( "Mono.Runtime" ) != null ;
23
+ if ( IsRunningOnMono ) WM_SHOWME = RegisterWindowMessage ( "WM_SHOWME" ) ;
24
+ }
17
25
18
26
#region Externs
19
27
@@ -24,10 +32,16 @@ public class Win32
24
32
public static extern IntPtr SendMessage ( IntPtr hWnd , Int32 msg , IntPtr wp , IntPtr lp ) ;
25
33
26
34
[ DllImport ( "kernel32.dll" , SetLastError = true , CharSet = CharSet . Unicode ) ]
27
- internal static extern uint GetFullPathName ( string lpFileName , uint nBufferLength , StringBuilder lpBuffer , IntPtr mustBeNull ) ;
35
+ internal static extern UInt32 GetFullPathName ( String lpFileName , UInt32 nBufferLength , StringBuilder lpBuffer , IntPtr mustBeNull ) ;
28
36
29
37
[ DllImport ( "kernel32.dll" , SetLastError = true , CharSet = CharSet . Unicode ) ]
30
- internal static extern SafeFileHandle CreateFile ( string lpFileName , EFileAccess dwDesiredAccess , uint dwShareMode , IntPtr lpSecurityAttributes , uint dwCreationDisposition , uint dwFlagsAndAttributes , IntPtr hTemplateFile ) ;
38
+ internal static extern SafeFileHandle CreateFile ( String lpFileName , EFileAccess dwDesiredAccess , UInt32 dwShareMode , IntPtr lpSecurityAttributes , UInt32 dwCreationDisposition , UInt32 dwFlagsAndAttributes , IntPtr hTemplateFile ) ;
39
+
40
+ [ DllImport ( "user32.dll" ) ]
41
+ public static extern Boolean PostMessage ( IntPtr hwnd , Int32 msg , IntPtr wparam , IntPtr lparam ) ;
42
+
43
+ [ DllImport ( "user32.dll" ) ]
44
+ public static extern Int32 RegisterWindowMessage ( String message ) ;
31
45
32
46
#endregion
33
47
0 commit comments