DaveR Valued Contributor


Joined: 03 Sep 2005 Posts: 413 Location: Australia
|
Posted: Mon Sep 15, 2008 11:05 am Post subject: |
|
|
Sure is. BTW I created this function based on code that someone posted here (sorry, I can't remember who).
| Code: |
#define function,WinState
%%Window = #ExploreWClass
%%Window = "%328792"
if @WinState(%%Window,hung)
info %%Window is hung ,
end
if @WinState(%%Window,min)
info %%Window is minimised ,
elsif @WinState(%%Window,max)
info %%Window is maximised ,
end
if @WinState(%%Window,visible)
info %%Window is visible ,
end
if @WinState(%%Window,enabled)
info %%Window is enabled ,
end
stop
:WinState
#--------------------------------------------------------------------
# Checks the window's state. SYNTAX %x = @WinState(<window>,<state>)
# Valid values for <state> are:
# hung
# min
# max
# visible
# enabled
#--------------------------------------------------------------------
if @both(@not(%1),@not(%2))
# Missing argument(s) to function
error 11
exit
end
if @winexists(%1)
%w = @strdel(@winexists(%1),1,)
else
# Window does not exist
error -1
exit
end
if @equal(hung,%2) @equal(min,%2) @equal(max,%2) @equal(visible,%2) @equal(enabled,%2)
loadlib User32.dll
if @equal(hung,%2)
%x = @lib(user32,IsHungAppWindow,BOOL:,%w)
elsif @equal(min,%2)
%x = @lib(user32,IsIconic,BOOL:,%w)
elsif @equal(max,%2)
%x = @lib(user32,IsZoomed,BOOL:,%w)
elsif @equal(visible,%2)
%x = @lib(user32,IsWindowVisible,BOOL:,%w)
elsif @equal(enabled,%2)
%x = @lib(user32,IsWindowEnabled,BOOL:,INT:%w)
end
freelib User32.dll
else
# Invalid argument(s) to function
error 13
exit
end
exit %x
|
_________________ cheers
Dave |
|