File tree 1 file changed +6
-1
lines changed
EarTrumpet/Interop/Helpers
1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change 1
1
using System ;
2
+ using System . Drawing ;
2
3
using System . Diagnostics ;
3
4
using System . Runtime . InteropServices ;
4
5
using System . Windows . Forms ;
@@ -43,7 +44,7 @@ public static State Current
43
44
var appBarData = new APPBARDATA
44
45
{
45
46
cbSize = ( uint ) Marshal . SizeOf ( typeof ( APPBARDATA ) ) ,
46
- hWnd = hWnd
47
+ lParam = 0x42 // magic to get StartAllBack active taskbar rect
47
48
} ;
48
49
49
50
// SHAppBarMessage: Understands Taskbar auto-hide
@@ -52,6 +53,10 @@ public static State Current
52
53
{
53
54
state . Size = appBarData . rect ;
54
55
state . Location = ( Position ) appBarData . uEdge ;
56
+ var r = new Rectangle ( appBarData . rect . Left , appBarData . rect . Top ,
57
+ appBarData . rect . Right - appBarData . rect . Left ,
58
+ appBarData . rect . Bottom - appBarData . rect . Top ) ;
59
+ state . ContainingScreen = Screen . FromRectangle ( r ) ;
55
60
}
56
61
else
57
62
{
You can’t perform that action at this time.
0 commit comments