Getting Information About the Taskbar

You can also use SHAppBarMessage to get information about the system's taskbar—specifically, information about the taskbar's position. In SHELLFUN, the user can do this by choosing a menu option.

case IDM_TASKBAR:
{
APPBARDATA abd;
char buff [MAX_PATH];

memset (buff, `\0', sizeof (buff));

abd.cbSize = sizeof (APPBARDATA);
SHAppBarMessage (ABM_GETTASKBARPOS, &abd);

wsprintf (buff, "Left: %d, Right: %d, Top: %d, Bottom: %d",
abd.rc.left, abd.rc.right, abd.rc.top, abd.rc.bottom);

// Update the multiline edit control.
SendMessage (hwndEdit, WM_SETTEXT, 0, (LPARAM)buff);
break;
}

The information returned from the call to SHAppBarMessage is displayed in the multiline edit control in the client area of the main SHELLFUN window, as shown in Figure 11-8.

Figure 11-8.

Taskbar information retrieved by the SHELLFUN sample.