How can i detect where the taskbar is located? I need to know for displaying my notification in the right corner. Thanks
Edit: Thank you Hans Passant. I used that with this to get location. I hope is ok.
GetTaskbarLocation(TaskbarPosition.GetTaskbarPosition());
private void GetTaskbarLocation(Rectangle rc)
{
if (rc.X == rc.Y)
{
if (rc.Right < rc.Bottom)
taskbarLocation = TaskbarLocation.Left;
if (rc.Right > rc.Bottom)
taskbarLocation = TaskbarLocation.Top;
}
if (rc.X > rc.Y)
taskbarLocation = TaskbarLocation.Right;
if (rc.X < rc.Y)
taskbarLocation = TaskbarLocation.Bottom;
}
ABM_GETTASKBARPOS
: You must specify the cbSize and hWnd when sending this message; This and this both look for a window calledShell_TrayWnd
to use as thehWnd
. – Maori