Ver Mensaje Individual
  #2  
Antiguo 11-09-2007
Avatar de dec
dec dec is offline
Moderador
 
Registrado: dic 2004
Ubicación: Alcobendas, Madrid, España
Posts: 13.142
Reputación: 36
dec Tiene un aura espectaculardec Tiene un aura espectacular
Hola,

Basándome en código fuente encontrado Scalabium.com aquí tienes un primer intento de función "ShowSystemMenu()":

Código Delphi [-]
function ShowSystemMenu(wHandle: hwnd;
 posX, posY: integer): boolean;
var
  flags: cardinal;
  hMenuItem: DWORD;
  hMenuHandle: HMENU;
begin
  hMenuHandle := GetSystemMenu(wHandle, false);
  flags := TPM_LEFTBUTTON or TPM_RIGHTBUTTON or TPM_RETURNCMD;
  hMenuItem := LongWord(TrackPopupMenu(hMenuHandle,
                flags, posX, posY, 0, wHandle, nil));
  if (hMenuItem > 0) then
    SendMessage(wHandle, WM_SYSCOMMAND, hMenuItem, 0);
  result := (hMenuItem > 0);
end;

procedure TForm1.Button1Click(Sender: TObject);
begin
  // Ejemplo de llamada a la función
  ShowSystemMenu(self.Handle, self.Left,
   self.Top+GetSystemMetrics(SM_CYCAPTION));
end;

Tú adáptalo como mejor te parezca.
__________________
David Esperalta
www.decsoftutils.com

Última edición por dec fecha: 11-09-2007 a las 12:32:16.
Responder Con Cita