Jump to content

Toolbar (appbar) advice using SHAppBarMessage


Go to solution Solved by SmOke_N,

Recommended Posts

I've created a handy toolbar using AutoIt which sits on the right-hand site of all my administrator's screens.

The problem I have is whilst trying to get it to behave like the windows taskbar & office toolbar (where windows maximize up to it, but not beyond it) I implemented a loop which monitors for new windows and their coordinates and moves them accordingly, however this has proven to be troublesome and unreliable.

I have since read about the SHAppBarMessage function which seems to be some kind of C++ function (which I know absolutely nothing about) that sends an appbar message to the system notifying it that an appbar has been activated.

The trouble is, knowing nothing about programming other than what I've picked up in AutoIt, I have no idea how to implement this - I wouldn't even know where to start.

Is there anyone out there who happens to be a C++ guru who can at least point me in the right direction?

EDIT 19/03/2014 - I finally figured this out, nearly 8 years later, after returning to this somewhat dormant project: >New thread with working example

Edited by Valiante
Link to comment
Share on other sites

From what I can tell, SHAppBarMessage, Reports the start bar's position and size, has nothing to do with setting zones on the screen for a toolbar to reside. You are on the right track. You could try asking on an IRC Server in a C++ channel or win32 programming channel and ask about that, and they should tell you a reference to one of the windows functions. From there you can call a windows dll to accomplish the task. The function can be looked up at microsoft.com's MSDN windows API documentation. I hope this points you in the right direction. All you need to know is all the parameters of the windows function then set up to call in in AutoIt, much like the SHAppBarMessage function you were asking about in post: http://www.autoitscript.com/forum/index.ph...SHAppBarMessage

Ooo Ëxçã¿îbúr ooO"Information Is Not Knowledge." ~Albert Einstein
Link to comment
Share on other sites

For more help, please post the code you have so far (or at least the not working part)

It's really hard to help when people leave us with vague descriptions and expect us to stab in the dark until we come up with an answer that suits them.

if it's on the side of the screen, try something like

$WS_EX_TOPMOST
Link to comment
Share on other sites

For more help, please post the code you have so far (or at least the not working part)

It's really hard to help when people leave us with vague descriptions and expect us to stab in the dark until we come up with an answer that suits them.

if it's on the side of the screen, try something like

$WS_EX_TOPMOST
I understand where you're coming from Paulie, but it doesn't apply to this situation. I'm not asking for help with my AutoIt code, otherwise I would have quoted that which doesn't work. It all works fine but I'm toying with the idea of somehow using this SHAppBarMessage which seems to be a built in Windows funtion.

Regards,

Valiante

Link to comment
Share on other sites

  • Moderators
  • Solution

http://msdn.microsoft.com/library/default....pbarmessage.asp

http://www.autoitscript.com/forum/index.ph...st&p=149636

Edit:

Here are the values for those on MSDN:

$ABM_ACTIVATE       = 0x06
$ABM_GETAUTOHIDEBAR     = 0x07
$ABM_GETSTATE       = 0x04
$ABM_GETTASKBARPOS  = 0x05
$ABM_NEW        = 0x00
$ABM_QUERYPOS       = 0x02
$ABM_REMOVE     = 0x01
$ABM_SETAUTOHIDEBAR = 0x08
$ABM_SETPOS     = 0x03
$ABM_WINDOWPOSCHANGED   = 0x09
Edited by SmOke_N

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...