使用此代码生成的对话框无法通过鼠标调整大小:
#include <windows.h>
static UINT_PTR CALLBACK OFNHookProc (HWND hdlg, UINT uiMsg, WPARAM wParam, LPARAM lParam) {
return 0;
}
int main() {
OPENFILENAMEW ofn;
ZeroMemory(&ofn, sizeof(ofn));
ofn.lStructSize = sizeof(OPENFILENAMEW);
ofn.nMaxFile = MAX_PATH;
ofn.Flags = OFN_EXPLORER | OFN_FILEMUSTEXIST | OFN_ENABLEHOOK;
ofn.lpfnHook = OFNHookProc;
GetOpenFileNameW(&ofn);
return 0;
}
删除OFN_ENABLEHOOK
会在右下角显示正确的对话框窗口,其中包含调整大小指示符。如何使用钩子程序制作用户可调整大小的对话框?
(当然钩子在这里是模拟的,只是为了说明错误,无论我把它放在里面,当然如果在其他事情上是正确的,结果是一样的)