public AppBarNativeWindow(int barHeight, bool topBar) { this.height = barHeight; visible = false; isTopMost = false; edge = topBar ? NativeMethods.ABE.ABE_TOP : NativeMethods.ABE.ABE_BOTTOM; this.CreateHandle(new CreateParams { Parent = NativeMethods.HWND_MESSAGE, ClassName = "Message" }); callbackMessageNum = NativeMethods.WM_USER + count++; // register as AppBar var appBarData = new NativeMethods.APPBARDATA(this.Handle, callbackMessageNum); NativeMethods.SHAppBarMessage(NativeMethods.ABM.ABM_NEW, ref appBarData); }