Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6592837
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T17:36:23+00:00 2026-05-25T17:36:23+00:00

When using the windows SDK to compile a program writen in C++, if I

  • 0

When using the windows SDK to compile a program writen in C++, if I specify -subsystem:windows,6.1,
the width of the window is smaller. If I don’t, or do -subsystem:windows without the 6.1, the width is normal.

I’m curious why this does this, and if there’s a way to make it stay the same width regardless of what command line I pass to link.

EDIT: So it’s also height, height and width are both different. And if i look at it with Inspect.exe, it says the size is the same each time.

EDIT2: Also it’s a window application created with CreateWindow, not a console.

EDIT3: Here’s the full code that initializes my window:

wcex.cbSize         = sizeof(WNDCLASSEX);
wcex.style          = CS_HREDRAW | CS_VREDRAW;
wcex.lpfnWndProc    = WndProc;
wcex.cbClsExtra     = 0;
wcex.cbWndExtra     = 0;
wcex.hInstance      = hInstance;
wcex.hIcon          = LoadIcon(wcex.hInstance, MAKEINTRESOURCE(SMALL_ICON));
wcex.hCursor        = LoadCursor(NULL, IDC_ARROW);
wcex.hbrBackground  = (HBRUSH)GetStockObject(BLACK_BRUSH);
wcex.lpszMenuName   = NULL;
wcex.lpszClassName  = g_szWindowClass;
wcex.hIconSm        = LoadIcon(wcex.hInstance, MAKEINTRESOURCE(SMALL_ICON));

g_hMainWnd = CreateWindow(
    g_szWindowClass,
    t_szWindowTitle,
    WS_OVERLAPPED | WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX,
    CW_USEDEFAULT, CW_USEDEFAULT,
    392, 250,
    NULL,
    NULL,
    hInstance,
    NULL
);

And I resize the window with this:

SetWindowPos(hWnd, NULL,
    (GetSystemMetrics(SM_CXFULLSCREEN)/2)- (392/2),
    (GetSystemMetrics(SM_CYFULLSCREEN)/2) - (250/2),
    392, 120, SWP_NOZORDER);
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T17:36:24+00:00Added an answer on May 25, 2026 at 5:36 pm

    I’m suspecting you are specifying some windows styles that are only supported in Windows7 (Win7 = 6.1). Post the full CreateWindow call with arguments and also try turning off Aero. The window border may be included in the width/height for example in one scenario.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to compile someone elses C++ program using VS2005 on Windows 2003 (SP2).
How do I create a self-signed certificate for code signing using the Windows SDK?
Am using windows xp sp3 on netbook and i need to compile c# programs
To create a .exe in Linux using Qt SDK, should I cross compile my
I am trying to compile media player sample application in qt 4.5 sdk using
I've been using Inspect.exe from the Windows SDK to examine the properties of a
Using Windows Server 2003 in a multi-user environment (via Remote Desktop, using it as
Using Windows 2003, I'm look for a way to create a logoff script that
Using Windows So I'm reading from a binary file a list of unsigned int
Using windows server, I have a path to a file that, when you click

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.