Transparent window title bar no longer selectable (Windows 10)

Just starting out? Need help? Post your questions and find answers here.
Amundo
Enthusiast
Enthusiast
Posts: 191
Joined: Thu Feb 16, 2006 1:41 am
Location: New Zealand

Transparent window title bar no longer selectable (Windows 10)

Post by Amundo »

Greetings all, the following code used to let me use the Title Bar as normal, but I'm sure a recent change in Windows 10 has changed this behaviour:

Code: Select all

EnableExplicit

ExamineDesktops()

#MaskColor        = 0

Define hWndInv = OpenWindow(0, 0, 0, DesktopWidth(0) / 2, DesktopHeight(0) / 2, "Transparent", #PB_Window_TitleBar | #PB_Window_SystemMenu)
SetWindowColor(0, #MaskColor)
SetWindowLong_(hWndInv, #GWL_EXSTYLE, #WS_EX_LAYERED | #WS_EX_TOPMOST)
SetLayeredWindowAttributes_(hWndInv, #MaskColor, 1, #LWA_COLORKEY)
StickyWindow(0, 1)

Repeat
  Define event = WaitWindowEvent()
  Select event
      Case #PB_Event_Menu
        Define KeyPressed = EventMenu()
  EndSelect
Until event = #PB_Event_CloseWindow

End
Win8.1, PB5.x, okayish CPU, onboard video card, fuzzy monitor (or is that my eyesight?)
"When the facts change, I change my mind" - John Maynard Keynes
User avatar
chi
Addict
Addict
Posts: 1028
Joined: Sat May 05, 2007 5:31 pm
Location: Linz, Austria

Re: Transparent window title bar no longer selectable (Windows 10)

Post by chi »

May I ask what exactly you are trying to accomplish with this?
Et cetera is my worst enemy
RASHAD
PureBasic Expert
PureBasic Expert
Posts: 4622
Joined: Sun Apr 12, 2009 6:27 am

Re: Transparent window title bar no longer selectable (Windows 10)

Post by RASHAD »

Change #MaskColor to any color but not Pure Black or Pure White

Code: Select all

EnableExplicit

ExamineDesktops()

#MaskColor        = $010000

Define hWndInv = OpenWindow(0, 0, 0, DesktopWidth(0) / 2, DesktopHeight(0) / 2, "Transparent",#PB_Window_ScreenCentered| #PB_Window_TitleBar | #PB_Window_SystemMenu)
SetWindowColor(0, #MaskColor)
SetWindowLong_(hWndInv, #GWL_EXSTYLE, #WS_EX_LAYERED | #WS_EX_TOPMOST)
SetLayeredWindowAttributes_(hWndInv, #MaskColor, 1, #LWA_COLORKEY)
StickyWindow(0, 1)

Repeat
  Define event = WaitWindowEvent()
  Select event
      Case #PB_Event_Menu
        Define KeyPressed = EventMenu()
  EndSelect
Until event = #PB_Event_CloseWindow

End

Egypt my love
Amundo
Enthusiast
Enthusiast
Posts: 191
Joined: Thu Feb 16, 2006 1:41 am
Location: New Zealand

Re: Transparent window title bar no longer selectable (Windows 10)

Post by Amundo »

chi wrote: Wed Oct 13, 2021 11:14 am May I ask what exactly you are trying to accomplish with this?
Hi Chi, sorry for the late reply. I use an overlay window on top of any other program to draw shapes and things.
Win8.1, PB5.x, okayish CPU, onboard video card, fuzzy monitor (or is that my eyesight?)
"When the facts change, I change my mind" - John Maynard Keynes
Amundo
Enthusiast
Enthusiast
Posts: 191
Joined: Thu Feb 16, 2006 1:41 am
Location: New Zealand

Re: Transparent window title bar no longer selectable (Windows 10)

Post by Amundo »

Thanks Rashad, I shouid have stated that, yes, a non-zero mask colour will work, but I need the area inside the window to be clickable.

Thanks anyway.
Win8.1, PB5.x, okayish CPU, onboard video card, fuzzy monitor (or is that my eyesight?)
"When the facts change, I change my mind" - John Maynard Keynes
User avatar
chi
Addict
Addict
Posts: 1028
Joined: Sat May 05, 2007 5:31 pm
Location: Linz, Austria

Re: Transparent window title bar no longer selectable (Windows 10)

Post by chi »

Amundo wrote: Mon Oct 18, 2021 8:58 pm a non-zero mask colour will work, but I need the area inside the window to be clickable.

Code: Select all

#MaskColor = #Cyan
Et cetera is my worst enemy
Post Reply