O
Olo
Hello,
I added Prefilter function to main form, becouse I have to catch key event
globaly. Everything is ok except maximize command. When I press MaximizeBox
it doesn't work.
Bellow you find me PreFilerMessage :
public bool PreFilterMessage(ref Message m)
{
const int SC_MINIMIZE = 0xF020;
const int SC_MAXIMIZE = 0xF030;
const int WM_MDIMAXIMIZE = 0x0225;
if(!m_designer.IsPropertyGridFocus)
{
switch ((int)m.WParam)
{
case 9: // tab
return true;
case 37: // left
m_designer.KeyLeftCmd();
return true;
case 38: // up
m_designer.KeyUpCmd();
return true;
case 39: // right
m_designer.KeyRightCmd();
return true;
case 40: // down
m_designer.KeyDownCmd();
return true; // this means that we handled the code
case SC_MAXIMIZE: //maximize
this.WindowState = FormWindowState.Maximized;
return true;
default:
Console.Out.WriteLine((int)m.WParam);
return false; // this means that we want the DefProc to
//}
}
}
Regards,
Olo.
I added Prefilter function to main form, becouse I have to catch key event
globaly. Everything is ok except maximize command. When I press MaximizeBox
it doesn't work.
Bellow you find me PreFilerMessage :
public bool PreFilterMessage(ref Message m)
{
const int SC_MINIMIZE = 0xF020;
const int SC_MAXIMIZE = 0xF030;
const int WM_MDIMAXIMIZE = 0x0225;
if(!m_designer.IsPropertyGridFocus)
{
switch ((int)m.WParam)
{
case 9: // tab
return true;
case 37: // left
m_designer.KeyLeftCmd();
return true;
case 38: // up
m_designer.KeyUpCmd();
return true;
case 39: // right
m_designer.KeyRightCmd();
return true;
case 40: // down
m_designer.KeyDownCmd();
return true; // this means that we handled the code
case SC_MAXIMIZE: //maximize
this.WindowState = FormWindowState.Maximized;
return true;
default:
Console.Out.WriteLine((int)m.WParam);
return false; // this means that we want the DefProc to
//}
}
}
Regards,
Olo.