Расширенная информация об окнах
- Enumeration
- #gMainHWND_Dec
- #gMainHWND_Hex
- #gParentHWND_Dec
- #gParentHWND_Hex
- #gMainClass
- #gParentClass
- #gMainText
- #gParentText
- EndEnumeration
- Procedure UpdateWindowInfo()
- Static Cursor.POINT, Wnd.l, Parent.l, MainClass${255}, ParentClass${255}, MainText${1024}, ParentText${1024}
- GetCursorPos_(Cursor)
- Wnd = WindowFromPoint_(Cursor\X|(Cursor\Y<<32))
- GetClassName_(Wnd,@MainClass$,$FF) ;получаем имя класса по хэндлу окна
- GetWindowText_(Wnd,@MainText$,$FF) ;получаем текст окна по хэндлу окна
- Parent = GetParent_(Wnd) ;получить хэндл родительского окна
- GetClassName_(Parent,@ParentClass$,$FF)
- GetWindowText_(Parent,@ParentText$,$FF)
- SetGadgetText(#gMainHWND_Dec, Str(Wnd) )
- SetGadgetText(#gMainHWND_Hex, Hex(Wnd) )
- SetGadgetText(#gParentHWND_Dec, Str(Parent) )
- SetGadgetText(#gParentHWND_Hex, Hex(Parent) )
- SetGadgetText(#gMainClass, MainClass$ )
- SetGadgetText(#gParentClass, ParentClass$)
- SetGadgetText(#gMainText, MainText$ )
- SetGadgetText(#gParentText, ParentText$ )
- EndProcedure
- wnd = OpenWindow(0,0,0,280,240,"Extended Window Viewer",#PB_Window_SystemMenu)
- CreateGadgetList(wnd)
- TextGadget(#PB_Any,115,5,40,20,".:Dec:.")
- TextGadget(#PB_Any,215,5,40,20,".:Hex:.")
- TextGadget(#PB_Any,5,22,50,20,"HWND:")
- StringGadget(#gMainHWND_Dec,85, 20,90,20,"")
- StringGadget(#gMainHWND_Hex,185,20,90,20,"")
- TextGadget(#PB_Any,5,52,80,20,"Parent HWND:")
- StringGadget(#gParentHWND_Dec,85, 50,90,20,"")
- StringGadget(#gParentHWND_Hex,185,50,90,20,"")
- TextGadget(#PB_Any,5,82,80,20,"CLASS:")
- StringGadget(#gMainClass,85,80,190,20,"")
- TextGadget(#PB_Any,5,107,80,30,"ParentWND CLASS:")
- StringGadget(#gParentClass,85,110,190,20,"")
- TextGadget(#PB_Any,5,142,80,20,"TEXT:")
- StringGadget(#gMainText,85,140,190,20,"")
- TextGadget(#PB_Any,5,167,80,30,"ParentWND TEXT:")
- StringGadget(#gParentText,85,170,190,20,"")
- SetTimer_(wnd,0,100,@UpdateWindowInfo()); вызывать процедуру @UpdateWindowInfo() через каждые 100мс
- Repeat : Until WaitWindowEvent() = #WM_CLOSE
- End
Получаем WindowsClass окон.