protected override void WndProc(ref Message m)
{
//Check if the received message is WM_SHOWME
if (m.Msg == NativeMethods.WM_SHOWME)
{
//Set frmMain of the first instance to TopMost
if (WindowState == FormWindowState.Minimized)
{
WindowState = FormWindowState.Normal;
}
// get our current "TopMost" value (ours will always be false though)
bool top = TopMost;
// make our form jump to the top of everything
TopMost = true;
// set it back to whatever it was
TopMost = top;
}
//This message is sent when the form is dragged to a different monitor i.e. when
//the bigger part of its are is on the new monitor.
else if (m.Msg == Theme.DPIScaling.WM_DPICHANGED)
{
LocalSetting.OldDPI = LocalSetting.CurrentDPI;
LocalSetting.CurrentDPI = Theme.DPIScaling.LOWORD((int)m.WParam);
if (LocalSetting.OldDPI != LocalSetting.CurrentDPI)
{
Theme.DPIScaling.HandleDpiChanged(LocalSetting.OldDPI, LocalSetting.CurrentDPI, this);
toolMain.Height = 33;
}
}
base.WndProc(ref m);
}