Hello;
My new laptop screen is too bright even at lowest brightness setting (causes migraines) :
So I am hoping I can make a program that shows a semi-transparent one-color image in a Frameless window .
So:
1) Frameless window .
(A sliver of a Frames would be acceptable if it was at
screen edge . )
2) Variable transparency setting .
3 Always on top .
4) Can click-thru on anything behind transparent window .
Notepad++ has a %transparency setting for Find window but it's not click-thru .
Is it possible to create such a program or
is there a sample of such ?
Thanks
How to make program Frameless image window ?
How to make program Frameless image window ?
vmars.us Win11 x64 , Martin Guitar 000-16 (1995)
"All things in moderation , except for love and forgiveness."
"All things in moderation , except for love and forgiveness."
Re: How to make program Frameless image window ?
Hi vmars316,
Try the following:
- use the Esc key to close the window
Windows Services & Other Stuff\Other_Stuff\OtherStuff\TransparentWindow.pb
Try the following:
- use the Esc key to close the window
Windows Services & Other Stuff\Other_Stuff\OtherStuff\TransparentWindow.pb
Last edited by JHPJHP on Wed Dec 16, 2020 11:47 pm, edited 1 time in total.
Re: How to make program Frameless image window ?
Since the ESC key is also used by other programs, I modified JHPJHPs code to use a systray icon for program termination.
Code: Select all
EnableExplicit
Define lpRect.RECT
GetWindowRect_(GetDesktopWindow_(), @lpRect)
If OpenWindow(0, 0, 0, lpRect\right, lpRect\bottom, #Null$, #PB_Window_Invisible | #PB_Window_BorderLess | #PB_Window_NoGadgets | #PB_Window_NoActivate)
StickyWindow(0, #True)
SetWindowColor(0, $000000)
SetWindowLongPtr_(WindowID(0), #GWL_EXSTYLE, #WS_EX_LAYERED | #WS_EX_TOOLWINDOW | #WS_EX_TRANSPARENT)
SetLayeredWindowAttributes_(WindowID(0), $F0F0F0, 144, #LWA_COLORKEY | #LWA_ALPHA)
SetWindowPos_(WindowID(0), #HWND_TOPMOST, 0, 0, 0, 0, #SWP_NOACTIVATE | #SWP_SHOWWINDOW | #SWP_ASYNCWINDOWPOS | #SWP_DEFERERASE | #SWP_NOCOPYBITS | #SWP_NOMOVE | #SWP_NOREDRAW | #SWP_NOSENDCHANGING | #SWP_NOSIZE)
HideWindow(0, #False)
AddSysTrayIcon(1, WindowID(0), CatchImage(0, ?Icon, ?IconEnd - ?Icon))
SysTrayIconToolTip(1, "Click to exit")
Repeat
If WaitWindowEvent() = #PB_Event_SysTray
If EventType() = #PB_EventType_LeftClick
Break
EndIf
EndIf
ForEver
EndIf
DataSection
Icon:
IncludeBinary #PB_Compiler_Home + "examples/sources/Data/CdPlayer.ico"
IconEnd:
EndDataSection
Re: How to make program Frameless image window ?
Hi
@JHPJHP
Good one mate except using hook did some trouble to me
@infratec
Using SysTray did the job
I did not think about such solution
Thanks guys
@JHPJHP
Good one mate except using hook did some trouble to me
@infratec
Using SysTray did the job
I did not think about such solution
Thanks guys
Egypt my love
Re: How to make program Frameless image window ?
Pls , how do I get an access key to download ?JHPJHP wrote:Hi vmars316,
Try the following:
- use the Esc key to close the window
Windows Services & Other Stuff\Other_Stuff\OtherStuff\TransparentWindow.pb
Thanks
vmars.us Win11 x64 , Martin Guitar 000-16 (1995)
"All things in moderation , except for love and forgiveness."
"All things in moderation , except for love and forgiveness."
Re: How to make program Frameless image window ?
Hi vmars316,
Please use the script posted by infratec.
Please use the script posted by infratec.
Re: How to make program Frameless image window ?
Thanks,JHPJHP wrote:Hi vmars316,
Please use the script posted by infratec.
I tested both , but both gives me this error:
Define lpRect.RECT ; Structure not found: RECT.
How can I fix this ?
Thanks
vmars.us Win11 x64 , Martin Guitar 000-16 (1995)
"All things in moderation , except for love and forgiveness."
"All things in moderation , except for love and forgiveness."
Re: How to make program Frameless image window ?
Hi vmars316,
I assume you're using the demo version of PureBasic. I don't believe the free version of PureBasic supports API calls or Windows Structures.
Structures would be easy enough to solve, just create your own, but this example also requires access to Windows API's.
I assume you're using the demo version of PureBasic. I don't believe the free version of PureBasic supports API calls or Windows Structures.
Structures would be easy enough to solve, just create your own, but this example also requires access to Windows API's.
Re: How to make program Frameless image window ?
Oops , Yes I was , I didn't see the Login button .JHPJHP wrote:Hi vmars316,
I assume you're using the demo version of PureBasic. I don't believe the free version of PureBasic supports API calls or Windows Structures.
Structures would be easy enough to solve, just create your own, but this example also requires access to Windows API's.
Works great with PureBasic_Windows_X64_LTS_5.73_(refx1s).exe .
Thanks
vmars.us Win11 x64 , Martin Guitar 000-16 (1995)
"All things in moderation , except for love and forgiveness."
"All things in moderation , except for love and forgiveness."
Re: How to make program Frameless image window ?
Wow , That's a wonderful program ,infratec wrote:Since the ESC key is also used by other programs, I modified JHPJHPs code to use a systray icon for program termination.
Thank you All !
vmars.us Win11 x64 , Martin Guitar 000-16 (1995)
"All things in moderation , except for love and forgiveness."
"All things in moderation , except for love and forgiveness."