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 


Window states

 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> Advanced VDS 5 Source Code
View previous topic :: View next topic  
Author Message
Dr. Dread
Professional Member
Professional Member


Joined: 03 Aug 2001
Posts: 1065
Location: Copenhagen, Denmark

PostPosted: Thu Jul 24, 2003 9:15 am    Post subject: Window states Reply with quote

Another API sample. Check window states and bring it to foreground:

Code:

TITLE Windows states..   by Dr. Dread

REM Set the title of your test window
%%window = "new file - metapad"

REM Check if it's actually there
if @winexists(%%window)
  %W = @strdel(@WINEXISTS(%%window),1,)
else
  info The window @CHR(34)%%window@CHR(34) does not exist! Aborting..
  stop
end

REM Load user32.dll
LOADLIB User32.dll

REM Check if the target window is not responding
%A = @lib(user32,IsHungAppWindow,BOOL:,%W)
if %A
  %%Ames = yes
else
  %%Ames = no
end

REM Check if the target window is minimized
%B = @lib(user32,IsIconic,BOOL:,%W)
if %B
  %%Bmes = yes
else
  %%Bmes = no
end

REM Check if the target window is maximized
%C = @lib(user32,IsZoomed,BOOL:,%W)
if %C
  %%Cmes = yes
else
  %%Cmes = no
end

REM Check if the target window is visible
%D = @lib(user32,IsWindowVisible,BOOL:,%W)
if %D
  %%Dmes = yes
else
  %%Dmes = no
end

info Window @CHR(34)%%window@CHR(34):@CR()@CR()Hung: %%Ames@CR()Minimized: %%Bmes@CR()Maximized: %%Cmes@CR()Visible: %%Dmes

REM Bring target window to foreground
if %B
  REM Restore from minimized
  %X = @lib(user32,OpenIcon,BOOL:,%W)
else
  REM If not minimized, then just bring it forward
  %X = @lib(user32,SetForegroundWindow,BOOL:,%W)
end

FREELIB User32


Greetz
Dr. Dread

_________________
~~ Alcohol and calculus don't mix... Don't drink and derive! ~~

String.DLL * advanced string processing
Back to top
View user's profile Send private message
SnarlingSheep
Professional Member
Professional Member


Joined: 13 Mar 2001
Posts: 759
Location: Michigan

PostPosted: Thu Jul 24, 2003 4:45 pm    Post subject: Reply with quote

Good example Dread.
You can use the Window Class too, which is more reliable if you have it.
Code:

%%window = #Notepad

_________________
-Sheep
My pockets hurt...
Back to top
View user's profile Send private message Send e-mail
Skit3000
Admin Team


Joined: 11 May 2002
Posts: 2166
Location: The Netherlands

PostPosted: Thu Jul 24, 2003 5:20 pm    Post subject: Reply with quote

What does the 'visible' parameter mean? It's not that a window is on top or something... Neutral
_________________
[ Add autocomplete functionality to your VDS IDE windows! ]
Voor Nederlandse beginners met VDS: bekijk ook eens deze tutorial!
Back to top
View user's profile Send private message
SnarlingSheep
Professional Member
Professional Member


Joined: 13 Mar 2001
Posts: 759
Location: Michigan

PostPosted: Thu Jul 24, 2003 5:41 pm    Post subject: Reply with quote

Visible means it's restored, whether it's behind another window or not.
_________________
-Sheep
My pockets hurt...
Back to top
View user's profile Send private message Send e-mail
Dr. Dread
Professional Member
Professional Member


Joined: 03 Aug 2001
Posts: 1065
Location: Copenhagen, Denmark

PostPosted: Thu Jul 24, 2003 5:45 pm    Post subject: Reply with quote

Skit3000 wrote:
What does the 'visible' parameter mean? It's not that a window is on top or something... Neutral


Nope, it has nothing to do with 'on top' - visible is more like 'not hidden'. Try to run a WINDOW HIDE on
your target window, then its visible state should become No.

Greetz
Dread

_________________
~~ Alcohol and calculus don't mix... Don't drink and derive! ~~

String.DLL * advanced string processing
Back to top
View user's profile Send private message
Dr. Dread
Professional Member
Professional Member


Joined: 03 Aug 2001
Posts: 1065
Location: Copenhagen, Denmark

PostPosted: Thu Jul 24, 2003 5:46 pm    Post subject: Reply with quote

Aaaa, Sheep's faster than me - fastest draw in the West Laughing

Dread

_________________
~~ Alcohol and calculus don't mix... Don't drink and derive! ~~

String.DLL * advanced string processing
Back to top
View user's profile Send private message
SnarlingSheep
Professional Member
Professional Member


Joined: 13 Mar 2001
Posts: 759
Location: Michigan

PostPosted: Thu Jul 24, 2003 5:50 pm    Post subject: Reply with quote

What do I win? Smile
_________________
-Sheep
My pockets hurt...
Back to top
View user's profile Send private message Send e-mail
Dr. Dread
Professional Member
Professional Member


Joined: 03 Aug 2001
Posts: 1065
Location: Copenhagen, Denmark

PostPosted: Thu Jul 24, 2003 5:52 pm    Post subject: Reply with quote

Everlasting honor and a notch on your gun's handle.

Cool
Dread

_________________
~~ Alcohol and calculus don't mix... Don't drink and derive! ~~

String.DLL * advanced string processing
Back to top
View user's profile Send private message
SnarlingSheep
Professional Member
Professional Member


Joined: 13 Mar 2001
Posts: 759
Location: Michigan

PostPosted: Thu Jul 24, 2003 5:53 pm    Post subject: Reply with quote

Bah, I wanted money. Laughing
_________________
-Sheep
My pockets hurt...
Back to top
View user's profile Send private message Send e-mail
FreezingFire
Admin Team


Joined: 23 Jun 2002
Posts: 3508

PostPosted: Thu Jul 24, 2003 8:56 pm    Post subject: Reply with quote

How about a trip to the zoo? You can pet the Prakash's penguin.
_________________
FreezingFire
VDSWORLD.com
Site Admin Team
Back to top
View user's profile Send private message Visit poster's website
PGWARE
Web Host


Joined: 29 Dec 2001
Posts: 1537

PostPosted: Fri Jul 25, 2003 4:20 am    Post subject: Reply with quote

MOoooooo
Back to top
View user's profile Send private message
Garrett
Moderator Team


Joined: 04 Oct 2001
Posts: 2144
Location: A House

PostPosted: Fri Jul 25, 2003 4:38 am    Post subject: Reply with quote

I see the Penguin has since been booty raped in the Zoo by Bubba
the Bear! Laughing

-Garrett

_________________
'What you do not want done to yourself, do not do to others.' - Confucius (550 b.c. to 479 b.c.)
Necroprogramming FTW! - "Wait.. Is necroprogramming legal?"
http://www.freewarehome.com <-- Freeware listings since 1996
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> Advanced VDS 5 Source Code 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