Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Windows 10 and VFP EXE

Status
Not open for further replies.

memarques

IS-IT--Management
Aug 28, 2000
22
BR
Hi there.

When I run a VFP program in Windows 10 it shows a “white” line in top of the application´s window. I think this is ugly. This, of course, is not a problem at all.

But, is there a way to strip this? (Thought windows 10 configuration or in VFP?).
30-03-2016_10-51-40_bf9s73.png

Thanks, regards
Mauro
 
Without any intervention VFP EXEs/Windows forms rather look like the normal other window you show there, the notepad.
Your sample window looks quite customized and skinned anyway, so I can only assume it uses GDI to draw this white line.

Without hands on any code it's quite impossible to tell what to do, but I don't assume this is just done with a certain Windows setting.

Bye, Olaf.
 
Hi Olaf

Thanks for your replay.

This is a normal VFP application that in config.fpw there is a line like:

screen=off

in the main program I execute a form with

ShowWindow = 2 (as to-level Form), TITLEBAR = 0, BorderStyle = 3 - Sizable

Then I have a class with my “special TitleBar” that is a container with Label, Buttons, etc that is show in top of the form.

Any ideas?
Regards
Mauro
 
>TITLEBAR = 0

That alone shows you don't have a standard Winforms titlebar anymore. You draw your form fully on your own, so you are responsible for the whole look of it.
This has nothing to do with Windows or VFP Form properties anymore.

You most likely did this according to and used other graphics for the title bar and borders. Most probably they have that white line inside. Or you misplace them on a form with white background, so that shows through. Whatever, you don't have a form with a Windows drawn titlebar, so Windows itself isn't responsible and configurable for this white line.

Bye, Olaf.
 
Olaf

Yes, because I don’t use the “normal Title Bar” (TitleBar=0) Windows 10 put that “Line” in top of the application's windows (for some "control"). This not happens when I run the same in Windows 7. I only just would like that line off. :)

Thanks again, bye

Regards
Mauro
 
Then I have a class with my “special TitleBar” that is a container with Label, Buttons, etc that is show in top of the form.

Then it is the "special TitleBar" that has the white line. Assuming the title bar is made up of normal VFP controls, there must be something in those controls' properties that is causing it. For example, if you have a Shape control, it could be something to do with its SpecialEffect or BorderWidth properties. But without actually seeing the controls in question, it's impossible to know.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
There is no switch. You have to look into the details of your special titlebar container, its positioning etc.
It's believable you don't have this line under other Windows versions, but it's not Windows 10 drawing a line at every container top two pixels or any such thing.
Is there just a bunch of controls and images used in this container, or also some code adjusting the size and position? Is there any use of the SYSMETRIC() function? That might have some new and wrong values on Windows 10.

As long, as you don't share this container class, there is nothing to look at, to judge, to test, to fix.

Bye, Olaf.
 
I don’t think this is “something” with the controls that I used. I prepared 2 samples with “very plain vanilla” forms, without any special TitleBar just for show this. I had build 2 exes. 1 has titlebar off, and nothing else and when we run this in windows 10 it shows a white line, the other, with “normal” TitleBar. You can download a ZIP file with the project and exes from here:


Sorry to stretch this topic "not important at all" discussion. I just don’t like that white line.

Regads
Mauro
 
If this happens with a plain vanilla form with Titlebar=0 and nothing on it, then why don't you say that initially?

Bye, Olaf.
 
Olaf, sorry if I didn’t make myself clear about this. But my question was if “there is a way to remove the white line in windows10”, after that I explained that I used a special TitleBar with TitleBar=0.

Regards
Mauro
 
Well, but saying so, the assumption this line comes from your special titlebar class is very obvious.

If you just had said any form without titlebar (Titlebar=0) has a white line at its top on Window 10, I know at least 2 here, who could have started testing this.
You yourself were assuming this is happening...
Mauro said:
for some "control"

You already know better (at least now). But you sidetracked all of us. It has nothing to do at all with your skinning. Thatinfo alone makes it much easier for us to know we can reproduce and try to fix this.

Bye, Olaf.

 
Finally at home with Windows 10 at hand, I can reproduce the problem but don't find a solution, sorry.

There are several registry keys for colors, but I don't find a key for this title bar residual white line.
One of the possible solutions I had in mind, drawing on the Windows Title Bar, doesn't work. Look at the Solutions Sample "Binding to Windows Message events"
The combobox contains a choice of several event types and one of them is "GDI+ Titlebar".
On Windows 7 this still works and when you Enable Events and check "Display titlebar gradient" the _screen titlebar becomes, Well, colorful.

In Windows 10 the _Screen titlebar stays white.

You'll find some tips on C:\Windows\Resources\Themes, to copy aero.themes and the aero folder, rename a few files and make some changes. I'm not eager to do all this, but in the end this promises you can change the titlebar color and that may help you to get this white line black.

Bye, Olaf.
 
Olaf
I do appreciate your effort. (Excuse my English).
Thanks very much.
Regards
Mauro
 
The residual white line, even if you turn off all the chrome, is a feature of Windows 10 windows. We've investigated in other forums here on tek-tips, and not come up with a simple solution as yet for langauages thata re not using .NET (with .Net we can use XAML or the WindowChrome class to tweak the Window appearance further)
 
I have also done WPF forms with no titlebar at all and a round appearance. All that is no problem in .NET, indeed. But Winforms isn't XAML/WPF. That's the main point.
Could a dot net assembly knowing the VFP Window HWND act on this residual line, perhaps? Then we could use that via west wind .NET bridge, if not directly.

Bye, Olaf.
 
The white stripe comes from the border. If you set .BorderStyle != 3, the white stripe goes away.
 
That's true, but then you have to do the feature of form resizing on your own.

Not that this is impossible, if you program something on the mousedown and mousemove events of a small resize symbol pic you put as image control in the bottom right corner of your form.

Bye, Olaf.
 
>If you set .BorderStyle != 3

Oh, it all works fine if you don't want the window to be resizeable.
 
Yes, if we set BorderStyle != 3 the White line is not show, but I want to use the "vanila" sizable form. I know that we can manage to size "no-sizable" form. In the above image (1st post) of my application I use this with the "sub-forms" (In Top-Level Form).

I think that in W10, because the border of sizeable form is diferente, in applications where there is no "default" TitleBar ".and." sizeable, W10 puts a line to allow the control of window. The question is how to hide that line.

Regards
Mauro
 
There is nothing vanilla about your form. You already decided to depart from the standard title bar, and to handle by yourself how to minimize, maximize and close the window. I can't see a logical reason for you to not take charge of the window resizing, too, but I'll be willing to hear about one.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top