C# WM_NCMOUSELEAVE 消息触发

 

public static extern bool TrackMouseEvent([In, Out] TRACKMOUSEEVENT lpEventTrack);
        [DllImport("User32.dll", CharSet = CharSet.Auto)]

 [StructLayout(LayoutKind.Sequential)]
    public class TRACKMOUSEEVENT
    {
        public uint cbSize;
        public uint dwFlags;
        public IntPtr hwndTrack;
        public uint dwHoverTime;
    }

以上是用到的API和结构体

 

1、写一个方法用来处理TrackMouseEvent

2、 WndProc 处理消息 WM_NCMOUSEMOVE

3、处理WM_NCMOUSELEAVE

完成,这个消息就可以获取到啦!

WM_MOUSELEAVE 类似

 

posted @ 2016-09-19 14:33  _Cheer  阅读(997)  评论(0编辑  收藏  举报