forum.vdsworld.com Forum Index forum.vdsworld.com
Visit VDSWORLD.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Visable Windows

 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help
View previous topic :: View next topic  
Author Message
LiquidCode
Moderator Team


Joined: 05 Dec 2000
Posts: 1753
Location: Space and Time

PostPosted: Sun Sep 14, 2008 3:26 pm    Post subject: Visable Windows Reply with quote

Is there a way that VDS can tell if a window is visible or hidden?
_________________
Chris
Http://theblindhouse.com
Back to top
View user's profile Send private message Send e-mail Visit poster's website
DaveR
Valued Contributor
Valued Contributor


Joined: 03 Sep 2005
Posts: 413
Location: Australia

PostPosted: Mon Sep 15, 2008 11:05 am    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
LiquidCode
Moderator Team


Joined: 05 Dec 2000
Posts: 1753
Location: Space and Time

PostPosted: Mon Sep 15, 2008 11:32 am    Post subject: Reply with quote

Great! Thanks a lot!
_________________
Chris
Http://theblindhouse.com
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum

Twitter@vdsworld       RSS

Powered by phpBB © 2001, 2005 phpBB Group