OpenWindow

Just starting out? Need help? Post your questions and find answers here.
RASHAD
PureBasic Expert
PureBasic Expert
Posts: 4636
Joined: Sun Apr 12, 2009 6:27 am

Re: OpenWindow

Post by RASHAD »

I just noticed that everyone said Never 10 he did not try it at all
He is just another follower to some one we do not know his purpose
Finally everyone is free to do what he wants(Go back to XP it is safe :mrgreen: )
Egypt my love
User avatar
heartbone
Addict
Addict
Posts: 1058
Joined: Fri Apr 12, 2013 1:55 pm
Location: just outside of Ferguson

Re: OpenWindow

Post by heartbone »

RASHAD wrote:I just noticed that everyone said Never 10 he did not try it at all
He is just another follower to some one we do not know his purpose
To clarify your (personal assessment?) post RASHAD, I am a follower of the most high.
And I don't support Satan or his operating systems.
Finally everyone is free to do what he wants(Go back to XP it is safe :mrgreen: )
That may or may not be true about XP's safety,
but we both KNOW that Windows®7 is so much better and safe,
so although you are free to do so, why give out that ridiculous advice?.
Perhaps in the future you might stick to the intricate Windows® programming that you are so good at
and avoid antagonistic personal assessments?

https://www.reddit.com/r/Windows10/comm ... indows_10/

For too many valid reasons to list, never 10 on my computers.
Keep it BASIC.
RASHAD
PureBasic Expert
PureBasic Expert
Posts: 4636
Joined: Sun Apr 12, 2009 6:27 am

Re: OpenWindow

Post by RASHAD »

Hi heartbone
Take it easy man
I am not defending Windows 10 but defending the development
Each windows ver. has it's drawbacks but we can not stick with one forever
Sorry mate
Egypt my love
User avatar
heartbone
Addict
Addict
Posts: 1058
Joined: Fri Apr 12, 2013 1:55 pm
Location: just outside of Ferguson

Re: OpenWindow

Post by heartbone »

Hopefully we each will choose the best path for progress.
For me it's Linux, and I remain disappointed that so few have decided to take that path with serious dedication.
I'm not a Linux expert by any means, but I am comfortable enough using it, and I have booted into it every day for several years,
and has been my 98% go to OS.
I only occasionally boot into Windows® to do things like make an Amazon.com order,
my being paranoid about that UBUNTU Amazon integration (I run 16.04 LTS).

In the Microsoft Windows realm, it is true that one can never stick with one version forever.
I've been a 95 OSR2, 98 SE, XP Pro, Vista Ultimate, and 7 Professional user.
Although I haven't fired up my trusty Atari 800 in over a decade, I still occasionally boot real Amigas for fun.
So I believe that I'll likely be using Win 7 for a very long time, almost forever in computer life terms,
mainly for PureBasic code development.

RASHAD, I remain severely impressed with your computer expertise, and I sincerely hope that you'll convert to the Linux side.
Peace.
Keep it BASIC.
User avatar
skywalk
Addict
Addict
Posts: 3972
Joined: Wed Dec 23, 2009 10:14 pm
Location: Boston, MA

Re: OpenWindow

Post by skywalk »

I read somewhere that Windows 10 is the last traditional release.
It will be forever patched/improved/regressed/repeat.
Waiting for Windows 11 or Windows 7 security support will be a long one. :wink:
The nice thing about standards is there are so many to choose from. ~ Andrew Tanenbaum
RASHAD
PureBasic Expert
PureBasic Expert
Posts: 4636
Joined: Sun Apr 12, 2009 6:27 am

Re: OpenWindow

Post by RASHAD »

Whatever
I will be with the progress as long as I am still alive
Egypt my love
GenRabbit
Enthusiast
Enthusiast
Posts: 118
Joined: Wed Dec 31, 2014 5:41 pm

Re: OpenWindow

Post by GenRabbit »

After being away for some time I tried again, to have a shoot at this and came up with this code. Objective was to find all the border thickness etc and correct the height and width with the values Windows provide. The code turned out as such;

Code: Select all

 
 EnableExplicit
Global.w BorderThickNessX, BorderThickNessY, FrameThicknessX, FrameThicknessY, FrameCaptionY

BorderThickNessX = GetSystemMetrics_(#SM_CXBORDER) * 2
BorderThickNessY = GetSystemMetrics_(#SM_CYBORDER) * 2
FrameThicknessX  = GetSystemMetrics_(#SM_CXFRAME) / 2
FrameThicknessY  = GetSystemMetrics_(#SM_CYFRAME) / 2
FrameCaptionY    = GetSystemMetrics_(#SM_CYCAPTION)

Debug "BorderThickNessX->" + Str(BorderThickNessX)
Debug "FrameThicknessX ->" + Str(FrameThicknessX)
Debug "BorderThickNessY->" + Str(BorderThickNessY)
Debug "FrameThicknessY ->" + Str(FrameThicknessY)
Debug "FrameCaptionY   ->" + Str(FrameCaptionY)

Global.l ResX, ResY
Global.i PrimaryWindowHandler, PrimaryWindowEvent
PrimaryWindowHandler = OpenWindow(#PB_Any, 20,20,1024 - BorderThickNessX - FrameThicknessX ,720 - BorderThickNessY - FrameThicknessY - FrameCaptionY,"Test", #PB_Window_SystemMenu)
ResX = WindowWidth(PrimaryWindowHandler, #PB_Window_FrameCoordinate)
ResY = WindowHeight(PrimaryWindowHandler, #PB_Window_FrameCoordinate)
SetWindowTitle(PrimaryWindowHandler, Str(ResX) + "/" + Str(resy))
Repeat
    PrimaryWindowEvent = WindowEvent()
    Select PrimaryWindowEvent
        Case #PB_Event_CloseWindow
            Break
    EndSelect
    Delay(1)
ForEver
CloseWindow(PrimaryWindowHandler)
The window is to be 1024x720 and checking with WindowWidth and WindowHeight it is so. But if I make a Window Snapshot of it and put it into Either MSPaint or Paint.net, they say it is 1024x718. What Am I doing wrong?
Post Reply