今天突然发现,在Win7用管理员身份运行,拖拽文件到窗体上,既然不响应消息,
而用普通方式运行,一切正常,不知道是什么原因。
代码如下:
void CPeInfoDlg::OnDropFiles(HDROP hDropInfo)
{
// TODO: Add your message handler code here and/or call default
UINT count;
char filePath[200];
count = DragQueryFile(hDropInfo, 0xFFFFFFFF, NULL, 0);
if(count)
{
for(UINT i=0; i<count; i++)
{
int pathLen = DragQueryFile(hDropInfo, i, filePath, sizeof(filePath));
m_strFilePath = filePath;
}
}
DragFinish(hDropInfo);
UpdateData(FALSE);
CDialog::OnDropFiles(hDropInfo);
}