[SOLVED]TextGadget showing up different location in Windows 11 than Windows 10

Just starting out? Need help? Post your questions and find answers here.
User avatar
Distorted Pixel
Enthusiast
Enthusiast
Posts: 233
Joined: Sun Aug 29, 2021 4:34 am

[SOLVED]TextGadget showing up different location in Windows 11 than Windows 10

Post by Distorted Pixel »

Hi,

I'm not sure if this is a bug or not. I have windows 10 64 bit and my daughter has windows 11 64 bit.
I have been working on a system information program and things line up on my windows 10 machine, but on her windows 11, some things are slightly off to majorly off. Can anyone help me figure this out. I believe all x coordinates are correct and the same for Operating systems and hard drive.

Update: One daughter says her windows 11 shows everything showing lined up, the other daughter's windows 11 shows some things not lined up or the right color.

Windows 10 image:

https://mega.nz/file/4sciUbAR#q7qQNWOAB ... NOCrSJgtqQ

Windows 11 image:

https://mega.nz/file/Q5ciVKZZ#1HJZfz_6w ... 4fXGfUaajU

My code:

Code: Select all

OpenWindow(0, 0, 0, 800, 600, "SysIM", #PB_Window_SystemMenu | #PB_Window_ScreenCentered | #PB_Window_MinimizeGadget |
                                       #PB_Window_MaximizeGadget)
; CreateMenu(0, WindowID(0))
; MenuTitle("Program")
; MenuItem(0, "Settings")
; MenuItem(1, "Quit")
; MenuTitle("Help")
; MenuItem(4, "Help")
; MenuItem(5, "Online Help")

; program title
LoadFont(0, "Arial", 25, #PB_Font_Bold | #PB_Font_HighQuality | #PB_Font_Underline)
TextGadget(0, 180, 30, 430, 35, "System Information", #PB_Text_Center)
SetGadgetFont(0, FontID(0))

; total memory installed
Mem.q = MemoryStatus(#PB_System_TotalPhysical)
LoadFont(0, "Arial", 13, #PB_Font_HighQuality)
TextGadget(1, 50, 100, 300, 30, "Total Memory Installed:"); + Mem + "GB")
TextGadget(2, 270, 100, 300, 30, "" + Mem + " GB")
SetGadgetFont(1, FontID(0)) : SetGadgetColor(1, #PB_Gadget_FrontColor, RGB(200, 50, 0))
SetGadgetFont(2, FontID(0)) : SetGadgetColor(2, #PB_Gadget_FrontColor, RGB(200, 50, 0))

; computer name
CompName$ = ComputerName()
TextGadget(3, 50, 130, 250, 30, "Computer Name:")
TextGadget(4, 270, 130, 250, 30, "" + CompName$)
SetGadgetFont(3, FontID(0)) : SetGadgetColor(3, #PB_Gadget_FrontColor, RGB(200, 50, 0))
SetGadgetFont(4, FontID(0)) : SetGadgetColor(4, #PB_Gadget_FrontColor, RGB(200, 50, 0))

; cpu name
CpuName$ = CPUName()
TextGadget(5, 50, 160, 100, 30, "CPU Name:")
TextGadget(6, 270, 160, 550, 30, "" + CpuName$)
SetGadgetFont(5, FontID(0)) : SetGadgetColor(5, #PB_Gadget_FrontColor, RGB(200, 50, 0))
SetGadgetFont(6, FontID(0)) : SetGadgetColor(6, #PB_Gadget_FrontColor, RGB(200, 50, 0))

; number of cpus
CpuCount = CountCPUs()
TextGadget(7, 50, 190, 450, 30, "CPU Count:")
TextGadget(8, 270, 190, 450, 30, "" + CpuCount)
SetGadgetFont(7, FontID(0)) : SetGadgetColor(7, #PB_Gadget_FrontColor, RGB(200, 50, 0))
SetGadgetFont(8, FontID(0)) : SetGadgetColor(8, #PB_Gadget_FrontColor, RGB(200, 50, 0))

; user name
UsrName$ = UserName()
TextGadget(9, 50, 220, 650, 30, "User Name:")
TextGadget(10, 270, 220, 300, 30, "" + UsrName$)
SetGadgetFont(9, FontID(0)) : SetGadgetColor(9, #PB_Gadget_FrontColor, RGB(200, 50, 0))
SetGadgetFont(10, FontID(0)) : SetGadgetColor(10, #PB_Gadget_FrontColor, RGB(200, 50, 0))

; operating system
If OSVersion() <> #PB_OS_Windows_NT3_51
  Select OSVersion()
    Case #PB_OS_Windows_95
      TextGadget(11, 50, 250, 300, 30, "Operating System:")
      TextGadget(12, 270, 250, 300, 30, "Windows 95")
      SetGadgetFont(11, FontID(0)) : SetGadgetColor(11, #PB_Gadget_FrontColor, RGB(200, 50, 0))
      SetGadgetFont(12, FontID(0)) : SetGadgetColor(12, #PB_Gadget_FrontColor, RGB(200, 50, 0))
      
    Case  #PB_OS_Windows_NT_4
      TextGadget(11, 50, 250, 300, 30, "Operating System:")
      TextGadget(12, 270, 250, 300, 30, "Windows NT 4")
      SetGadgetFont(11, FontID(0)) : SetGadgetColor(11, #PB_Gadget_FrontColor, RGB(200, 50, 0))
      SetGadgetFont(12, FontID(0)) : SetGadgetColor(12, #PB_Gadget_FrontColor, RGB(200, 50, 0))
      
    Case  #PB_OS_Windows_98
      TextGadget(11, 50, 250, 300, 30, "Operating System:")
      TextGadget(12, 270, 250, 300, 30, "Windows 98")
      SetGadgetFont(11, FontID(0)) : SetGadgetColor(11, #PB_Gadget_FrontColor, RGB(200, 50, 0))
      SetGadgetFont(12, FontID(0)) : SetGadgetColor(12, #PB_Gadget_FrontColor, RGB(200, 50, 0))
      
    Case #PB_OS_Windows_ME
      TextGadget(11, 50, 250, 300, 30, "Operating System:")
      TextGadget(12, 270, 2530, 300, 30, "Windows ME")
      SetGadgetFont(11, FontID(0)) : SetGadgetColor(11, #PB_Gadget_FrontColor, RGB(200, 50, 0))
      SetGadgetFont(12, FontID(0)) : SetGadgetColor(12, #PB_Gadget_FrontColor, RGB(200, 50, 0))
      
    Case #PB_OS_Windows_2000
      TextGadget(11, 50, 2530, 300, 30, "Operating System:")
      TextGadget(12, 270, 2530, 300, 30, "Windows 2000")
      SetGadgetFont(11, FontID(0)) : SetGadgetColor(11, #PB_Gadget_FrontColor, RGB(200, 50, 0))
      SetGadgetFont(12, FontID(0)) : SetGadgetColor(12, #PB_Gadget_FrontColor, RGB(200, 50, 0))
      
    Case #PB_OS_Windows_XP
      TextGadget(11, 50, 250, 300, 30, "Operating System:                Windows XP")
      TextGadget(12, 270, 250, 300, 30, "Windows XP")
      SetGadgetFont(11, FontID(0)) : SetGadgetColor(11, #PB_Gadget_FrontColor, RGB(200, 50, 0))
      SetGadgetFont(12, FontID(0)) : SetGadgetColor(12, #PB_Gadget_FrontColor, RGB(200, 50, 0))
      
    Case #PB_OS_Windows_Server_2003
      TextGadget(11, 50, 250, 300, 30, "Operating System:")
      TextGadget(12, 270, 250, 300, 30, "Windows Server 2003")
      SetGadgetFont(11, FontID(0)) : SetGadgetColor(11, #PB_Gadget_FrontColor, RGB(200, 50, 0))
      SetGadgetFont(12, FontID(0)) : SetGadgetColor(12, #PB_Gadget_FrontColor, RGB(200, 50, 0))
      
    Case #PB_OS_Windows_Vista
      TextGadget(11, 50, 250, 300, 30, "Operating System:")
      TextGadget(12, 270, 250, 300, 30, "Windows Vista")
      SetGadgetFont(11, FontID(0)) : SetGadgetColor(11, #PB_Gadget_FrontColor, RGB(200, 50, 0))
      SetGadgetFont(12, FontID(0)) : SetGadgetColor(12, #PB_Gadget_FrontColor, RGB(200, 50, 0))
      
    Case #PB_OS_Windows_Server_2008
      TextGadget(11, 50, 250, 300, 30, "Operating System:")
      TextGadget(12, 270, 250, 300, 30, "Windows Server 2008")
      SetGadgetFont(11, FontID(0)) : SetGadgetColor(11, #PB_Gadget_FrontColor, RGB(200, 50, 0))
      SetGadgetFont(12, FontID(0)) : SetGadgetColor(12, #PB_Gadget_FrontColor, RGB(200, 50, 0))
      
    Case #PB_OS_Windows_7
      TextGadget(11, 50, 250, 300, 30, "Operating System:")
      TextGadget(12, 270, 250, 300, 30, "Windows 7")
      SetGadgetFont(11, FontID(0)) : SetGadgetColor(11, #PB_Gadget_FrontColor, RGB(200, 50, 0))
      SetGadgetFont(12, FontID(0)) : SetGadgetColor(12, #PB_Gadget_FrontColor, RGB(200, 50, 0))
      
    Case #PB_OS_Windows_Server_2008_R2
      TextGadget(11, 50, 250, 300, 30, "Operating System:")
      TextGadget(12, 270, 2530, 300, 30, "Windows Server 2008 R2")
      SetGadgetFont(11, FontID(0)) : SetGadgetColor(11, #PB_Gadget_FrontColor, RGB(200, 50, 0))
      SetGadgetFont(12, FontID(0)) : SetGadgetColor(12, #PB_Gadget_FrontColor, RGB(200, 50, 0))
      
    Case #PB_OS_Windows_8
      TextGadget(11, 50, 250, 300, 30, "Operating System:")
      TextGadget(12, 270, 250, 300, 30, "Windows 8")
      SetGadgetFont(11, FontID(0)) : SetGadgetColor(11, #PB_Gadget_FrontColor, RGB(200, 50, 0))
      SetGadgetFont(12, FontID(0)) : SetGadgetColor(12, #PB_Gadget_FrontColor, RGB(200, 50, 0))
      
    Case #PB_OS_Windows_Server_2012
      TextGadget(11, 50, 250, 300, 30, "Operating System:")
      TextGadget(12, 270, 250, 300, 30, "Windows Server 2012")
      SetGadgetFont(11, FontID(0)) : SetGadgetColor(11, #PB_Gadget_FrontColor, RGB(200, 50, 0))
      SetGadgetFont(12, FontID(0)) : SetGadgetColor(12, #PB_Gadget_FrontColor, RGB(200, 50, 0))
      
    Case #PB_OS_Windows_8_1
      TextGadget(11, 50, 250, 300, 30, "Operating System:")
      TextGadget(12, 270, 250, 300, 30, "Windows 8.1")
      SetGadgetFont(11, FontID(0)) : SetGadgetColor(11, #PB_Gadget_FrontColor, RGB(200, 50, 0))
      SetGadgetFont(12, FontID(0)) : SetGadgetColor(12, #PB_Gadget_FrontColor, RGB(200, 50, 0))
      
    Case #PB_OS_Windows_Server_2012_R2
      TextGadget(11, 50, 250, 300, 30, "Operating System:")
      TextGadget(12, 270, 250, 300, 30, "Windows Server 2012 R2")
      SetGadgetFont(11, FontID(0)) : SetGadgetColor(11, #PB_Gadget_FrontColor, RGB(200, 50, 0))
      SetGadgetFont(12, FontID(0)) : SetGadgetColor(12, #PB_Gadget_FrontColor, RGB(200, 50, 0))
      
    Case #PB_OS_Windows_10
      TextGadget(11, 50, 250, 300, 30, "Operating System:")
      TextGadget(12, 270, 250, 300, 30, "Windows 10")
      SetGadgetFont(11, FontID(0)) : SetGadgetColor(11, #PB_Gadget_FrontColor, RGB(200, 50, 0))
      SetGadgetFont(12, FontID(0)) : SetGadgetColor(12, #PB_Gadget_FrontColor, RGB(200, 50, 0))
    Case #PB_OS_Windows_11
      TextGadget(11, 50, 250, 300, 30, "Operating System:")
      TextGadget(12, 270, 250, 300, 30, "Windows 11")
      SetGadgetFont(11, FontID(0)) : SetGadgetColor(11, #PB_Gadget_FrontColor, RGB(200, 50, 0))
      SetGadgetFont(12, FontID(0)) : SetGadgetColor(12, #PB_Gadget_FrontColor, RGB(200, 50, 0))
    Case #PB_OS_Windows_Future
      TextGadget(11, 50, 250, 300, 30, "Operating System:")
      TextGadget(12, 270, 250, 300, 30, "Windows Future")
      SetGadgetFont(11, FontID(0)) : SetGadgetColor(11, #PB_Gadget_FrontColor, RGB(200, 50, 0))
      SetGadgetFont(12, FontID(0)) : SetGadgetColor(12, #PB_Gadget_FrontColor, RGB(200, 50, 0))
  EndSelect    
EndIf

;3rd party hard drive code, I need to comment who's code this is below
; hard drive
Global Dim HDAvailableSpace.q(0)
Global Dim HDCapacity.q(0)
Global Dim HDFreeSpace.q(0)

Procedure GetDiskFreeSpace(drive$)
  SetErrorMode_(#SEM_FAILCRITICALERRORS)
  GetDiskFreeSpaceEx_(@drive$, HDAvailableSpace(), HDCapacity(), HDFreeSpace())
  SetErrorMode_(0)
EndProcedure

GetDiskFreeSpace("c:")

TextGadget(13, 50, 280, 300, 30, "HD Capacity C:\")
TextGadget(14, 270, 280, 300, 30, "" + Str(HDCapacity(0)/1024/1024/1024)+" GB")
SetGadgetFont(13, FontID(0)) : SetGadgetColor(13, #PB_Gadget_FrontColor, RGB(200, 50, 0))
SetGadgetFont(14, FontID(0)) : SetGadgetColor(14, #PB_Gadget_FrontColor, RGB(200, 50, 0))

TextGadget(15, 50, 310, 300, 30, "HD Available Space C:\")
TextGadget(16, 270, 310, 300, 30, "" + Str(HDFreeSpace(0)/1024/1024/1024)+" GB")
SetGadgetFont(15, FontID(0)) : SetGadgetColor(15, #PB_Gadget_FrontColor, RGB(200, 50, 0))
SetGadgetFont(16, FontID(0)) : SetGadgetColor(16, #PB_Gadget_FrontColor, RGB(200, 50, 0))

TextGadget(17, 50, 340, 300, 30, "HD Used Space")
TextGadget(18, 270, 340, 300, 30, "" + Str((HDCapacity(0)-HDFreeSpace(0))/1024/1024/1024)+" GB")
SetGadgetFont(17, FontID(0)) : SetGadgetColor(17, #PB_Gadget_FrontColor, RGB(200, 50, 0))
SetGadgetFont(18, FontID(0)) : SetGadgetColor(18, #PB_Gadget_FrontColor, RGB(200, 50, 0))

Repeat
  event = WaitWindowEvent()
  
  
Until event = #PB_Event_CloseWindow
Last edited by Distorted Pixel on Tue Nov 29, 2022 4:05 am, edited 1 time in total.
To be popular is way to much work. I just want to be me, myself and I. Oh no, does that mean I'm bipolar? :shock:

No one cares how much you know until they know how much you care
User avatar
idle
Always Here
Always Here
Posts: 5042
Joined: Fri Sep 21, 2007 5:52 am
Location: New Zealand

Re: TextGadget showing up different location in Windows 11 than Windows 10

Post by idle »

It looks the same as your W10 image on my win11

Image
User avatar
Distorted Pixel
Enthusiast
Enthusiast
Posts: 233
Joined: Sun Aug 29, 2021 4:34 am

Re: TextGadget showing up different location in Windows 11 than Windows 10

Post by Distorted Pixel »

idle wrote: Mon Nov 28, 2022 3:06 am It looks the same as your W10 image on my win11

Image
Why would one daughter have it show up fine on her windows 11 laptop and the other daughter has the issue on her windows 11 laptop that is in the pic above?

Another thing, how are you getting your image to show up on this page and when I try to do that, it doesn't work? I always have to post a link
To be popular is way to much work. I just want to be me, myself and I. Oh no, does that mean I'm bipolar? :shock:

No one cares how much you know until they know how much you care
User avatar
idle
Always Here
Always Here
Posts: 5042
Joined: Fri Sep 21, 2007 5:52 am
Location: New Zealand

Re: TextGadget showing up different location in Windows 11 than Windows 10

Post by idle »

Don't know, why it'd be different but the odd one your posted had different dimensions and the operating system line was black text. are you sure she ran the right exe on her system?

I'm using the img tags and the image is on my webserver. just paste the url in between but it probably won't work on mega as its not directly accessing the image.
User avatar
Distorted Pixel
Enthusiast
Enthusiast
Posts: 233
Joined: Sun Aug 29, 2021 4:34 am

Re: TextGadget showing up different location in Windows 11 than Windows 10

Post by Distorted Pixel »

idle wrote: Mon Nov 28, 2022 3:28 am Don't know, why it'd be different but the odd one your posted had different dimensions and the operating system line was black text. are you sure she ran the right exe on her system?

I'm using the img tags and the image is on my webserver. just paste the url in between but it probably won't work on mega as its not directly accessing the image.
I just checked every color in the code and they all are RGB(200, 50, 0) for every operating system in the code.

Here is Windows 10 and 11 code:

Code: Select all

Case #PB_OS_Windows_10
      TextGadget(11, 50, 250, 300, 30, "Operating System:")
      TextGadget(12, 270, 250, 300, 30, "Windows 10")
      SetGadgetFont(11, FontID(0)) : SetGadgetColor(11, #PB_Gadget_FrontColor, RGB(200, 50, 0))
      SetGadgetFont(12, FontID(0)) : SetGadgetColor(12, #PB_Gadget_FrontColor, RGB(200, 50, 0))
    Case #PB_OS_Windows_11
      TextGadget(11, 50, 250, 300, 30, "Operating System:")
      TextGadget(12, 270, 250, 300, 30, "Windows 11")
      SetGadgetFont(11, FontID(0)) : SetGadgetColor(11, #PB_Gadget_FrontColor, RGB(200, 50, 0))
      SetGadgetFont(12, FontID(0)) : SetGadgetColor(12, #PB_Gadget_FrontColor, RGB(200, 50, 0))

This is all the operating system code and they all say the same RGB(200, 50, 0)
I don't see any black color

Code: Select all

; operating system
If OSVersion() <> #PB_OS_Windows_NT3_51
  Select OSVersion()
    Case #PB_OS_Windows_95
      TextGadget(11, 50, 250, 300, 30, "Operating System:")
      TextGadget(12, 270, 250, 300, 30, "Windows 95")
      SetGadgetFont(11, FontID(0)) : SetGadgetColor(11, #PB_Gadget_FrontColor, RGB(200, 50, 0))
      SetGadgetFont(12, FontID(0)) : SetGadgetColor(12, #PB_Gadget_FrontColor, RGB(200, 50, 0))
      
    Case  #PB_OS_Windows_NT_4
      TextGadget(11, 50, 250, 300, 30, "Operating System:")
      TextGadget(12, 270, 250, 300, 30, "Windows NT 4")
      SetGadgetFont(11, FontID(0)) : SetGadgetColor(11, #PB_Gadget_FrontColor, RGB(200, 50, 0))
      SetGadgetFont(12, FontID(0)) : SetGadgetColor(12, #PB_Gadget_FrontColor, RGB(200, 50, 0))
      
    Case  #PB_OS_Windows_98
      TextGadget(11, 50, 250, 300, 30, "Operating System:")
      TextGadget(12, 270, 250, 300, 30, "Windows 98")
      SetGadgetFont(11, FontID(0)) : SetGadgetColor(11, #PB_Gadget_FrontColor, RGB(200, 50, 0))
      SetGadgetFont(12, FontID(0)) : SetGadgetColor(12, #PB_Gadget_FrontColor, RGB(200, 50, 0))
      
    Case #PB_OS_Windows_ME
      TextGadget(11, 50, 250, 300, 30, "Operating System:")
      TextGadget(12, 270, 2530, 300, 30, "Windows ME")
      SetGadgetFont(11, FontID(0)) : SetGadgetColor(11, #PB_Gadget_FrontColor, RGB(200, 50, 0))
      SetGadgetFont(12, FontID(0)) : SetGadgetColor(12, #PB_Gadget_FrontColor, RGB(200, 50, 0))
      
    Case #PB_OS_Windows_2000
      TextGadget(11, 50, 2530, 300, 30, "Operating System:")
      TextGadget(12, 270, 2530, 300, 30, "Windows 2000")
      SetGadgetFont(11, FontID(0)) : SetGadgetColor(11, #PB_Gadget_FrontColor, RGB(200, 50, 0))
      SetGadgetFont(12, FontID(0)) : SetGadgetColor(12, #PB_Gadget_FrontColor, RGB(200, 50, 0))
      
    Case #PB_OS_Windows_XP
      TextGadget(11, 50, 250, 300, 30, "Operating System:                Windows XP")
      TextGadget(12, 270, 250, 300, 30, "Windows XP")
      SetGadgetFont(11, FontID(0)) : SetGadgetColor(11, #PB_Gadget_FrontColor, RGB(200, 50, 0))
      SetGadgetFont(12, FontID(0)) : SetGadgetColor(12, #PB_Gadget_FrontColor, RGB(200, 50, 0))
      
    Case #PB_OS_Windows_Server_2003
      TextGadget(11, 50, 250, 300, 30, "Operating System:")
      TextGadget(12, 270, 250, 300, 30, "Windows Server 2003")
      SetGadgetFont(11, FontID(0)) : SetGadgetColor(11, #PB_Gadget_FrontColor, RGB(200, 50, 0))
      SetGadgetFont(12, FontID(0)) : SetGadgetColor(12, #PB_Gadget_FrontColor, RGB(200, 50, 0))
      
    Case #PB_OS_Windows_Vista
      TextGadget(11, 50, 250, 300, 30, "Operating System:")
      TextGadget(12, 270, 250, 300, 30, "Windows Vista")
      SetGadgetFont(11, FontID(0)) : SetGadgetColor(11, #PB_Gadget_FrontColor, RGB(200, 50, 0))
      SetGadgetFont(12, FontID(0)) : SetGadgetColor(12, #PB_Gadget_FrontColor, RGB(200, 50, 0))
      
    Case #PB_OS_Windows_Server_2008
      TextGadget(11, 50, 250, 300, 30, "Operating System:")
      TextGadget(12, 270, 250, 300, 30, "Windows Server 2008")
      SetGadgetFont(11, FontID(0)) : SetGadgetColor(11, #PB_Gadget_FrontColor, RGB(200, 50, 0))
      SetGadgetFont(12, FontID(0)) : SetGadgetColor(12, #PB_Gadget_FrontColor, RGB(200, 50, 0))
      
    Case #PB_OS_Windows_7
      TextGadget(11, 50, 250, 300, 30, "Operating System:")
      TextGadget(12, 270, 250, 300, 30, "Windows 7")
      SetGadgetFont(11, FontID(0)) : SetGadgetColor(11, #PB_Gadget_FrontColor, RGB(200, 50, 0))
      SetGadgetFont(12, FontID(0)) : SetGadgetColor(12, #PB_Gadget_FrontColor, RGB(200, 50, 0))
      
    Case #PB_OS_Windows_Server_2008_R2
      TextGadget(11, 50, 250, 300, 30, "Operating System:")
      TextGadget(12, 270, 2530, 300, 30, "Windows Server 2008 R2")
      SetGadgetFont(11, FontID(0)) : SetGadgetColor(11, #PB_Gadget_FrontColor, RGB(200, 50, 0))
      SetGadgetFont(12, FontID(0)) : SetGadgetColor(12, #PB_Gadget_FrontColor, RGB(200, 50, 0))
      
    Case #PB_OS_Windows_8
      TextGadget(11, 50, 250, 300, 30, "Operating System:")
      TextGadget(12, 270, 250, 300, 30, "Windows 8")
      SetGadgetFont(11, FontID(0)) : SetGadgetColor(11, #PB_Gadget_FrontColor, RGB(200, 50, 0))
      SetGadgetFont(12, FontID(0)) : SetGadgetColor(12, #PB_Gadget_FrontColor, RGB(200, 50, 0))
      
    Case #PB_OS_Windows_Server_2012
      TextGadget(11, 50, 250, 300, 30, "Operating System:")
      TextGadget(12, 270, 250, 300, 30, "Windows Server 2012")
      SetGadgetFont(11, FontID(0)) : SetGadgetColor(11, #PB_Gadget_FrontColor, RGB(200, 50, 0))
      SetGadgetFont(12, FontID(0)) : SetGadgetColor(12, #PB_Gadget_FrontColor, RGB(200, 50, 0))
      
    Case #PB_OS_Windows_8_1
      TextGadget(11, 50, 250, 300, 30, "Operating System:")
      TextGadget(12, 270, 250, 300, 30, "Windows 8.1")
      SetGadgetFont(11, FontID(0)) : SetGadgetColor(11, #PB_Gadget_FrontColor, RGB(200, 50, 0))
      SetGadgetFont(12, FontID(0)) : SetGadgetColor(12, #PB_Gadget_FrontColor, RGB(200, 50, 0))
      
    Case #PB_OS_Windows_Server_2012_R2
      TextGadget(11, 50, 250, 300, 30, "Operating System:")
      TextGadget(12, 270, 250, 300, 30, "Windows Server 2012 R2")
      SetGadgetFont(11, FontID(0)) : SetGadgetColor(11, #PB_Gadget_FrontColor, RGB(200, 50, 0))
      SetGadgetFont(12, FontID(0)) : SetGadgetColor(12, #PB_Gadget_FrontColor, RGB(200, 50, 0))
      
    Case #PB_OS_Windows_10
      TextGadget(11, 50, 250, 300, 30, "Operating System:")
      TextGadget(12, 270, 250, 300, 30, "Windows 10")
      SetGadgetFont(11, FontID(0)) : SetGadgetColor(11, #PB_Gadget_FrontColor, RGB(200, 50, 0))
      SetGadgetFont(12, FontID(0)) : SetGadgetColor(12, #PB_Gadget_FrontColor, RGB(200, 50, 0))
    Case #PB_OS_Windows_11
      TextGadget(11, 50, 250, 300, 30, "Operating System:")
      TextGadget(12, 270, 250, 300, 30, "Windows 11")
      SetGadgetFont(11, FontID(0)) : SetGadgetColor(11, #PB_Gadget_FrontColor, RGB(200, 50, 0))
      SetGadgetFont(12, FontID(0)) : SetGadgetColor(12, #PB_Gadget_FrontColor, RGB(200, 50, 0))
    Case #PB_OS_Windows_Future
      TextGadget(11, 50, 250, 300, 30, "Operating System:")
      TextGadget(12, 270, 250, 300, 30, "Windows Future")
      SetGadgetFont(11, FontID(0)) : SetGadgetColor(11, #PB_Gadget_FrontColor, RGB(200, 50, 0))
      SetGadgetFont(12, FontID(0)) : SetGadgetColor(12, #PB_Gadget_FrontColor, RGB(200, 50, 0))
  EndSelect    
EndIf
To be popular is way to much work. I just want to be me, myself and I. Oh no, does that mean I'm bipolar? :shock:

No one cares how much you know until they know how much you care
User avatar
Distorted Pixel
Enthusiast
Enthusiast
Posts: 233
Joined: Sun Aug 29, 2021 4:34 am

Re: TextGadget showing up different location in Windows 11 than Windows 10

Post by Distorted Pixel »

Don't know, why it'd be different but the odd one your posted had different dimensions and the operating system line was black text. are you sure she ran the right exe on her system?
There was only one exe created for the program.

Check this out, all I did was add SetGadgetColor(0, #PB_Gadget_FrontColor, RGB(0, 0, 0)) on the the black "System Information" at the top and the font size changed, but the font size code stayed the same.

It shouldn't do this, all I did was add one command for color....Weird I'm running PB 6 64 bit
https://mega.nz/file/JsM3iQIC#dKQ-x5sxb ... dMwZvYlYcY

Code: Select all

LoadFont(0, "Arial", 25, #PB_Font_Bold | #PB_Font_HighQuality | #PB_Font_Underline)
TextGadget(0, 180, 30, 430, 35, "System Information", #PB_Text_Center)
SetGadgetFont(0, FontID(0)) : SetGadgetColor(0, #PB_Gadget_FrontColor, RGB(0, 0, 0))
To be popular is way to much work. I just want to be me, myself and I. Oh no, does that mean I'm bipolar? :shock:

No one cares how much you know until they know how much you care
BarryG
Addict
Addict
Posts: 3292
Joined: Thu Apr 18, 2019 8:17 am

Re: TextGadget showing up different location in Windows 11 than Windows 10

Post by BarryG »

Looks like one PC has the system DPI set different to the other.
fryquez
Enthusiast
Enthusiast
Posts: 362
Joined: Mon Dec 21, 2015 8:12 pm

Re: TextGadget showing up different location in Windows 11 than Windows 10

Post by fryquez »

You really should not do that:

LoadFont(0, "Arial", 25, #PB_Font_Bold | #PB_Font_HighQuality | #PB_Font_Underline)
...
LoadFont(0, "Arial", 13, #PB_Font_HighQuality)

Minimize and restore the window and you will see.
User avatar
VB6_to_PBx
Enthusiast
Enthusiast
Posts: 617
Joined: Mon May 09, 2011 9:36 am

Re: TextGadget showing up different location in Windows 11 than Windows 10

Post by VB6_to_PBx »

try this Code :

Code: Select all

OpenWindow(0, 0, 0, 800, 600, "SysIM", #PB_Window_SystemMenu | #PB_Window_ScreenCentered | #PB_Window_MinimizeGadget |
                                       #PB_Window_MaximizeGadget)
; CreateMenu(0, WindowID(0))
; MenuTitle("Program")
; MenuItem(0, "Settings")
; MenuItem(1, "Quit")
; MenuTitle("Help")
; MenuItem(4, "Help")
; MenuItem(5, "Online Help")

; program title
#Arial25bu = 1 : LoadFont(#Arial25bu, "Arial", 25, #PB_Font_Bold | #PB_Font_HighQuality | #PB_Font_Underline)
TextGadget(0, 180, 30, 430, 35, "System Information", #PB_Text_Center)
SetGadgetFont(0, FontID(#Arial25bu))

; total memory installed
Mem.q = MemoryStatus(#PB_System_TotalPhysical)
#Arial13b = 2 : LoadFont(#Arial13b, "Arial", 13, #PB_Font_HighQuality)
TextGadget(1, 50, 100, 300, 30, "Total Memory Installed:"); + Mem + "GB")
TextGadget(2, 270, 100, 300, 30, "" + Mem + " GB")
SetGadgetFont(1, FontID(#Arial13b)) : SetGadgetColor(1, #PB_Gadget_FrontColor, RGB(200, 50, 0))
SetGadgetFont(2, FontID(#Arial13b)) : SetGadgetColor(2, #PB_Gadget_FrontColor, RGB(200, 50, 0))

; computer name
CompName$ = ComputerName()
TextGadget(3, 50, 130, 250, 30, "Computer Name:")
TextGadget(4, 270, 130, 250, 30, "" + CompName$)
SetGadgetFont(3, FontID(#Arial13b)) : SetGadgetColor(3, #PB_Gadget_FrontColor, RGB(200, 50, 0))
SetGadgetFont(4, FontID(#Arial13b)) : SetGadgetColor(4, #PB_Gadget_FrontColor, RGB(200, 50, 0))

; cpu name
CpuName$ = CPUName()
TextGadget(5, 50, 160, 100, 30, "CPU Name:")
TextGadget(6, 270, 160, 550, 30, "" + CpuName$)
SetGadgetFont(5, FontID(#Arial13b)) : SetGadgetColor(5, #PB_Gadget_FrontColor, RGB(200, 50, 0))
SetGadgetFont(6, FontID(#Arial13b)) : SetGadgetColor(6, #PB_Gadget_FrontColor, RGB(200, 50, 0))

; number of cpus
CpuCount = CountCPUs()
TextGadget(7, 50, 190, 450, 30, "CPU Count:")
TextGadget(8, 270, 190, 450, 30, "" + CpuCount)
SetGadgetFont(7, FontID(#Arial13b)) : SetGadgetColor(7, #PB_Gadget_FrontColor, RGB(200, 50, 0))
SetGadgetFont(8, FontID(#Arial13b)) : SetGadgetColor(8, #PB_Gadget_FrontColor, RGB(200, 50, 0))

; user name
UsrName$ = UserName()
TextGadget(9, 50, 220, 650, 30, "User Name:")
TextGadget(10, 270, 220, 300, 30, "" + UsrName$)
SetGadgetFont(9, FontID(#Arial13b)) : SetGadgetColor(9, #PB_Gadget_FrontColor, RGB(200, 50, 0))
SetGadgetFont(10, FontID(#Arial13b)) : SetGadgetColor(10, #PB_Gadget_FrontColor, RGB(200, 50, 0))

; operating system
If OSVersion() <> #PB_OS_Windows_NT3_51
  Select OSVersion()
    Case #PB_OS_Windows_95
      TextGadget(11, 50, 250, 300, 30, "Operating System:")
      TextGadget(12, 270, 250, 300, 30, "Windows 95")
      SetGadgetFont(11, FontID(#Arial13b)) : SetGadgetColor(11, #PB_Gadget_FrontColor, RGB(200, 50, 0))
      SetGadgetFont(12, FontID(#Arial13b)) : SetGadgetColor(12, #PB_Gadget_FrontColor, RGB(200, 50, 0))
      
    Case  #PB_OS_Windows_NT_4
      TextGadget(11, 50, 250, 300, 30, "Operating System:")
      TextGadget(12, 270, 250, 300, 30, "Windows NT 4")
      SetGadgetFont(11, FontID(#Arial13b)) : SetGadgetColor(11, #PB_Gadget_FrontColor, RGB(200, 50, 0))
      SetGadgetFont(12, FontID(#Arial13b)) : SetGadgetColor(12, #PB_Gadget_FrontColor, RGB(200, 50, 0))
      
    Case  #PB_OS_Windows_98
      TextGadget(11, 50, 250, 300, 30, "Operating System:")
      TextGadget(12, 270, 250, 300, 30, "Windows 98")
      SetGadgetFont(11, FontID(#Arial13b)) : SetGadgetColor(11, #PB_Gadget_FrontColor, RGB(200, 50, 0))
      SetGadgetFont(12, FontID(#Arial13b)) : SetGadgetColor(12, #PB_Gadget_FrontColor, RGB(200, 50, 0))
      
    Case #PB_OS_Windows_ME
      TextGadget(11, 50, 250, 300, 30, "Operating System:")
      TextGadget(12, 270, 2530, 300, 30, "Windows ME")
      SetGadgetFont(11, FontID(#Arial13b)) : SetGadgetColor(11, #PB_Gadget_FrontColor, RGB(200, 50, 0))
      SetGadgetFont(12, FontID(#Arial13b)) : SetGadgetColor(12, #PB_Gadget_FrontColor, RGB(200, 50, 0))
      
    Case #PB_OS_Windows_2000
      TextGadget(11, 50, 2530, 300, 30, "Operating System:")
      TextGadget(12, 270, 2530, 300, 30, "Windows 2000")
      SetGadgetFont(11, FontID(#Arial13b)) : SetGadgetColor(11, #PB_Gadget_FrontColor, RGB(200, 50, 0))
      SetGadgetFont(12, FontID(#Arial13b)) : SetGadgetColor(12, #PB_Gadget_FrontColor, RGB(200, 50, 0))
      
    Case #PB_OS_Windows_XP
      TextGadget(11, 50, 250, 300, 30, "Operating System:                Windows XP")
      TextGadget(12, 270, 250, 300, 30, "Windows XP")
      SetGadgetFont(11, FontID(#Arial13b)) : SetGadgetColor(11, #PB_Gadget_FrontColor, RGB(200, 50, 0))
      SetGadgetFont(12, FontID(#Arial13b)) : SetGadgetColor(12, #PB_Gadget_FrontColor, RGB(200, 50, 0))
      
    Case #PB_OS_Windows_Server_2003
      TextGadget(11, 50, 250, 300, 30, "Operating System:")
      TextGadget(12, 270, 250, 300, 30, "Windows Server 2003")
      SetGadgetFont(11, FontID(#Arial13b)) : SetGadgetColor(11, #PB_Gadget_FrontColor, RGB(200, 50, 0))
      SetGadgetFont(12, FontID(#Arial13b)) : SetGadgetColor(12, #PB_Gadget_FrontColor, RGB(200, 50, 0))
      
    Case #PB_OS_Windows_Vista
      TextGadget(11, 50, 250, 300, 30, "Operating System:")
      TextGadget(12, 270, 250, 300, 30, "Windows Vista")
      SetGadgetFont(11, FontID(#Arial13b)) : SetGadgetColor(11, #PB_Gadget_FrontColor, RGB(200, 50, 0))
      SetGadgetFont(12, FontID(#Arial13b)) : SetGadgetColor(12, #PB_Gadget_FrontColor, RGB(200, 50, 0))
      
    Case #PB_OS_Windows_Server_2008
      TextGadget(11, 50, 250, 300, 30, "Operating System:")
      TextGadget(12, 270, 250, 300, 30, "Windows Server 2008")
      SetGadgetFont(11, FontID(#Arial13b)) : SetGadgetColor(11, #PB_Gadget_FrontColor, RGB(200, 50, 0))
      SetGadgetFont(12, FontID(#Arial13b)) : SetGadgetColor(12, #PB_Gadget_FrontColor, RGB(200, 50, 0))
      
    Case #PB_OS_Windows_7
      TextGadget(11, 50, 250, 300, 30, "Operating System:")
      TextGadget(12, 270, 250, 300, 30, "Windows 7")
      SetGadgetFont(11, FontID(#Arial13b)) : SetGadgetColor(11, #PB_Gadget_FrontColor, RGB(200, 50, 0))
      SetGadgetFont(12, FontID(#Arial13b)) : SetGadgetColor(12, #PB_Gadget_FrontColor, RGB(200, 50, 0))
      
    Case #PB_OS_Windows_Server_2008_R2
      TextGadget(11, 50, 250, 300, 30, "Operating System:")
      TextGadget(12, 270, 2530, 300, 30, "Windows Server 2008 R2")
      SetGadgetFont(11, FontID(#Arial13b)) : SetGadgetColor(11, #PB_Gadget_FrontColor, RGB(200, 50, 0))
      SetGadgetFont(12, FontID(#Arial13b)) : SetGadgetColor(12, #PB_Gadget_FrontColor, RGB(200, 50, 0))
      
    Case #PB_OS_Windows_8
      TextGadget(11, 50, 250, 300, 30, "Operating System:")
      TextGadget(12, 270, 250, 300, 30, "Windows 8")
      SetGadgetFont(11, FontID(#Arial13b)) : SetGadgetColor(11, #PB_Gadget_FrontColor, RGB(200, 50, 0))
      SetGadgetFont(12, FontID(#Arial13b)) : SetGadgetColor(12, #PB_Gadget_FrontColor, RGB(200, 50, 0))
      
    Case #PB_OS_Windows_Server_2012
      TextGadget(11, 50, 250, 300, 30, "Operating System:")
      TextGadget(12, 270, 250, 300, 30, "Windows Server 2012")
      SetGadgetFont(11, FontID(#Arial13b)) : SetGadgetColor(11, #PB_Gadget_FrontColor, RGB(200, 50, 0))
      SetGadgetFont(12, FontID(#Arial13b)) : SetGadgetColor(12, #PB_Gadget_FrontColor, RGB(200, 50, 0))
      
    Case #PB_OS_Windows_8_1
      TextGadget(11, 50, 250, 300, 30, "Operating System:")
      TextGadget(12, 270, 250, 300, 30, "Windows 8.1")
      SetGadgetFont(11, FontID(#Arial13b)) : SetGadgetColor(11, #PB_Gadget_FrontColor, RGB(200, 50, 0))
      SetGadgetFont(12, FontID(#Arial13b)) : SetGadgetColor(12, #PB_Gadget_FrontColor, RGB(200, 50, 0))
      
    Case #PB_OS_Windows_Server_2012_R2
      TextGadget(11, 50, 250, 300, 30, "Operating System:")
      TextGadget(12, 270, 250, 300, 30, "Windows Server 2012 R2")
      SetGadgetFont(11, FontID(#Arial13b)) : SetGadgetColor(11, #PB_Gadget_FrontColor, RGB(200, 50, 0))
      SetGadgetFont(12, FontID(#Arial13b)) : SetGadgetColor(12, #PB_Gadget_FrontColor, RGB(200, 50, 0))
      
    Case #PB_OS_Windows_10
      TextGadget(11, 50, 250, 300, 30, "Operating System:")
      TextGadget(12, 270, 250, 300, 30, "Windows 10")
      SetGadgetFont(11, FontID(#Arial13b)) : SetGadgetColor(11, #PB_Gadget_FrontColor, RGB(200, 50, 0))
      SetGadgetFont(12, FontID(#Arial13b)) : SetGadgetColor(12, #PB_Gadget_FrontColor, RGB(200, 50, 0))
    Case #PB_OS_Windows_11
      TextGadget(11, 50, 250, 300, 30, "Operating System:")
      TextGadget(12, 270, 250, 300, 30, "Windows 11")
      SetGadgetFont(11, FontID(#Arial13b)) : SetGadgetColor(11, #PB_Gadget_FrontColor, RGB(200, 50, 0))
      SetGadgetFont(12, FontID(#Arial13b)) : SetGadgetColor(12, #PB_Gadget_FrontColor, RGB(200, 50, 0))
    Case #PB_OS_Windows_Future
      TextGadget(11, 50, 250, 300, 30, "Operating System:")
      TextGadget(12, 270, 250, 300, 30, "Windows Future")
      SetGadgetFont(11, FontID(#Arial13b)) : SetGadgetColor(11, #PB_Gadget_FrontColor, RGB(200, 50, 0))
      SetGadgetFont(12, FontID(#Arial13b)) : SetGadgetColor(12, #PB_Gadget_FrontColor, RGB(200, 50, 0))
  EndSelect    
EndIf

;3rd party hard drive code, I need to comment who's code this is below
; hard drive
Global Dim HDAvailableSpace.q(0)
Global Dim HDCapacity.q(0)
Global Dim HDFreeSpace.q(0)

Procedure GetDiskFreeSpace(drive$)
  SetErrorMode_(#SEM_FAILCRITICALERRORS)
  GetDiskFreeSpaceEx_(@drive$, HDAvailableSpace(), HDCapacity(), HDFreeSpace())
  SetErrorMode_(0)
EndProcedure

GetDiskFreeSpace("c:")

TextGadget(13, 50, 280, 300, 30, "HD Capacity C:\")
TextGadget(14, 270, 280, 300, 30, "" + Str(HDCapacity(0)/1024/1024/1024)+" GB")
SetGadgetFont(13, FontID(#Arial13b)) : SetGadgetColor(13, #PB_Gadget_FrontColor, RGB(200, 50, 0))
SetGadgetFont(14, FontID(#Arial13b)) : SetGadgetColor(14, #PB_Gadget_FrontColor, RGB(200, 50, 0))

TextGadget(15, 50, 310, 300, 30, "HD Available Space C:\")
TextGadget(16, 270, 310, 300, 30, "" + Str(HDFreeSpace(0)/1024/1024/1024)+" GB")
SetGadgetFont(15, FontID(#Arial13b)) : SetGadgetColor(15, #PB_Gadget_FrontColor, RGB(200, 50, 0))
SetGadgetFont(16, FontID(#Arial13b)) : SetGadgetColor(16, #PB_Gadget_FrontColor, RGB(200, 50, 0))

TextGadget(17, 50, 340, 300, 30, "HD Used Space")
TextGadget(18, 270, 340, 300, 30, "" + Str((HDCapacity(0)-HDFreeSpace(0))/1024/1024/1024)+" GB")
SetGadgetFont(17, FontID(#Arial13b)) : SetGadgetColor(17, #PB_Gadget_FrontColor, RGB(200, 50, 0))
SetGadgetFont(18, FontID(#Arial13b)) : SetGadgetColor(18, #PB_Gadget_FrontColor, RGB(200, 50, 0))

Repeat
  event = WaitWindowEvent()
  
  
Until event = #PB_Event_CloseWindow

 
PureBasic .... making tiny electrons do what you want !

"With every mistake we must surely be learning" - George Harrison
User avatar
netmaestro
PureBasic Bullfrog
PureBasic Bullfrog
Posts: 8425
Joined: Wed Jul 06, 2005 5:42 am
Location: Fort Nelson, BC, Canada

Re: TextGadget showing up different location in Windows 11 than Windows 10

Post by netmaestro »

My best guess looking at your code is that on one or two systems OSVersion() is not returning #PB_OS_Windows_11 for some reason and your styling isn't getting applied. On those systems, see what OSVersion() is actually returning and add that in to your list.
BERESHEIT
User avatar
ChrisR
Addict
Addict
Posts: 1127
Joined: Sun Jan 08, 2017 10:27 pm
Location: France

Re: TextGadget showing up different location in Windows 11 than Windows 10

Post by ChrisR »

Do you use latest PureBasic 6.0 ?
#PB_OS_Windows_11 was added to OSVersion() as a return value in PB v6.0. It was not present in PB v5.73 or earlier
User avatar
Distorted Pixel
Enthusiast
Enthusiast
Posts: 233
Joined: Sun Aug 29, 2021 4:34 am

Re: TextGadget showing up different location in Windows 11 than Windows 10

Post by Distorted Pixel »

BarryG wrote: Mon Nov 28, 2022 8:26 am
Looks like one PC has the system DPI set different to the other.
I can't find to dpi setting. I believe I have found it, but windows is controling it atm. I do have the option to turn windows control off and enter a value manually between 100-500
ChrisR wrote: Tue Nov 29, 2022 12:11 am Do you use latest PureBasic 6.0 ?
#PB_OS_Windows_11 was added to OSVersion() as a return value in PB v6.0. It was not present in PB v5.73 or earlier
Yes I am using PureBasic 6.0
netmaestro wrote: Mon Nov 28, 2022 10:03 pm My best guess looking at your code is that on one or two systems OSVersion() is not returning #PB_OS_Windows_11 for some reason and your styling isn't getting applied. On those systems, see what OSVersion() is actually returning and add that in to your list.
I'll look into the OSVersion() thing
To be popular is way to much work. I just want to be me, myself and I. Oh no, does that mean I'm bipolar? :shock:

No one cares how much you know until they know how much you care
User avatar
Distorted Pixel
Enthusiast
Enthusiast
Posts: 233
Joined: Sun Aug 29, 2021 4:34 am

Re: TextGadget showing up different location in Windows 11 than Windows 10

Post by Distorted Pixel »

VB6_to_PBx wrote: Mon Nov 28, 2022 11:52 am try this Code :

Code: Select all

OpenWindow(0, 0, 0, 800, 600, "SysIM", #PB_Window_SystemMenu | #PB_Window_ScreenCentered | #PB_Window_MinimizeGadget |
                                       #PB_Window_MaximizeGadget)
; CreateMenu(0, WindowID(0))
; MenuTitle("Program")
; MenuItem(0, "Settings")
; MenuItem(1, "Quit")
; MenuTitle("Help")
; MenuItem(4, "Help")
; MenuItem(5, "Online Help")

; program title
#Arial25bu = 1 : LoadFont(#Arial25bu, "Arial", 25, #PB_Font_Bold | #PB_Font_HighQuality | #PB_Font_Underline)
TextGadget(0, 180, 30, 430, 35, "System Information", #PB_Text_Center)
SetGadgetFont(0, FontID(#Arial25bu))

; total memory installed
Mem.q = MemoryStatus(#PB_System_TotalPhysical)
#Arial13b = 2 : LoadFont(#Arial13b, "Arial", 13, #PB_Font_HighQuality)
TextGadget(1, 50, 100, 300, 30, "Total Memory Installed:"); + Mem + "GB")
TextGadget(2, 270, 100, 300, 30, "" + Mem + " GB")
SetGadgetFont(1, FontID(#Arial13b)) : SetGadgetColor(1, #PB_Gadget_FrontColor, RGB(200, 50, 0))
SetGadgetFont(2, FontID(#Arial13b)) : SetGadgetColor(2, #PB_Gadget_FrontColor, RGB(200, 50, 0))

; computer name
CompName$ = ComputerName()
TextGadget(3, 50, 130, 250, 30, "Computer Name:")
TextGadget(4, 270, 130, 250, 30, "" + CompName$)
SetGadgetFont(3, FontID(#Arial13b)) : SetGadgetColor(3, #PB_Gadget_FrontColor, RGB(200, 50, 0))
SetGadgetFont(4, FontID(#Arial13b)) : SetGadgetColor(4, #PB_Gadget_FrontColor, RGB(200, 50, 0))

; cpu name
CpuName$ = CPUName()
TextGadget(5, 50, 160, 100, 30, "CPU Name:")
TextGadget(6, 270, 160, 550, 30, "" + CpuName$)
SetGadgetFont(5, FontID(#Arial13b)) : SetGadgetColor(5, #PB_Gadget_FrontColor, RGB(200, 50, 0))
SetGadgetFont(6, FontID(#Arial13b)) : SetGadgetColor(6, #PB_Gadget_FrontColor, RGB(200, 50, 0))

; number of cpus
CpuCount = CountCPUs()
TextGadget(7, 50, 190, 450, 30, "CPU Count:")
TextGadget(8, 270, 190, 450, 30, "" + CpuCount)
SetGadgetFont(7, FontID(#Arial13b)) : SetGadgetColor(7, #PB_Gadget_FrontColor, RGB(200, 50, 0))
SetGadgetFont(8, FontID(#Arial13b)) : SetGadgetColor(8, #PB_Gadget_FrontColor, RGB(200, 50, 0))

; user name
UsrName$ = UserName()
TextGadget(9, 50, 220, 650, 30, "User Name:")
TextGadget(10, 270, 220, 300, 30, "" + UsrName$)
SetGadgetFont(9, FontID(#Arial13b)) : SetGadgetColor(9, #PB_Gadget_FrontColor, RGB(200, 50, 0))
SetGadgetFont(10, FontID(#Arial13b)) : SetGadgetColor(10, #PB_Gadget_FrontColor, RGB(200, 50, 0))

; operating system
If OSVersion() <> #PB_OS_Windows_NT3_51
  Select OSVersion()
    Case #PB_OS_Windows_95
      TextGadget(11, 50, 250, 300, 30, "Operating System:")
      TextGadget(12, 270, 250, 300, 30, "Windows 95")
      SetGadgetFont(11, FontID(#Arial13b)) : SetGadgetColor(11, #PB_Gadget_FrontColor, RGB(200, 50, 0))
      SetGadgetFont(12, FontID(#Arial13b)) : SetGadgetColor(12, #PB_Gadget_FrontColor, RGB(200, 50, 0))
      
    Case  #PB_OS_Windows_NT_4
      TextGadget(11, 50, 250, 300, 30, "Operating System:")
      TextGadget(12, 270, 250, 300, 30, "Windows NT 4")
      SetGadgetFont(11, FontID(#Arial13b)) : SetGadgetColor(11, #PB_Gadget_FrontColor, RGB(200, 50, 0))
      SetGadgetFont(12, FontID(#Arial13b)) : SetGadgetColor(12, #PB_Gadget_FrontColor, RGB(200, 50, 0))
      
    Case  #PB_OS_Windows_98
      TextGadget(11, 50, 250, 300, 30, "Operating System:")
      TextGadget(12, 270, 250, 300, 30, "Windows 98")
      SetGadgetFont(11, FontID(#Arial13b)) : SetGadgetColor(11, #PB_Gadget_FrontColor, RGB(200, 50, 0))
      SetGadgetFont(12, FontID(#Arial13b)) : SetGadgetColor(12, #PB_Gadget_FrontColor, RGB(200, 50, 0))
      
    Case #PB_OS_Windows_ME
      TextGadget(11, 50, 250, 300, 30, "Operating System:")
      TextGadget(12, 270, 2530, 300, 30, "Windows ME")
      SetGadgetFont(11, FontID(#Arial13b)) : SetGadgetColor(11, #PB_Gadget_FrontColor, RGB(200, 50, 0))
      SetGadgetFont(12, FontID(#Arial13b)) : SetGadgetColor(12, #PB_Gadget_FrontColor, RGB(200, 50, 0))
      
    Case #PB_OS_Windows_2000
      TextGadget(11, 50, 2530, 300, 30, "Operating System:")
      TextGadget(12, 270, 2530, 300, 30, "Windows 2000")
      SetGadgetFont(11, FontID(#Arial13b)) : SetGadgetColor(11, #PB_Gadget_FrontColor, RGB(200, 50, 0))
      SetGadgetFont(12, FontID(#Arial13b)) : SetGadgetColor(12, #PB_Gadget_FrontColor, RGB(200, 50, 0))
      
    Case #PB_OS_Windows_XP
      TextGadget(11, 50, 250, 300, 30, "Operating System:                Windows XP")
      TextGadget(12, 270, 250, 300, 30, "Windows XP")
      SetGadgetFont(11, FontID(#Arial13b)) : SetGadgetColor(11, #PB_Gadget_FrontColor, RGB(200, 50, 0))
      SetGadgetFont(12, FontID(#Arial13b)) : SetGadgetColor(12, #PB_Gadget_FrontColor, RGB(200, 50, 0))
      
    Case #PB_OS_Windows_Server_2003
      TextGadget(11, 50, 250, 300, 30, "Operating System:")
      TextGadget(12, 270, 250, 300, 30, "Windows Server 2003")
      SetGadgetFont(11, FontID(#Arial13b)) : SetGadgetColor(11, #PB_Gadget_FrontColor, RGB(200, 50, 0))
      SetGadgetFont(12, FontID(#Arial13b)) : SetGadgetColor(12, #PB_Gadget_FrontColor, RGB(200, 50, 0))
      
    Case #PB_OS_Windows_Vista
      TextGadget(11, 50, 250, 300, 30, "Operating System:")
      TextGadget(12, 270, 250, 300, 30, "Windows Vista")
      SetGadgetFont(11, FontID(#Arial13b)) : SetGadgetColor(11, #PB_Gadget_FrontColor, RGB(200, 50, 0))
      SetGadgetFont(12, FontID(#Arial13b)) : SetGadgetColor(12, #PB_Gadget_FrontColor, RGB(200, 50, 0))
      
    Case #PB_OS_Windows_Server_2008
      TextGadget(11, 50, 250, 300, 30, "Operating System:")
      TextGadget(12, 270, 250, 300, 30, "Windows Server 2008")
      SetGadgetFont(11, FontID(#Arial13b)) : SetGadgetColor(11, #PB_Gadget_FrontColor, RGB(200, 50, 0))
      SetGadgetFont(12, FontID(#Arial13b)) : SetGadgetColor(12, #PB_Gadget_FrontColor, RGB(200, 50, 0))
      
    Case #PB_OS_Windows_7
      TextGadget(11, 50, 250, 300, 30, "Operating System:")
      TextGadget(12, 270, 250, 300, 30, "Windows 7")
      SetGadgetFont(11, FontID(#Arial13b)) : SetGadgetColor(11, #PB_Gadget_FrontColor, RGB(200, 50, 0))
      SetGadgetFont(12, FontID(#Arial13b)) : SetGadgetColor(12, #PB_Gadget_FrontColor, RGB(200, 50, 0))
      
    Case #PB_OS_Windows_Server_2008_R2
      TextGadget(11, 50, 250, 300, 30, "Operating System:")
      TextGadget(12, 270, 2530, 300, 30, "Windows Server 2008 R2")
      SetGadgetFont(11, FontID(#Arial13b)) : SetGadgetColor(11, #PB_Gadget_FrontColor, RGB(200, 50, 0))
      SetGadgetFont(12, FontID(#Arial13b)) : SetGadgetColor(12, #PB_Gadget_FrontColor, RGB(200, 50, 0))
      
    Case #PB_OS_Windows_8
      TextGadget(11, 50, 250, 300, 30, "Operating System:")
      TextGadget(12, 270, 250, 300, 30, "Windows 8")
      SetGadgetFont(11, FontID(#Arial13b)) : SetGadgetColor(11, #PB_Gadget_FrontColor, RGB(200, 50, 0))
      SetGadgetFont(12, FontID(#Arial13b)) : SetGadgetColor(12, #PB_Gadget_FrontColor, RGB(200, 50, 0))
      
    Case #PB_OS_Windows_Server_2012
      TextGadget(11, 50, 250, 300, 30, "Operating System:")
      TextGadget(12, 270, 250, 300, 30, "Windows Server 2012")
      SetGadgetFont(11, FontID(#Arial13b)) : SetGadgetColor(11, #PB_Gadget_FrontColor, RGB(200, 50, 0))
      SetGadgetFont(12, FontID(#Arial13b)) : SetGadgetColor(12, #PB_Gadget_FrontColor, RGB(200, 50, 0))
      
    Case #PB_OS_Windows_8_1
      TextGadget(11, 50, 250, 300, 30, "Operating System:")
      TextGadget(12, 270, 250, 300, 30, "Windows 8.1")
      SetGadgetFont(11, FontID(#Arial13b)) : SetGadgetColor(11, #PB_Gadget_FrontColor, RGB(200, 50, 0))
      SetGadgetFont(12, FontID(#Arial13b)) : SetGadgetColor(12, #PB_Gadget_FrontColor, RGB(200, 50, 0))
      
    Case #PB_OS_Windows_Server_2012_R2
      TextGadget(11, 50, 250, 300, 30, "Operating System:")
      TextGadget(12, 270, 250, 300, 30, "Windows Server 2012 R2")
      SetGadgetFont(11, FontID(#Arial13b)) : SetGadgetColor(11, #PB_Gadget_FrontColor, RGB(200, 50, 0))
      SetGadgetFont(12, FontID(#Arial13b)) : SetGadgetColor(12, #PB_Gadget_FrontColor, RGB(200, 50, 0))
      
    Case #PB_OS_Windows_10
      TextGadget(11, 50, 250, 300, 30, "Operating System:")
      TextGadget(12, 270, 250, 300, 30, "Windows 10")
      SetGadgetFont(11, FontID(#Arial13b)) : SetGadgetColor(11, #PB_Gadget_FrontColor, RGB(200, 50, 0))
      SetGadgetFont(12, FontID(#Arial13b)) : SetGadgetColor(12, #PB_Gadget_FrontColor, RGB(200, 50, 0))
    Case #PB_OS_Windows_11
      TextGadget(11, 50, 250, 300, 30, "Operating System:")
      TextGadget(12, 270, 250, 300, 30, "Windows 11")
      SetGadgetFont(11, FontID(#Arial13b)) : SetGadgetColor(11, #PB_Gadget_FrontColor, RGB(200, 50, 0))
      SetGadgetFont(12, FontID(#Arial13b)) : SetGadgetColor(12, #PB_Gadget_FrontColor, RGB(200, 50, 0))
    Case #PB_OS_Windows_Future
      TextGadget(11, 50, 250, 300, 30, "Operating System:")
      TextGadget(12, 270, 250, 300, 30, "Windows Future")
      SetGadgetFont(11, FontID(#Arial13b)) : SetGadgetColor(11, #PB_Gadget_FrontColor, RGB(200, 50, 0))
      SetGadgetFont(12, FontID(#Arial13b)) : SetGadgetColor(12, #PB_Gadget_FrontColor, RGB(200, 50, 0))
  EndSelect    
EndIf

;3rd party hard drive code, I need to comment who's code this is below
; hard drive
Global Dim HDAvailableSpace.q(0)
Global Dim HDCapacity.q(0)
Global Dim HDFreeSpace.q(0)

Procedure GetDiskFreeSpace(drive$)
  SetErrorMode_(#SEM_FAILCRITICALERRORS)
  GetDiskFreeSpaceEx_(@drive$, HDAvailableSpace(), HDCapacity(), HDFreeSpace())
  SetErrorMode_(0)
EndProcedure

GetDiskFreeSpace("c:")

TextGadget(13, 50, 280, 300, 30, "HD Capacity C:\")
TextGadget(14, 270, 280, 300, 30, "" + Str(HDCapacity(0)/1024/1024/1024)+" GB")
SetGadgetFont(13, FontID(#Arial13b)) : SetGadgetColor(13, #PB_Gadget_FrontColor, RGB(200, 50, 0))
SetGadgetFont(14, FontID(#Arial13b)) : SetGadgetColor(14, #PB_Gadget_FrontColor, RGB(200, 50, 0))

TextGadget(15, 50, 310, 300, 30, "HD Available Space C:\")
TextGadget(16, 270, 310, 300, 30, "" + Str(HDFreeSpace(0)/1024/1024/1024)+" GB")
SetGadgetFont(15, FontID(#Arial13b)) : SetGadgetColor(15, #PB_Gadget_FrontColor, RGB(200, 50, 0))
SetGadgetFont(16, FontID(#Arial13b)) : SetGadgetColor(16, #PB_Gadget_FrontColor, RGB(200, 50, 0))

TextGadget(17, 50, 340, 300, 30, "HD Used Space")
TextGadget(18, 270, 340, 300, 30, "" + Str((HDCapacity(0)-HDFreeSpace(0))/1024/1024/1024)+" GB")
SetGadgetFont(17, FontID(#Arial13b)) : SetGadgetColor(17, #PB_Gadget_FrontColor, RGB(200, 50, 0))
SetGadgetFont(18, FontID(#Arial13b)) : SetGadgetColor(18, #PB_Gadget_FrontColor, RGB(200, 50, 0))

Repeat
  event = WaitWindowEvent()
  
  
Until event = #PB_Event_CloseWindow

I tried your code above and it works great. I have never seen this "#Arial13b"and this "#Arial25bu" before and how they are being used as a variable on left side of "="
I will have your code tested on my daughter's computer to see if that fixes things.
Last edited by Distorted Pixel on Tue Nov 29, 2022 11:26 am, edited 1 time in total.
To be popular is way to much work. I just want to be me, myself and I. Oh no, does that mean I'm bipolar? :shock:

No one cares how much you know until they know how much you care
User avatar
Distorted Pixel
Enthusiast
Enthusiast
Posts: 233
Joined: Sun Aug 29, 2021 4:34 am

Re: TextGadget showing up different location in Windows 11 than Windows 10

Post by Distorted Pixel »

fryquez wrote: Mon Nov 28, 2022 9:35 am You really should not do that:

LoadFont(0, "Arial", 25, #PB_Font_Bold | #PB_Font_HighQuality | #PB_Font_Underline)
...
LoadFont(0, "Arial", 13, #PB_Font_HighQuality)

Minimize and restore the window and you will see.
I tried what you suggested and I see what you mean
To be popular is way to much work. I just want to be me, myself and I. Oh no, does that mean I'm bipolar? :shock:

No one cares how much you know until they know how much you care
User avatar
Distorted Pixel
Enthusiast
Enthusiast
Posts: 233
Joined: Sun Aug 29, 2021 4:34 am

Re: TextGadget showing up different location in Windows 11 than Windows 10

Post by Distorted Pixel »

I compiled VB_6 to PBx's code that works for minimizing and restoring and had my daughter test it and it still isn't showing up right. It looks exactly like the image I posted in first post from Windows 11. The minimize and restore doesn't work either because the title up top in black shows up shrunk when she restores it. She has been snapshotting her desktop and cropping it is why all her images look the way they do, but what is wrong shows up good.

Edit: The minimize and restore does work for me on Windows 10 64 bit and PB 6.0. I'll try remark some things out and pinpoint the issues

Code: Select all

OpenWindow(0, 0, 0, 800, 600, "SysIM", #PB_Window_SystemMenu | #PB_Window_ScreenCentered | #PB_Window_MinimizeGadget |
                                       #PB_Window_MaximizeGadget)
; CreateMenu(0, WindowID(0))
; MenuTitle("Program")
; MenuItem(0, "Settings")
; MenuItem(1, "Quit")
; MenuTitle("Help")
; MenuItem(4, "Help")
; MenuItem(5, "Online Help")

; program title
#Arial25bu = 1 : LoadFont(#Arial25bu, "Arial", 25, #PB_Font_Bold | #PB_Font_HighQuality | #PB_Font_Underline)
TextGadget(0, 180, 30, 430, 35, "System Information", #PB_Text_Center)
SetGadgetFont(0, FontID(#Arial25bu))

; total memory installed
Mem.q = MemoryStatus(#PB_System_TotalPhysical)
#Arial13b = 2 : LoadFont(#Arial13b, "Arial", 13, #PB_Font_HighQuality)
TextGadget(1, 50, 100, 300, 30, "Total Memory Installed:"); + Mem + "GB")
TextGadget(2, 270, 100, 300, 30, "" + Mem + " GB")
SetGadgetFont(1, FontID(#Arial13b)) : SetGadgetColor(1, #PB_Gadget_FrontColor, RGB(200, 50, 0))
SetGadgetFont(2, FontID(#Arial13b)) : SetGadgetColor(2, #PB_Gadget_FrontColor, RGB(200, 50, 0))

; computer name
CompName$ = ComputerName()
TextGadget(3, 50, 130, 250, 30, "Computer Name:")
TextGadget(4, 270, 130, 250, 30, "" + CompName$)
SetGadgetFont(3, FontID(#Arial13b)) : SetGadgetColor(3, #PB_Gadget_FrontColor, RGB(200, 50, 0))
SetGadgetFont(4, FontID(#Arial13b)) : SetGadgetColor(4, #PB_Gadget_FrontColor, RGB(200, 50, 0))

; cpu name
CpuName$ = CPUName()
TextGadget(5, 50, 160, 100, 30, "CPU Name:")
TextGadget(6, 270, 160, 550, 30, "" + CpuName$)
SetGadgetFont(5, FontID(#Arial13b)) : SetGadgetColor(5, #PB_Gadget_FrontColor, RGB(200, 50, 0))
SetGadgetFont(6, FontID(#Arial13b)) : SetGadgetColor(6, #PB_Gadget_FrontColor, RGB(200, 50, 0))

; number of cpus
CpuCount = CountCPUs()
TextGadget(7, 50, 190, 450, 30, "CPU Count:")
TextGadget(8, 270, 190, 450, 30, "" + CpuCount)
SetGadgetFont(7, FontID(#Arial13b)) : SetGadgetColor(7, #PB_Gadget_FrontColor, RGB(200, 50, 0))
SetGadgetFont(8, FontID(#Arial13b)) : SetGadgetColor(8, #PB_Gadget_FrontColor, RGB(200, 50, 0))

; user name
UsrName$ = UserName()
TextGadget(9, 50, 220, 650, 30, "User Name:")
TextGadget(10, 270, 220, 300, 30, "" + UsrName$)
SetGadgetFont(9, FontID(#Arial13b)) : SetGadgetColor(9, #PB_Gadget_FrontColor, RGB(200, 50, 0))
SetGadgetFont(10, FontID(#Arial13b)) : SetGadgetColor(10, #PB_Gadget_FrontColor, RGB(200, 50, 0))

; operating system
If OSVersion() <> #PB_OS_Windows_NT3_51
  Select OSVersion()
    Case #PB_OS_Windows_95
      TextGadget(11, 50, 250, 300, 30, "Operating System:")
      TextGadget(12, 270, 250, 300, 30, "Windows 95")
      SetGadgetFont(11, FontID(#Arial13b)) : SetGadgetColor(11, #PB_Gadget_FrontColor, RGB(200, 50, 0))
      SetGadgetFont(12, FontID(#Arial13b)) : SetGadgetColor(12, #PB_Gadget_FrontColor, RGB(200, 50, 0))
      
    Case  #PB_OS_Windows_NT_4
      TextGadget(11, 50, 250, 300, 30, "Operating System:")
      TextGadget(12, 270, 250, 300, 30, "Windows NT 4")
      SetGadgetFont(11, FontID(#Arial13b)) : SetGadgetColor(11, #PB_Gadget_FrontColor, RGB(200, 50, 0))
      SetGadgetFont(12, FontID(#Arial13b)) : SetGadgetColor(12, #PB_Gadget_FrontColor, RGB(200, 50, 0))
      
    Case  #PB_OS_Windows_98
      TextGadget(11, 50, 250, 300, 30, "Operating System:")
      TextGadget(12, 270, 250, 300, 30, "Windows 98")
      SetGadgetFont(11, FontID(#Arial13b)) : SetGadgetColor(11, #PB_Gadget_FrontColor, RGB(200, 50, 0))
      SetGadgetFont(12, FontID(#Arial13b)) : SetGadgetColor(12, #PB_Gadget_FrontColor, RGB(200, 50, 0))
      
    Case #PB_OS_Windows_ME
      TextGadget(11, 50, 250, 300, 30, "Operating System:")
      TextGadget(12, 270, 2530, 300, 30, "Windows ME")
      SetGadgetFont(11, FontID(#Arial13b)) : SetGadgetColor(11, #PB_Gadget_FrontColor, RGB(200, 50, 0))
      SetGadgetFont(12, FontID(#Arial13b)) : SetGadgetColor(12, #PB_Gadget_FrontColor, RGB(200, 50, 0))
      
    Case #PB_OS_Windows_2000
      TextGadget(11, 50, 2530, 300, 30, "Operating System:")
      TextGadget(12, 270, 2530, 300, 30, "Windows 2000")
      SetGadgetFont(11, FontID(#Arial13b)) : SetGadgetColor(11, #PB_Gadget_FrontColor, RGB(200, 50, 0))
      SetGadgetFont(12, FontID(#Arial13b)) : SetGadgetColor(12, #PB_Gadget_FrontColor, RGB(200, 50, 0))
      
    Case #PB_OS_Windows_XP
      TextGadget(11, 50, 250, 300, 30, "Operating System:                Windows XP")
      TextGadget(12, 270, 250, 300, 30, "Windows XP")
      SetGadgetFont(11, FontID(#Arial13b)) : SetGadgetColor(11, #PB_Gadget_FrontColor, RGB(200, 50, 0))
      SetGadgetFont(12, FontID(#Arial13b)) : SetGadgetColor(12, #PB_Gadget_FrontColor, RGB(200, 50, 0))
      
    Case #PB_OS_Windows_Server_2003
      TextGadget(11, 50, 250, 300, 30, "Operating System:")
      TextGadget(12, 270, 250, 300, 30, "Windows Server 2003")
      SetGadgetFont(11, FontID(#Arial13b)) : SetGadgetColor(11, #PB_Gadget_FrontColor, RGB(200, 50, 0))
      SetGadgetFont(12, FontID(#Arial13b)) : SetGadgetColor(12, #PB_Gadget_FrontColor, RGB(200, 50, 0))
      
    Case #PB_OS_Windows_Vista
      TextGadget(11, 50, 250, 300, 30, "Operating System:")
      TextGadget(12, 270, 250, 300, 30, "Windows Vista")
      SetGadgetFont(11, FontID(#Arial13b)) : SetGadgetColor(11, #PB_Gadget_FrontColor, RGB(200, 50, 0))
      SetGadgetFont(12, FontID(#Arial13b)) : SetGadgetColor(12, #PB_Gadget_FrontColor, RGB(200, 50, 0))
      
    Case #PB_OS_Windows_Server_2008
      TextGadget(11, 50, 250, 300, 30, "Operating System:")
      TextGadget(12, 270, 250, 300, 30, "Windows Server 2008")
      SetGadgetFont(11, FontID(#Arial13b)) : SetGadgetColor(11, #PB_Gadget_FrontColor, RGB(200, 50, 0))
      SetGadgetFont(12, FontID(#Arial13b)) : SetGadgetColor(12, #PB_Gadget_FrontColor, RGB(200, 50, 0))
      
    Case #PB_OS_Windows_7
      TextGadget(11, 50, 250, 300, 30, "Operating System:")
      TextGadget(12, 270, 250, 300, 30, "Windows 7")
      SetGadgetFont(11, FontID(#Arial13b)) : SetGadgetColor(11, #PB_Gadget_FrontColor, RGB(200, 50, 0))
      SetGadgetFont(12, FontID(#Arial13b)) : SetGadgetColor(12, #PB_Gadget_FrontColor, RGB(200, 50, 0))
      
    Case #PB_OS_Windows_Server_2008_R2
      TextGadget(11, 50, 250, 300, 30, "Operating System:")
      TextGadget(12, 270, 2530, 300, 30, "Windows Server 2008 R2")
      SetGadgetFont(11, FontID(#Arial13b)) : SetGadgetColor(11, #PB_Gadget_FrontColor, RGB(200, 50, 0))
      SetGadgetFont(12, FontID(#Arial13b)) : SetGadgetColor(12, #PB_Gadget_FrontColor, RGB(200, 50, 0))
      
    Case #PB_OS_Windows_8
      TextGadget(11, 50, 250, 300, 30, "Operating System:")
      TextGadget(12, 270, 250, 300, 30, "Windows 8")
      SetGadgetFont(11, FontID(#Arial13b)) : SetGadgetColor(11, #PB_Gadget_FrontColor, RGB(200, 50, 0))
      SetGadgetFont(12, FontID(#Arial13b)) : SetGadgetColor(12, #PB_Gadget_FrontColor, RGB(200, 50, 0))
      
    Case #PB_OS_Windows_Server_2012
      TextGadget(11, 50, 250, 300, 30, "Operating System:")
      TextGadget(12, 270, 250, 300, 30, "Windows Server 2012")
      SetGadgetFont(11, FontID(#Arial13b)) : SetGadgetColor(11, #PB_Gadget_FrontColor, RGB(200, 50, 0))
      SetGadgetFont(12, FontID(#Arial13b)) : SetGadgetColor(12, #PB_Gadget_FrontColor, RGB(200, 50, 0))
      
    Case #PB_OS_Windows_8_1
      TextGadget(11, 50, 250, 300, 30, "Operating System:")
      TextGadget(12, 270, 250, 300, 30, "Windows 8.1")
      SetGadgetFont(11, FontID(#Arial13b)) : SetGadgetColor(11, #PB_Gadget_FrontColor, RGB(200, 50, 0))
      SetGadgetFont(12, FontID(#Arial13b)) : SetGadgetColor(12, #PB_Gadget_FrontColor, RGB(200, 50, 0))
      
    Case #PB_OS_Windows_Server_2012_R2
      TextGadget(11, 50, 250, 300, 30, "Operating System:")
      TextGadget(12, 270, 250, 300, 30, "Windows Server 2012 R2")
      SetGadgetFont(11, FontID(#Arial13b)) : SetGadgetColor(11, #PB_Gadget_FrontColor, RGB(200, 50, 0))
      SetGadgetFont(12, FontID(#Arial13b)) : SetGadgetColor(12, #PB_Gadget_FrontColor, RGB(200, 50, 0))
      
    Case #PB_OS_Windows_10
      TextGadget(11, 50, 250, 300, 30, "Operating System:")
      TextGadget(12, 270, 250, 300, 30, "Windows 10")
      SetGadgetFont(11, FontID(#Arial13b)) : SetGadgetColor(11, #PB_Gadget_FrontColor, RGB(200, 50, 0))
      SetGadgetFont(12, FontID(#Arial13b)) : SetGadgetColor(12, #PB_Gadget_FrontColor, RGB(200, 50, 0))
    Case #PB_OS_Windows_11
      TextGadget(11, 50, 250, 300, 30, "Operating System:")
      TextGadget(12, 270, 250, 300, 30, "Windows 11")
      SetGadgetFont(11, FontID(#Arial13b)) : SetGadgetColor(11, #PB_Gadget_FrontColor, RGB(200, 50, 0))
      SetGadgetFont(12, FontID(#Arial13b)) : SetGadgetColor(12, #PB_Gadget_FrontColor, RGB(200, 50, 0))
    Case #PB_OS_Windows_Future
      TextGadget(11, 50, 250, 300, 30, "Operating System:")
      TextGadget(12, 270, 250, 300, 30, "Windows Future")
      SetGadgetFont(11, FontID(#Arial13b)) : SetGadgetColor(11, #PB_Gadget_FrontColor, RGB(200, 50, 0))
      SetGadgetFont(12, FontID(#Arial13b)) : SetGadgetColor(12, #PB_Gadget_FrontColor, RGB(200, 50, 0))
  EndSelect    
EndIf

;3rd party hard drive code, I need to comment who's code this is below
; hard drive
Global Dim HDAvailableSpace.q(0)
Global Dim HDCapacity.q(0)
Global Dim HDFreeSpace.q(0)

Procedure GetDiskFreeSpace(drive$)
  SetErrorMode_(#SEM_FAILCRITICALERRORS)
  GetDiskFreeSpaceEx_(@drive$, HDAvailableSpace(), HDCapacity(), HDFreeSpace())
  SetErrorMode_(0)
EndProcedure

GetDiskFreeSpace("c:")

TextGadget(13, 50, 280, 300, 30, "HD Capacity C:\")
TextGadget(14, 270, 280, 300, 30, "" + Str(HDCapacity(0)/1024/1024/1024)+" GB")
SetGadgetFont(13, FontID(#Arial13b)) : SetGadgetColor(13, #PB_Gadget_FrontColor, RGB(200, 50, 0))
SetGadgetFont(14, FontID(#Arial13b)) : SetGadgetColor(14, #PB_Gadget_FrontColor, RGB(200, 50, 0))

TextGadget(15, 50, 310, 300, 30, "HD Available Space C:\")
TextGadget(16, 270, 310, 300, 30, "" + Str(HDFreeSpace(0)/1024/1024/1024)+" GB")
SetGadgetFont(15, FontID(#Arial13b)) : SetGadgetColor(15, #PB_Gadget_FrontColor, RGB(200, 50, 0))
SetGadgetFont(16, FontID(#Arial13b)) : SetGadgetColor(16, #PB_Gadget_FrontColor, RGB(200, 50, 0))

TextGadget(17, 50, 340, 300, 30, "HD Used Space")
TextGadget(18, 270, 340, 300, 30, "" + Str((HDCapacity(0)-HDFreeSpace(0))/1024/1024/1024)+" GB")
SetGadgetFont(17, FontID(#Arial13b)) : SetGadgetColor(17, #PB_Gadget_FrontColor, RGB(200, 50, 0))
SetGadgetFont(18, FontID(#Arial13b)) : SetGadgetColor(18, #PB_Gadget_FrontColor, RGB(200, 50, 0))

Repeat
  event = WaitWindowEvent()
  
  
Until event = #PB_Event_CloseWindow

In this image she didn't minimize it yet
https://mega.nz/file/8xNlQZiK#JtRN1CY9J ... wYwSvJ_gG4
To be popular is way to much work. I just want to be me, myself and I. Oh no, does that mean I'm bipolar? :shock:

No one cares how much you know until they know how much you care
Post Reply