感谢您的回复,我查看了 SendMessage 但有点卡住了,我现在正在使用以下代码:
HWND hwnd = GetForegroundWindow();
MINMAXINFO info;
POINT minSize = {500, 500}, maxSize = {600, 600};
SendMessage(hwnd, WM_GETMINMAXINFO, NULL, &info); //WM_GETMINMAXINFO(NULL, &info);
info.ptMinTrackSize = minSize;
info.ptMaxTrackSize = maxSize;
现在我有这些警告:
init.c:49:3: warning: passing argument 3 of 'SendMessageA' makes integer from po
inter without a cast [enabled by default]
c:\mingw\bin\../lib/gcc/mingw32/4.6.2/../../../../include/winuser.h:4001:27: not
e: expected 'WPARAM' but argument is of type 'void *'
init.c:49:3: warning: passing argument 4 of 'SendMessageA' makes integer from po
inter without a cast [enabled by default]
c:\mingw\bin\../lib/gcc/mingw32/4.6.2/../../../../include/winuser.h:4001:27: not
e: expected 'LPARAM' but argument is of type 'struct MINMAXINFO *'
并且窗口仍然可以自由调整大小。