winapi - using hook on OPENFILEW dialog disables resize control -
using code resulting dialog box drawn without ability able resized mouse:
#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; }
removing ofn_enablehook
shows correct dialog window resize indicator @ bottom right corner. how make dialog user-resizeable , hook procedure ?
(of course hook mock here, illustrate error, no matter put inside, of course if correct on other matters, result same)
you need include ofn_enablesizing
flag when using ofn_enablehook
. documented behavior:
ofn_enablesizing
0x00800000
enables explorer-style dialog box resized using either mouse or keyboard. default, explorer-style open , save dialog boxes allow dialog box resized regardless of whether flag set. this flag necessary if provide hook procedure or custom template. old-style dialog box not permit resizing.
Comments
Post a Comment