| Ver tema anterior :: Ver tema siguiente |
| Autor |
Mensaje |
MarioMarieti Cmdr

Registrado: 28 Dic 2004Mensajes: 144Ubicación: Murcia (España)
|
Publicado: Mar 29 Ene, 2008 10:00 am Asunto: Como saber si se ha pulsado el boton minimizar de 1 ventana |
|
|
Se puede saber si se ha pulsado con el ratón el botón de minimizar de una ventana, y si es así en que evento y si se puede interceptar/ anular para que haga otra cosa.
Gracias. |
|
| Volver arriba |
|
 |
_Leo Site Admin

Registrado: 11 Ago 2002Mensajes: 1875Ubicación: Lanzarote - Islas Canarias (España)
|
Publicado: Mar 29 Ene, 2008 11:50 am Asunto: |
|
|
Prueba con el siguiente código, ponlo debajo de la parte privada de la clase del Form en la cabecera:
- Interceptar:
| Código: | void __fastcall WmSysCommand(TWMSysCommand& msg)
{
if ((msg.CmdType & 0xFFF0) == SC_MINIMIZE)
ShowMessage("Aquí llamamos a otro form o lo que queramos");
else
inherited::Dispatch(&msg);
}
BEGIN_MESSAGE_MAP
MESSAGE_HANDLER(WM_SYSCOMMAND, TWMSysCommand, WmSysCommand)
END_MESSAGE_MAP(TForm) |
- Anular:
| Código: | void __fastcall WmSysCommand(TWMSysCommand& msg)
{
if ((msg.CmdType & 0xFFF0) != SC_MINIMIZE)
inherited::Dispatch(&msg);
}
BEGIN_MESSAGE_MAP
MESSAGE_HANDLER(WM_SYSCOMMAND, TWMSysCommand, WmSysCommand)
END_MESSAGE_MAP(TForm) |
|
|
| Volver arriba |
|
 |
|