PDA

Ver la Versión Completa : Barra superior


darta
25-05-2010, 23:18:18
Alguien sabe como poner un form como una barra así o algo parecido desde delphi desde delphi

Lo que quiero es poner el form en la parte superior del escritorio pero que al maximizar cualquier ventana esta no este por encima del form ni que el form tape la barra de de titulo de esa ventana

José Luis Garcí
26-05-2010, 09:01:53
has probado con ponerlo en modo SatyOnTop (creo que es así) y para que este siempre en la parte superior, controla que al mover el form que no quieres que baje, su posición top sea siempre igual a 0, permitiras echarlo a un lado o otro pero no que pierda su pocición superior.

roman
26-05-2010, 16:56:36
Lo que quieres hacer es una barra de aplicación (application desktop toolbar) y aquí (http://msdn.microsoft.com/en-us/library/cc144177%28VS.85%29.aspx) tienes toda la informacion necesaria para hacerlo.

En casa debo tener un ejemplo. Si lo encuentro lo pongo más tarde.

// Saludos

darta
03-06-2010, 23:05:37
Encontré algo que me ayudo en esto
delphipages.com/download.php?id=2765

movorack
18-08-2010, 18:24:53
En el foro falta el botón "Gracias"... :D

Habia estado buscando esta información y me ha sido de gran utilidad el enlace que ha puesto nuestro compañero roman.

Para aportar, les copio el siguiente código de ejemplo que encontré aquí (http://www.bsdg.org/swag/delphi/0237.PAS.html)


{ Windows95/NT Toolbar registering example }
{ 2/13/97 by Brandon Sneed (Nivenh)}
{ If you use this, don't give me credit }


{ Add ShellAPI to your Uses clause }

{ This code was pulled from an app i wrote and has been modified to make
it a little more understandable for those 'not-so-fluent' delphi coders }

{ I put it in the OnShow event, but it probably could go in the create event
too maybe.. or anywhere else for that matter }
procedure TForm1.OnShow(Sender: TObject);
var Result : integer;
BarData : TAppBarData;
BarHeight : Integer;
begin

self.ClientWidth := Screen.Width;
BarHeight := 24; //Alto de la barra al ejecutarse

with BarData do
begin
cbSize := SizeOf(BarData); { Size of the struct }
hwnd := self.Handle; { Window handle to register as app bar }
uCallBackMessage := WM_USER; { Message used for APPBAR specific messages }
uEdge := ABE_TOP; { Side of screen to bind with }
rc := Rect(0, 0, self.ClientWidth, BarHeight);
{^^ Rectangle being requested to use }
lParam := 0; { Only used for ABM_AUTOHIDEBAR }
end;

Result := SHAppBarMessage(ABM_NEW, BarData); { Register with explorer }
if Result = 0 then
begin
ShowMessage('Unable to register AppBar.');
exit;
end;

SHAppBarMessage(ABM_QUERYPOS, BarData); { Can we use BarData.RC ?? }
{ API wasn't clear on what this returned }
SHAppBarMessage(ABM_SETPOS, BarData); { Set the position to be the same as in RC }
{ ^^ this is what makes everything fall into place }

with OWForm do
begin
Application.ProcessMessages; { Without this, it places in the wrong spot, could
be an error on my part somewhere }
SetWindowPos(Handle, HWND_BOTTOM, 0, 0, ClientWidth, BarHeight, SWP_NOREDRAW);
{ ^^ this sets the window where we want it. at the very left edge of the screen }
{ modify this line to suit }
end;
end;

{ NOTE: This ONLY reigsters it as a toolbar and places it in the appropriate
spot. You still need to make handlers for the other ABE/ABM messages.
See the documentation in Delphi 2.0 and up for more info. Look up
SHAppBarMessage }


El borde del formulario está establecido como bsNone

Saludos a todos...