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 3485984
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T10:58:24+00:00 2026-05-18T10:58:24+00:00

I have an application in Visual c++ (Win32 API). In my application the main

  • 0

I have an application in Visual c++ (Win32 API). In my application the main window boarder is displayed in old windows styled. I have tried changing the wndWc.style values to WS_OVERLAPPED,WS_POPUP and other which are given in WinUser.h but there is no change in the appearance of the main window were as all my pop-up window are displayed in windows 7 style how this can be rectified. Any help in this regards will be highly appreciated. I have attached both the images the main window and the pop up window.
alt text

alt text

Code :

// our window class
  WNDCLASS wndWc;
  // ---------------------------------------------------------
  // fill window class members
  // ---------------------------------------------------------
  wndWc.style = CS_GLOBALCLASS;
  wndWc.lpfnWndProc = (WNDPROC) WndProc;
  wndWc.cbClsExtra = 0;
  wndWc.cbWndExtra = 0;
  wndWc.hInstance = GetModuleHandle(NULL);
  wndWc.hIcon = NULL;
  wndWc.hCursor = LoadCursor(0, IDC_ARROW);
  wndWc.hbrBackground = (HBRUSH)GetStockObject(0);
  wndWc.lpszMenuName = NULL;
  wndWc.lpszClassName = "XYZ";


  // register class
  if (!RegisterClass(&wndWc)) return false;
  // ---------------------------------------------------------

  // get actual screen resolution
  int iSw = (WORD)GetSystemMetrics(SM_CXSCREEN);       // height
  int iSh = (WORD)GetSystemMetrics(SM_CYSCREEN);       // height

  // make a rectangle on the center of the screen
  RECT rc = {(iSw - iWidth)/2, (iSh - iHeight)/2, width, height};

  // create the window. the spaces on the window title
  // are just to make sure this will be visible when the region
  // is active. just run the app and you'll understand. =)
  hWnd = CreateWindow("XYZ", "XYZ",
                      WS_OVERLAPPEDWINDOW,
                      CW_USEDEFAULT,CW_USEDEFAULT, width,height,
                      NULL, NULL, GetModuleHandle(NULL), NULL);
  • 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-18T10:58:25+00:00Added an answer on May 18, 2026 at 10:58 am

    It could be that your EXE has been flagged to run in compatibility mode for a previous OS version. Right-click the EXE, choose Properties, then ensure everything is switched off on the Compatibility tab. (Especially “Disable visual themes” and “run this program in compatibility mode for…”)

    Failing that…

    It’s unusual to need to do anything at all, but try this at the start of the app:

    SetThemeAppProperties(STAP_ALLOW_NONCLIENT|STAP_ALLOW_CONTROLS)

    If that doesn’t work, try explicitly setting the theme for your window:

    SetWindowTheme(hWnd, “WINDOW”, NULL);

    FWIW, I pasted your code in to a new Visual Studio 2008 project created using the “Win32 project” wizard, and it came out with a Windows 7 border. You usually have to go out of your way not to get the border, in fact.

    There could be something unusual about the EXE you are building, like a flag in the EXE’s header being set incorrectly. e.g. If it isn’t specifying that it is a Windows GUI app, or maybe there are some version fields…

    The EXE’s manifest may also play a part, but I just tried deleting the manifest completely and my program still got a themed window, so it’s probably not that.

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

Sidebar

Related Questions

I have developend a window application(Win32 API) in visual C++. I have to add
I have a Window (win32 API) Application in visual c++. I am not using
I have a Window (win32 API) Application in visual c++. I am not using
I have win32 API application in visual c++. I want to create a directory
I have created a small WIN32 Console Application in Visual C++ in Windows 7.
I have a Qt application in Visual Studio 2005 which is linked using \subsystem:windows such that
I have an application developed in C++ in Visual Studio 2003 (Windows Forms application).
I have created a windows mobile application in Visual Studio. I want to templatize
I have a Visual Studio 2008 Windows Mobile 6 C++ application that is using
I have a C++ Win32 application that was written as a Windows GUI project,

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.