@@ -19,14 +19,21 @@ public enum WindowMessage : int
19
19
[ Flags ]
20
20
public enum WindowStyle : uint
21
21
{
22
- WS_SYSMENU = 0x80000
22
+ WS_SYSMENU = 0x80000 ,
23
+ }
24
+
25
+ [ Flags ]
26
+ public enum WindowStyleExtended : ulong
27
+ {
28
+ WS_EX_LAYOUTRTL = 0x00400000L ,
23
29
}
24
30
25
31
[ Flags ]
26
32
public enum WindowLongIndexFlags : int
27
33
{
28
34
GWL_WNDPROC = - 4 ,
29
- GWL_STYLE = - 16
35
+ GWL_STYLE = - 16 ,
36
+ GWL_EXSTYLE = - 20 ,
30
37
}
31
38
32
39
[ Flags ]
@@ -44,43 +51,50 @@ public enum SystemCommand
44
51
SC_KEYMENU = 0xF100
45
52
}
46
53
54
+ // TODO: Check for typing online. IntPtr, int, or long?
55
+
47
56
[ DllImport ( "user32.dll" , EntryPoint = "GetWindowLongW" , SetLastError = false ) ]
48
- public static extern int GetWindowLong ( IntPtr hWnd , int nIndex ) ;
57
+ public static extern int GetWindowLongW ( IntPtr hWnd , int nIndex ) ;
58
+
59
+ [ DllImport ( "user32.dll" , EntryPoint = "GetWindowLongPtr" , SetLastError = false ) ]
60
+ public static extern IntPtr GetWindowLongPtr ( IntPtr hWnd , int nIndex ) ;
49
61
50
62
[ DllImport ( "user32.dll" , EntryPoint = "GetWindowLongPtrW" , SetLastError = false ) ]
51
- public static extern int GetWindowLongPtr ( IntPtr hWnd , int nIndex ) ;
63
+ public static extern int GetWindowLongPtrW ( IntPtr hWnd , int nIndex ) ;
52
64
53
65
public static int GetWindowLongAuto ( IntPtr hWnd , int nIndex )
54
66
{
55
67
if ( IntPtr . Size is 8 )
56
68
{
57
- return GetWindowLongPtr ( hWnd , nIndex ) ;
69
+ return GetWindowLongPtrW ( hWnd , nIndex ) ;
58
70
}
59
71
else
60
72
{
61
- return GetWindowLong ( hWnd , nIndex ) ;
73
+ return GetWindowLongW ( hWnd , nIndex ) ;
62
74
}
63
75
}
64
76
65
77
[ DllImport ( "user32.dll" , EntryPoint = "FindWindowExW" , SetLastError = true , CharSet = CharSet . Unicode ) ]
66
78
public static extern IntPtr FindWindowEx ( IntPtr hWndParent , IntPtr hWndChildAfter , string lpszClass , string lpszWindow ) ;
67
79
68
-
69
80
[ DllImport ( "user32.dll" , EntryPoint = "SetWindowLongW" , SetLastError = false ) ]
70
- public static extern IntPtr SetWindowLong ( IntPtr hWnd , int nIndex , IntPtr dwNewLong ) ;
81
+ public static extern IntPtr SetWindowLongW ( IntPtr hWnd , int nIndex , IntPtr dwNewLong ) ;
71
82
72
- [ DllImport ( "user32.dll" , EntryPoint = "SetWindowLongPtrW " , SetLastError = false ) ]
83
+ [ DllImport ( "user32.dll" , EntryPoint = "SetWindowLongPtr " , SetLastError = false ) ]
73
84
public static extern IntPtr SetWindowLongPtr ( IntPtr hWnd , int nIndex , IntPtr dwNewLong ) ;
74
85
86
+ [ DllImport ( "user32.dll" , EntryPoint = "SetWindowLongPtrW" , SetLastError = false ) ]
87
+ public static extern IntPtr SetWindowLongPtrW ( IntPtr hWnd , int nIndex , IntPtr dwNewLong ) ;
88
+
75
89
public static IntPtr SetWindowLongAuto ( IntPtr hWnd , int nIndex , IntPtr dwNewLong )
76
90
{
77
91
if ( IntPtr . Size is 8 )
78
92
{
79
- return SetWindowLongPtr ( hWnd , nIndex , dwNewLong ) ;
93
+ return SetWindowLongPtrW ( hWnd , nIndex , dwNewLong ) ;
80
94
}
81
95
else
82
96
{
83
- return SetWindowLong ( hWnd , nIndex , dwNewLong ) ;
97
+ return SetWindowLongW ( hWnd , nIndex , dwNewLong ) ;
84
98
}
85
99
}
86
100
0 commit comments