In newer Windows, window is tiny with no borders - windows

I've been working on updating an old (Windows 95-era C API) application. While it works fine on Windows XP, on Vista and newer it always displays in a tiny 240x160 window with no menus or borders. What are the differences between Vista and XP that could cause this behavior?
On Windows 7, it looks like this (actual size):
This is what it should look like, and what it does look like in Windows XP:

Related

QT application style does not change between the different windows themes

Via qApp->setStyle you can change the style of your application. What I found is when I run on Windows 7 with windows 7 theme I can switch between:
qApp->setStyle(QStyleFactory::create("Windows"));
qApp->setStyle(QStyleFactory::create("WindowsVista"));
qApp->setStyle(QStyleFactory::create("WindowsXP));
But if I have my windows 7 setup with windows classic theme, I cannot switch between those 3. They all look the same.
How can I force my application to look like Windows Vista on Windows Classic theme PC?
Note: my system returns for QStyleFacory::keys():
Windows
WindowsXP
WindowsVista
Fusion
That's correct. On Windows, the "Vista" and "XP" themes are only active if you're using the same or higher theme on the user account. That's not due to Qt, but due to the behavior of the theming APIs on Windows.

GetRandomRgn() Api does not work as expected in Windows 8

I am using GetRandomRgn() API to get the visible region of the window.
This API works fine in Windows Xp and Windows 7 but same API is not giving the same
result in Windows 8.
Is there is any other function available in windows 8 to give me the same result?
Please do reply.
Best Regards,
Sharad
Enable Desktop Composition on Windows 7 and you'll see that Windows 7 and Windows 8 behave the same. The behavior of GetRandomRgn is affected by desktop composition. When composition is enabled, all windows are logically treated as fully visible (since they render to an offscreen buffer). The available of features like Flip3D shows that the logically visible portion of a region is not the same as its physically visible region.

Windows Forms color variation between Windows 7 and XP

I have a vb.net Windows Forms app using the 4.0 framework. When I run the application on an XP machine, the color of my controls all match what the are set to in my IDE, which is also an XP machine.
When I run this application on a Windows 7 machine, the colors are all changed.
Any ideas why this is and how I can make Windows 7 match my Development machine?
David
Windows forms are going to take on whatever "theme" the machine they are running on has enabled - which is by design. Honestly, it wouldn't make sense for a windows form running on Windows 7 to look like an XP windows form. Could you give some sort of context for why you want your windows form to look like it's always running on XP?
You can use the BackColor property of the button to change the background color. The ForeColor property will change the text color.
Edit: added the below after playing around some.
Try ensuring the "UseVisualStyleBackColor" property on your button is set to False. Playing around I noticed that when this is true, the system ignores my background color selection and uses the machine default. When False, my background color was used.
I found this too. My VB6 project was fine in Windows XP.
I just moved to Windows 7 and copied the project folder to this machine.
My splashscreen backcolour was supposed to be white but it was black now.
The backcolour had been set to &H80000009& which was white in winXP but in Windows 7 it gives black.
So I changed backcolour to &H80000005& and it is now white again.

SWT setForeground in Windows 7 vs. Windows XP

We have SWT apps which use the setForeground method on windows XP, and they work fine. However, running the most recent stable SWT jars and dlls on Win7 seems to show the setForeground method being ignored. I know that the javadoc says it's a hint, but I wanted to know if this is because something changed between XP and 7, or if it's possible it's a system setting on my new Win7 install.
I had found this post: How to set SWT button foreground color?, but the main answer definitively says that setForeground is ignored on Windows, which isn't true in XP. Also, our problem doesn't seem to be limited to Buttons. Same issues happen with Groups as well.
Apparently, a hacky work-around exists by adding a paint listener that manipulates the GC directly to redraw the text with the appropriate color, besides being hacky, this is not practical, because it would mean we had to add this listener to the thousands places where we use Buttons.
Thanks for any help.
This doesn't have anything to do with your system settings. It's just that, as you have guessed, something has changed between XP and 7. Actually, it changed between XP and Vista. Unfortunately there is not much you can do about this, except for the hack that you have mentioned.
For more information, see this bug report.
Further investigation reveals that this is not a difference between XP and Windows 7, but rather the Classic theme vs the Aero or XP theme. If we use the XP theme in XP, Button foreground also cannot be set.

Why does OpenThemeData(pParent, L"TEXTSTYLE") fail on XP?

I'm using the theme library to draw some text which works absolutely fine on Windows Vista - however, on Windows XP the returned HTHEME is NULL. This is the code I'm using:
HTHEME hTheme = ::OpenThemeData(pParent, L"TEXTSTYLE");
hTheme is valid on Vista, but NULL on Windows XP.
I've read the documentation for OpenThemeData and Parts and States on MSDN, but nothing mentions that TEXTSTYLE isn't supported on XP (even Google doesn't throw up any good suggestions).
The theme Luna (i.e. the Microsoft-made theme distributed with XP) defines only subset of classes and parts of Aero (Windows Vista and 7).
If you have access to machines with Windows XP and Vista (or 7) you may preview what's defined by Theme Explorer utility:
http://sourceforge.net/projects/mctrl/files/theme-explorer/
I presume that on XP you still have theming turned on? If you have turned off "bubblegum" mode - i.e. reverted to the classic look, then the Theming APIs all fail and youre expected to use the legacy APIs to draw the frame elements. DrawFrameControl etc.

Resources