SHAppBarMessage and MoveWindow issue

Ethereum

New member
Joined
May 9, 2006
Messages
2
Programming Experience
1-3
Hi,

I have started using SHAppBarMessage to create an AppBar for a news ticker. It creates a new bar to reserve the screen space, queries and sets the position correctly, however when i then use the MoveWindow command, it doesn't do anything.

If i put in a MsgBox command between initialising the bar and MoveWindow, it works perfectly, as per:

SHAppBarMessage(ABM_NEW, ABD)
SHAppBarMessage(ABM_QUERYPOS, ABD)
SHAppBarMessage(ABM_SETPOS, ABD)
MsgBox("Moving window")
MoveWindow(ABD.hwnd, ABD.rc.Left, ABD.rc.Top, ABD.rc.Right, ABD.rc.Bottom, True)​

If i remove the MsgBox line, the MoveWindow fails. Can anyone suggest why? I don't know what the MsgBox is forcing that makes the next line work.

Cheers!
 
Funny about that MsgBox.. set the FormBorderStyle to one of the ToolWindows and it will move into AppBar area (without MsgBox:)).
 
Ahh, that fixed it. Thanks! I've been looking everywhere and nothing seems to mention that the form has to have a certain border style.

Cheers!
 

Latest posts

Back
Top