News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

AppBars ??? Help

Started by xandaz, February 05, 2011, 09:34:27 PM

Previous topic - Next topic

xandaz

    Has anyone ever done this. I thought you'd have to build a window with a toolbar, and then use the SHAppBarMsg to reserve and area for the window and then move it. This is what i understood from the SDKs documentation. The window doesnt move to the area. Can somone help? Thanks
    Hey... theres no topics on this here so lets get to work...laughs :)

Glenn9999

One thing about not being expert on ASM is that about 80% of this board isn't about ASM anyway but Win32 API.  That means I can help more than I think sometimes.  :green2

Anyhow, some Delphi code I have from when I played around with putting Windows to the edge of the screen to act like the Windows Taskbar.  Let's assume we're putting the form window to the left side.


FDockMode := mDockLeft;
FAppBarData.cbSize := Sizeof(FAppBarData);
// message handle that should receive specific appbar messages
FAppBarData.hWnd := Handle;
FAppBarData.uEdge := Integer(FDockMode);
// set system appbar dimensions
FAppBarData.rc.Left := 0;
FAppBarData.rc.Top := 0;
FAppBarData.rc.Right := Width;
FAppBarData.rc.Bottom := Screen.Height;

SHAppBarMessage(ABM_NEW, FAppBarData);
SetWindowPos(Handle, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOSIZE Or SWP_NOMOVE);
SHAppBarMessage(ABM_SETPOS, FAppBarData);


Other than FDockMode, everything else looks to be variables defined in the API.   FDockMode was defined to be an enumerated type consistent with the API.


TDockMode = (mDockLeft, mDockTop, mDockRight, mDockBottom, mDockNone);


To get rid of the appbar you create, you have to do this when you quit or close the window:


SHAppBarMessage(ABM_REMOVE, FAppBarData);


And you have to be sure the window you create fills up the same dimensions for it to look right (though you can make a small floating one within the same space.

Hope it helps.