WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

EXAMPLES FROM USERS

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

Return Title and Style of All Window Siblings

 Keywords: Shell_TrayWnd Title Style List Enumerate Window Siblings GetDesktopWindow cWndinfo WinItemize WinItemizeEx

Question:

I am trying to locate a windows with the style (class type) of Shell_TrayWnd

Answer:

Here is a good starting point.
AddExtender("wwctl44i.dll")

; Returns text and style of all window siblings.
#DefineFunction OneLevelWinItemize(hFirst) ;
   lTopWindows = ""
   hNext = hFirst
   While hNext
      lTopWindows = lTopWindows:"Text = ":cWndinfo(hNext, 0):", ":"Style = ":cWndinfo(hNext, 2):@TAB
      hNext = cWndinfo(hNext, 6)
   EndWhile

   Return StrTrim(lTopWindows)
#EndFunction

; Get the desktop window.
hDeskTop = DllCall(DirWindows(1):"user32.dll",long:"GetDesktopWindow")
hTopLevel = cWndinfo(hDeskTop, 8) ; First child of the desktop
lTopWindows = OneLevelWinItemize(hTopLevel)
Selection = AskItemlist("Select a Window", lTopWindows, @TAB, @SORTED, @SINGLE)

Exit

Article ID:   W17566
Filename:   Return Title and Style of All Window Siblings..txt
File Created: 2013:03:06:08:58:30
Last Updated: 2013:03:06:08:58:30