mirror of
https://mirror.ghproxy.com/https://github.com/dexyfex/CodeWalker
synced 2026-05-15 01:04:49 +08:00
R26_dev8 - First public commit
This commit is contained in:
@@ -0,0 +1,49 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace CodeWalker.WinForms
|
||||
{
|
||||
public partial class MenuStripFix : MenuStrip
|
||||
{
|
||||
public MenuStripFix()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
protected override void OnPaint(PaintEventArgs pe)
|
||||
{
|
||||
base.OnPaint(pe);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
const uint WM_LBUTTONDOWN = 0x201;
|
||||
const uint WM_LBUTTONUP = 0x202;
|
||||
|
||||
static private bool down = false;
|
||||
|
||||
protected override void WndProc(ref Message m)
|
||||
{
|
||||
//fix to properly handle the mouse down event when the form isn't currently focused...
|
||||
if (m.Msg == WM_LBUTTONUP && !down)
|
||||
{
|
||||
m.Msg = (int)WM_LBUTTONDOWN;
|
||||
base.WndProc(ref m);
|
||||
m.Msg = (int)WM_LBUTTONUP;
|
||||
}
|
||||
|
||||
if (m.Msg == WM_LBUTTONDOWN) down = true;
|
||||
if (m.Msg == WM_LBUTTONUP) down = false;
|
||||
|
||||
base.WndProc(ref m);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user