How do I get PM screen size?

By calling the function WinQuerySysValue() with the tags; SV_CYSCREEN and SV_CXSCREEN. One should always check screen size before creating windows in PM, and size to the right it width and height. PM does not guarantee that your window will be dimensioned right. Below is an example:

        .
        .
        .

    lHeight = WinQuerySysValue(HWND_DESKTOP,SV_CYSCREEN);
    lWidth  = WinQuerySysValue(HWND_DESKTOP,SV_CXSCREEN);

        .
        .
        .

With these values you size and position your window with WinSetWindowPos().

Credit: Andreas Almroth


[Back: Why can't I import files larger than 64KB into my MLE?]
[Next: How do I attach Instance data to window created with WinCreateStdWindow?]