public IntPtr WndProc(IntPtr hwnd, int msg, IntPtr wparam, IntPtr lparam, ref bool handled)
{
if (appbarMessageId == -1)
{
return IntPtr.Zero;
}
if (msg == appbarMessageId)
{
System.Diagnostics.Trace.WriteLine("Callback on AppBarMessage: " + wparam.ToString());
switch (wparam.ToInt32())
{
case 1:
// Reposition to the top of the screen.
if (this.Top != 0)
{
System.Diagnostics.Trace.WriteLine("Repositioning menu bar to top of screen.");
this.Top = 0;
}
/*SHAppBarMessageHelper.QuerySetPosition(hwnd,
new System.Drawing.Size() { Height = (int)this.ActualWidth, Width = (int)this.ActualWidth },
SHAppBarMessage1.Win32.NativeMethods.ABEdge.ABE_TOP);*/
break;
}
handled = true;
}
return IntPtr.Zero;
}