"Seethrough" window
-
- Enthusiast
- Posts: 252
- Joined: Fri Feb 20, 2004 5:43 pm
- NoahPhense
- Addict
- Posts: 1999
- Joined: Thu Oct 16, 2003 8:30 pm
- Location: North Florida
Wow Sparkie.. very nice.. that sh!t is tight..Sparkie wrote:Nice one Trond
This seems to work pretty good...NoahPhense wrote:btw - i tried the trick.. nice.. now make it not jumpy...
Code: Select all
; --> Original "Desktop Window" inspired Trond Procedure myCallback(hwnd, msg, wparam, lparam) Result = #PB_ProcessPureBasicEvents Select msg Case #WM_PAINT hdc = BeginPaint_(hwnd, @ps.PAINTSTRUCT) PaintDesktop_(hdc) EndPaint_(hwnd,@ps) Result = 0 Case #WM_MOVING InvalidateRect_(WindowID(), 0, 0) Case #WM_SIZE InvalidateRect_(WindowID(), 0, 0) EndSelect ProcedureReturn Result EndProcedure If OpenWindow(0, 0, 0, 300, 300, #PB_Window_SizeGadget | #PB_Window_MaximizeGadget | #PB_Window_MinimizeGadget, "Desktop Window") SetClassLong_(WindowID(), #GCL_HBRBACKGROUND, 0) SetWindowCallback(@myCallback()) Repeat event = WaitWindowEvent() Until event = #PB_EventCloseWindow EndIf End
* Edited to remove un-needed line *

- np
Thanks np.NoahPhense wrote:Wow Sparkie.. very nice.. that sh!t is tight..

... but are you saying I'm a tight a$$


There may be a better way, but here's your See-Through window. Only tested on WinXP.PB wrote:Sparkie, how about adapting it to show whatever's under the window, instead
of just the Desktop?

Code: Select all
borderW = GetSystemMetrics_(#SM_CXSIZEFRAME)
borderH = GetSystemMetrics_(#SM_CYSIZEFRAME)
captionH = GetSystemMetrics_(#SM_CYCAPTION)
If OpenWindow(0, 0, 0, 300, 300, #PB_Window_SizeGadget | #PB_Window_MaximizeGadget | #PB_Window_MinimizeGadget, "See-Through Window")
outterRgn = CreateRectRgn_(0, 0, WindowWidth() + (borderW * 2), WindowHeight() + captionH + (borderH * 2))
innerRgn = CreateRectRgn_(borderW, captionH + borderH, WindowWidth() + borderW, WindowHeight() + captionH + borderH)
winRgn = outterRgn
CombineRgn_(winRgn, outterRgn, innerRgn, #RGN_XOR)
SetWindowRgn_(WindowID(), winRgn, 1)
DeleteObject_(outterRgn)
DeleteObject_(innerRgn)
Repeat
event = WaitWindowEvent()
Select event
Case #PB_Event_SizeWindow
outterRgn = CreateRectRgn_(0, 0, WindowWidth() + (borderW * 2), WindowHeight() + captionH + (borderH * 2))
innerRgn = CreateRectRgn_(borderW, captionH + borderH, WindowWidth() + borderW, WindowHeight() + captionH + borderH)
winRgn = outterRgn
CombineRgn_(winRgn, outterRgn, innerRgn, #RGN_XOR)
SetWindowRgn_(WindowID(), winRgn, 1)
DeleteObject_(outterRgn)
DeleteObject_(innerRgn)
EndSelect
Until event = #PB_EventCloseWindow
EndIf
End
What goes around comes around.
PB 5.21 LTS (x86) - Windows 8.1
PB 5.21 LTS (x86) - Windows 8.1
- NoahPhense
- Addict
- Posts: 1999
- Joined: Thu Oct 16, 2003 8:30 pm
- Location: North Florida
- NoahPhense
- Addict
- Posts: 1999
- Joined: Thu Oct 16, 2003 8:30 pm
- Location: North Florida
[german]traumatic wrote: OT: fsw, glad you decided _not_ to shut up![]()
manchmal schaue ich hier rein (in den deutschen forum auch


[/german]
Sometimes I come by and test Sparkie's code

...but besides that I didn't do anything with pb lately
