Anyone know how SHAppBarMessage work in creating autohide?

1
2
3
4
	APPBARDATA  Keyboardbar = {0};

	Keyboardbar.cbSize = sizeof (APPBARDATA);
	Keyboardbar.hWnd = hwnd;


register app bar
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
	switch (message)
	{
	case WM_CREATE:
		Keyboardbar.uEdge = ABE_RIGHT;
		Keyboardbar.lParam = TRUE;
		SHAppBarMessage (ABM_SETAUTOHIDEBAR, &Keyboardbar);

		GetWindowRect (hwnd, &keybar);

		Keyboardbar.uEdge = ABE_TOP;
		Keyboardbar.rc = keybar;
		SHAppBarMessage (ABM_QUERYPOS, &Keyboardbar);

		Keyboardbar.uEdge = ABE_TOP;
		Keyboardbar.rc = keybar;
		SHAppBarMessage (ABM_SETPOS, &Keyboardbar);

etc etc
end of code
1
2
3
4
5
6
7
8
	case WM_DESTROY:
		Keyboardbar.uEdge = ABE_RIGHT;
		Keyboardbar.lParam = FALSE;
		SHAppBarMessage (ABM_SETAUTOHIDEBAR, &Keyboardbar);
		DestroyWindow (hwnd);
		return 0;
	}
	return DefWindowProc (hwnd, message, wParam, lParam);

unregister window as app bar.

Is this correct so far what i m doing? if so, what do i do so my app bar will auto hide like the taskbar.
Last edited on
Topic archived. No new replies allowed.