Yes, It is. Thanks a lot.
When I read the article, I find it is a little difficult to follow. I copy the example in it below.
1. How is APPBAR_CALLBACK defined?
// Provide an identifier for notification messages.
abd.uCallbackMessage = APPBAR_CALLBACK;
Can somebody show an example?
Or is another fragment AppBarCallback in the article the one? But when I compile it, I got the following error:
error C2440: '=' : cannot convert from 'void (__cdecl *)(struct HWND__ *,unsigned int,long)' to 'unsigned int'
2. Is hwndAccessBar IN parameter or OUT?
3. Where are the following variables defined?
UINT g_uSide ?
BOOL g_fAppRegistered?
Code:
// RegisterAccessBar - registers or unregisters an appbar.
// Returns TRUE if successful, or FALSE otherwise.
// hwndAccessBar - handle to the appbar
// fRegister - register and unregister flag
//
// Global variables
// g_uSide - screen edge (defaults to ABE_TOP)
// g_fAppRegistered - flag indicating whether the bar is registered
BOOL RegisterAccessBar(HWND hwndAccessBar, BOOL fRegister)
{
APPBARDATA abd;
// Specify the structure size and handle to the appbar.
abd.cbSize = sizeof(APPBARDATA);
abd.hWnd = hwndAccessBar;
if (fRegister) {
// Provide an identifier for notification messages.
abd.uCallbackMessage = APPBAR_CALLBACK;
// Register the appbar.
if (!SHAppBarMessage(ABM_NEW, &abd))
return FALSE;
g_uSide = ABE_TOP; // default edge
g_fAppRegistered = TRUE;
} else {
// Unregister the appbar.
SHAppBarMessage(ABM_REMOVE, &abd);
g_fAppRegistered = FALSE;
}
return TRUE;
}
Thanks,