Create Window larger than desktop (display resolut

2020-03-15 05:23发布

I need to resize a window larger than screen resolution or size of desktop, programmatically & preferably also manually.

Since MS-Windows XP/Vista disallows a window size larger than screen, does anybody have any ideas to work around this limitation?

I trying to make pan effect on a laptop to give me more space to work. An older laptop with a smaller LCD size did have such a feature.

See this: http://www.experts-exchange.com/OS/Microsoft_Operating_Systems/Windows/98/Q_21832063.html

9条回答
神经病院院长
2楼-- · 2020-03-15 06:04

This code in C# does what you ask. The window is way wider than the desktop.

 protected override void WndProc(ref Message m) {
        if (m.ToString().Contains("GETMINMAXINFO")) {
            //Hent data
            MINMAXINFO obj = (MINMAXINFO)Marshal.PtrToStructure(m.LParam, typeof(MINMAXINFO));
            //Endre
            if (obj.ptMaxSize.X > 0) {
                obj.ptMaxSize.X = 60000;
                obj.ptMaxSize.Y = 60000;
                obj.ptMaxTrackSize.X = 60000;
                obj.ptMaxTrackSize.Y = 60000;
                //Oppdater
                Marshal.StructureToPtr(obj, m.LParam, true);
            }
        }
        if (m.ToString().Contains("WINDOWPOSCHANGING")) {
            //Hent data
            WINDOWPOS obj = (WINDOWPOS)Marshal.PtrToStructure(m.LParam, typeof(WINDOWPOS));
            //Endre
            if (obj.cx > 0) {
                obj.cx = 8000;
                //Oppdater
                Marshal.StructureToPtr(obj, m.LParam, true);
            }
        }
        //Debug.WriteLine(m.ToString());
        base.WndProc(ref m);
    }











    [StructLayout(LayoutKind.Sequential)]
    internal struct WINDOWPOS {
        internal IntPtr hwnd;
        internal IntPtr hWndInsertAfter;
        internal int x;
        internal int y;
        internal int cx;
        internal int cy;
        internal uint flags;
    }

    [StructLayout(LayoutKind.Sequential)]
    internal struct MINMAXINFO {
        internal POINT ptReserverd;
        internal POINT ptMaxSize;
        internal POINT ptMaxPosition;
        internal POINT ptMinTrackSize;
        internal POINT ptMaxTrackSize;
    }
    [StructLayout(LayoutKind.Sequential)]
    internal struct POINT {
        internal int X;
        internal int Y;
    }
查看更多
萌系小妹纸
3楼-- · 2020-03-15 06:04

You can do something like the following code in your WinProc();

case WM_GETMINMAXINFO:
    {
        LPMINMAXINFO lpmmi = (LPMINMAXINFO)lParam; 
        GetWindowRect(GetDesktopWindow(), &actualDesktop);
        lpmmi->ptMaxTrackSize.x = 3000;// set the value that you really need.
        lpmmi->ptMaxTrackSize.y = 3000;// set the value that you really need.
    }
    break;

An application can use this message to override the window's default maximized size and position, or its default minimum or maximum tracking size.

查看更多
Root(大扎)
4楼-- · 2020-03-15 06:04

The window size seems to be dependent on Desktop size, not screen resolution; however the Desktop conforms to resolution. The trick might be to change the Desktop size or start from there.

A while back, a developer named Robert Bresner (his website) made a product called sDesk (downloadable from here) which expanded Windows beyond the screen resolution.

What is SDesk? SDesk is not a multi-desktop program. It is a program that creates a single, giant desktop that extends beyond the visible region of the monitor. Only a portion of the SDesk is visible at a time, as defined by the Windows desktop settings.

The original homepage of the SDesk software is archived here There's no current page on the Internet (that I could find) but this archived version is accessed through the Way Back Machine which caches a lot of the Internet.

The SDesk product is freeware. No source code was included though. You might visit his contact page (also available in the archived version) to ask if the source is available or can be acquired for your research.

查看更多
对你真心纯属浪费
5楼-- · 2020-03-15 06:06

I needed to push part of a window off the top of the screen and I was fnally able to do it using this AutoHotKey script:

SetTitleMatchMode, 2
WinTitle := "Visual Studio Code"

; --- WinMove version

; WinMove, %WinTitle%, , 0, -64, 1280, 1504

; -- DLL version

WinGet, id, , %WinTitle%
Result := DllCall("SetWindowPos", "uint", id, "uint", HWND_TOP, "Int", 0, "Int", -64, "Int", 1280, "Int", 1504, "UInt", 0x400)

(I wanted to maximize the editor area of VSCode by completely hiding the title bar and the tabs section, that are not configurable in the program itself.)

查看更多
Explosion°爆炸
6楼-- · 2020-03-15 06:11

If you have a video card with the possibility to connect more than one screen, another workaround is to setup your system as if it is using two screens next to eachother. Then you can resize your windows to the size of the two screens together.

查看更多
够拽才男人
7楼-- · 2020-03-15 06:12

For the specific case of needing a more screen-friendly view of the MSDN, or on any other site (like StackOverflow) that makes poor use of screen real estate, I would suggest applying a custom stylesheet to the page, using a tool like IE7Pro (IE), Greasemonkey (Firefox), Stylish (Fireox), or the built in stylesheet picker in Opera.

查看更多
登录 后发表回答