DragDrop 事件不响应的问题

在WIn7下DragDrop事件为响应解决方案如下:
 #region  Windows user32
 [DllImport("user32.dll", SetLastError = true)]
static extern IntPtr ChangeWindowMessageFilter(uint message, uint dwFlag);
#endregion
Load事件中加上:
uint WM_DROPFILES = 0x0233;
uint WM_COPYDATA = 0x4A;
uint MSGFLT_ADD = 1;
ChangeWindowMessageFilter(WM_DROPFILES, MSGFLT_ADD);
ChangeWindowMessageFilter(WM_COPYDATA, MSGFLT_ADD);
ChangeWindowMessageFilter(0x0049, MSGFLT_ADD);

这样 WNI7下事件便会有响应啦

你可能感兴趣的:(Winfrom)