Media Player on Toolbar

G

Guest

When Windows Media Player is minimumized on its toolbar, the player has a
compact player interface. Can something like this be done with VS.NET? And
How?

TIA,
david
 
D

David Sobey

yes it can. i have done something like this with Delphi. You'll need to
familiarise yourself with Spy ++. From memory, it involves getting the
handle to the desktop window, then getting each subsequent child until you
reach the correct toolbar window. As far as i recall, you then set your
toolbar window to be the child of this window. i did all this via win api
calls, not sure if it can be done via .NET

cheers
dave
 
B

Bern

You cannot set a process's window to become a child of another process's
window in winNT.

The correct way is to create a deskband.Search MSDN for more info.
Deskband can be implemented as a COM dll but can be done in VS.net as well.
 
D

David Sobey

procedure TFormHandler.SlideoutForm;

var

NotifyWndScreenCoord : TRect;

ParentWndScreenCoord : TRect;

begin

SetWindowLong(TaskbarForm.Handle, GWL_STYLE, WS_CHILD);

ParentWnd := FindWindow('Shell_TrayWnd', '');

ParentWnd := FindWindowEx(ParentWnd, 0, 'ReBarWindow32', nil);

Windows.SetParent(TaskbarForm.Handle, ParentWnd);

GetWindowRect(ParentWnd, ParentWndScreenCoord);

TaskbarForm.Top:=4;

TaskbarForm.Left:=ParentWndScreenCoord.Right-ParentWndScreenCoord.Left-TaskbarForm.Width;

TaskbarForm.show;

TaskbarForm.update;

NotifyWnd := FindWindowEx(ParentWnd, 0, 'MSTaskSwWClass', nil);

GetWindowRect(NotifyWnd, NotifyWndScreenCoord);

MoveCoord.x:=NotifyWndScreenCoord.Left-ParentWndScreenCoord.Left;

MoveCoord.y:=0;

MoveCoord.width:=NotifyWndScreenCoord.Right-NotifyWndScreenCoord.Left-TaskbarForm.Width;

MoveCoord.height:=NotifyWndScreenCoord.Bottom-NotifyWndScreenCoord.Top;

MoveWindow(NotifyWnd, MoveCoord.x, MoveCoord.y, MoveCoord.width,
MoveCoord.height, true);

end;
 
G

Guest

Thanks for that.

I have one more question.

When WMP is docked, we still have buttons for "play", "Stop", etc. Can we do
that with BandObject?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top