Code: Select all
;==============================================================
; Program: Digger
; Author: Lloyd Gallant (netmaestro)
; Date: December 20, 2007
; Updated: December 27, 2016
; Target OS: Microsoft Windows All
; Target Compiler: PureBasic 4.0 and later
; License: Free, unrestricted, use at your own risk
;==============================================================
OpenWindow(0,0,0,440,64,"",#PB_Window_BorderLess|#WS_BORDER|#PB_Window_Invisible)
StickyWindow(0,1)
wclight = RGB(255,255,223)
wcdark = RGB(235,235,203)
SetWindowColor(0,wclight)
ExamineDesktops()
screenw = DesktopWidth(0)
screenh = DesktopHeight(0)
TextGadget(0,0,0,100,16,"")
TextGadget(1,60,0,80,16,"Hwnd")
TextGadget(2,140,0,100,16,"Caption")
TextGadget(3,240,0,60,16,"Ctrl ID")
TextGadget(4,300,0,140,16,"Classname")
TextGadget(5,0,16,60,10,"")
TextGadget(6,0,26,60,16,"Window:")
TextGadget(7,0,42,60,22," Parent:")
TextGadget(8,60,26,80,16,"")
TextGadget(9,140,26,100,16,"")
TextGadget(10,240,26,60,16,"")
TextGadget(11,300,26,140,16,"")
TextGadget(12,60,42,80,16,"")
TextGadget(13,140,42,100,16,"")
TextGadget(14,240,42,60,16,"")
TextGadget(15,300,42,140,16,"")
For i=0 To 7
SetGadgetColor(i,#PB_Gadget_BackColor,wcdark)
Next
For i=8 To 15
SetGadgetColor(i,#PB_Gadget_BackColor,wclight)
Next
ShowWindow_(WindowID(0), #SW_SHOWNA)
Repeat
Delay(1)
ev=WindowEvent()
x=DesktopMouseX():y=DesktopMouseY()
If x > screenw-WindowWidth(0)
wx = x-WindowWidth(0)
Else
wx = x+10
EndIf
If y >= screenh-WindowHeight(0)+20
wy = y-WindowHeight(0)-10
Else
wy = y+20
EndIf
ResizeWindow(0, wx, wy, #PB_Ignore, #PB_Ignore)
hwnd = WindowFromPoint_(x|(y<<32))
If hwnd<>oldhwnd Or ev=#PB_Event_Repaint
hwnd$ = Hex(hwnd)
caption$ = Space(100)
GetWindowText_(hwnd, @caption$, 99)
ctrlid$ = Str(GetWindowLong_(hwnd, #GWL_ID))
class$ = Space(140)
GetClassName_(hwnd, @class$, 139)
SetGadgetText(8, hwnd$)
SetGadgetText(9, caption$)
SetGadgetText(10, ctrlid$)
SetGadgetText(11, class$)
parent = GetParent_(hwnd)
parent$ = Hex(parent)
caption$ = Space(100)
GetWindowText_(parent, @caption$, 99)
ctrlid$ = Str(GetWindowLong_(parent, #GWL_ID))
class$ = Space(140)
GetClassName_(parent, @class$, 139)
SetGadgetText(12, parent$)
SetGadgetText(13, caption$)
SetGadgetText(14, ctrlid$)
SetGadgetText(15, class$)
oldhwnd = hwnd
RedrawWindow_(WindowID(0),0,0,#RDW_UPDATENOW)
EndIf
Until GetAsyncKeyState_(#VK_RBUTTON) & 32768