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

Window Manipulation

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

How to Use WinItemize without Displaying System Windows

Keywords: winitemize   WinItemizeEx

Question:

Is there a way to list only the applications listed in the task bar? The WinItemize( ) command lists ALL active windows, including many system-type windows. Is there any way to eliminate this?

Answer:

Go thru the WinItemize list, and ignore the ones where WinState("windowname") returns @HIDDEN , as in the example below.

Or easier yet, use WinItemizeEx function.

Here's some sample code:

;============================cut============================
windoze=WinItemize()
wincount=ItemCount(windoze,@tab)

AskItemList("Before",windoze,@tab,@sorted,@single)

current=1
while 1
   thiswin=ItemExtract(current,windoze,@tab)
   if WinState(thiswin)==@HIDDEN
	windoze=ItemRemove(current,windoze,@tab)
	wincount=wincount-1
   else
	current=current+1
   endif
   if current>wincount then break
endwhile
AskItemList("Intermediate",windoze,@tab,@sorted,@single)

; any maybe you want to add these...
a=ItemLocate("PopMenu",windoze,@tab)
if a!=0 then windoze=ItemRemove(a,WinDoze,@tab)
a=ItemLocate("Program Manager",windoze,@tab)
if a!=0 then windoze=ItemRemove(a,WinDoze,@tab)

AskItemList("After",windoze,@tab,@sorted,@single)

Article ID:   W13378
Filename:   WinItemize and Dont Show System Hidden Windows.txt
File Created: 1999:04:15:16:53:38
Last Updated: 1999:04:15:16:53:38