可以将窗口的大小调整到超过屏幕大小/屏幕外的大小吗? [英] Can a window be resized past the screen size/offscreen?

查看:535
本文介绍了可以将窗口的大小调整到超过屏幕大小/屏幕外的大小吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的目的是在Win32下以编程方式将窗口的宽度/高度设置为大于物理屏幕的大小.我该怎么办?

My purpose is to size a window to a width/height greater than the size of my physical screen programmatically under Win32. How can I do this?

在我的系统上,给定窗口的最大大小似乎受屏幕大小的限制,无论是通过编程方式还是通过拖动大小光标来手动进行大小调整.

On my systems it seems the maximum size of a given window is bound by the size of my screen whether programmatically or whether sizing manually by dragging the sizing cursor.

我已经用SetWindowPos()和MoveWindow()进行了编程尝试,并且都限制了目标窗口的大小.奇怪的是,我知道有些人没有这个上限",所以我想知道这是否是由于某些操作系统设置(注册表)引起的.有人知道吗?还是一些解决方法?

I have tried programmatically with SetWindowPos() and MoveWindow() and both cap the size of the target window. Oddly I know some people do not have this 'cap' so I wonder whether this is perhaps due to some OS setting (registry). Does anyone know something about this? Or perhaps some way to workaround it?

//新进展

我正在Windows XP和Windows 7上进行测试.我使用的图形卡是NVIDIA Quadro NVS 290(256MB)和Geforce 9800GT(1GB).经过进一步调查,看来Windows正在拦截该消息并摆弄参数.例如,如果您调用SetWindowPos来将目标设置为2000x2000,则只会收到上限为x/y的WM_SIZE.

I am testing on Windows XP and Windows 7. The graphics cards I'm using are a NVIDIA Quadro NVS 290 (256MB) and a Geforce 9800GT (1GB). After further investigation it looks like Windows is intercepting the message and fiddling with the parameters. For example, if you call SetWindowPos to make a target 2000x2000 it will only receive a WM_SIZE for the capped x/y.

推荐答案

为WM_GETMINMAXINFO实施消息处理程序以阻止Windows应用理智的默认行为:

Implement a message handler for WM_GETMINMAXINFO to stop Windows from applying the sane default behavior:

case WM_GETMINMAXINFO: {
    DefWindowProc(hWnd, message, wParam, lParam);
    MINMAXINFO* pmmi = (MINMAXINFO*)lParam;
    pmmi->ptMaxTrackSize.x = 2000;
    pmmi->ptMaxTrackSize.y = 2000;
    return 0;
}

这篇关于可以将窗口的大小调整到超过屏幕大小/屏幕外的大小吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆