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 


Catch the minimize button?

 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help
View previous topic :: View next topic  
Author Message
GeoTrail
Valued Contributor
Valued Contributor


Joined: 18 Feb 2003
Posts: 572
Location: Bergen, Norway

PostPosted: Sun Mar 16, 2003 2:44 am    Post subject: Catch the minimize button? Reply with quote

Is it possible to catch the event for the minimize button like with the close button?

I'm asking 'cause I want my program to minimize to the taskicon instead of normal minimize.

_________________
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
FreezingFire
Admin Team


Joined: 23 Jun 2002
Posts: 3508

PostPosted: Sun Mar 16, 2003 2:47 am    Post subject: Reply with quote

Here's a way:

Code:
  DIALOG CREATE,New Dialog,-1,0,240,160,RESIZABLE
  DIALOG SHOW
:evloop
wait event
goto @event()

:resize
window normal,new dialog
goto evloop

:close
exit

_________________
FreezingFire
VDSWORLD.com
Site Admin Team
Back to top
View user's profile Send private message Visit poster's website
ShinobiSoft
Professional Member
Professional Member


Joined: 06 Nov 2002
Posts: 790
Location: Knoxville, Tn

PostPosted: Sun Mar 16, 2003 2:48 am    Post subject: Reply with quote

You need to check the windows state. Obtained by @winpos(Window,S)

Returns:
Code:

 3 = Maximized
 2 = Minimized
 1 = Normal


I believe. Smile Wink

_________________
Bill Weckel
ShinobiSoft Software

"The way is known to all, but not all know it."
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger
FreezingFire
Admin Team


Joined: 23 Jun 2002
Posts: 3508

PostPosted: Sun Mar 16, 2003 2:48 am    Post subject: Reply with quote

This one doesn't show the dialog minimizing quite as much:

Code:
  DIALOG CREATE,New Dialog,-1,0,240,160,RESIZABLE
  DIALOG SHOW
:evloop
wait event
goto @event()

:resize
window hide,new dialog
window normal,new dialog
goto evloop

:close
exit

_________________
FreezingFire
VDSWORLD.com
Site Admin Team
Back to top
View user's profile Send private message Visit poster's website
Mac
Professional Member
Professional Member


Joined: 08 Jul 2000
Posts: 1585
Location: Oklahoma USA

PostPosted: Sun Mar 16, 2003 2:49 am    Post subject: Reply with quote

Check @winpos() with the "S" flag (iconized is 2).

You can do this in a timer loop. Wink

Cheers, Mac Smile

_________________
VDSug.dll does file IO, check/disable menu items,
non-VDS dlls, draw functions and more...
Free download (30k dll size) at:
http://www.vdsworld.com/download.php?id=361
Back to top
View user's profile Send private message Send e-mail
Mac
Professional Member
Professional Member


Joined: 08 Jul 2000
Posts: 1585
Location: Oklahoma USA

PostPosted: Sun Mar 16, 2003 2:51 am    Post subject: Reply with quote

OOPS Embarassed

I love this 28k connection... Confused

_________________
VDSug.dll does file IO, check/disable menu items,
non-VDS dlls, draw functions and more...
Free download (30k dll size) at:
http://www.vdsworld.com/download.php?id=361
Back to top
View user's profile Send private message Send e-mail
ShinobiSoft
Professional Member
Professional Member


Joined: 06 Nov 2002
Posts: 790
Location: Knoxville, Tn

PostPosted: Sun Mar 16, 2003 2:53 am    Post subject: Reply with quote

Put a :Timer label in your script like the following:
Code:


:Timer
  %S = @winpos(<Window Name>,S)
  if @equal(%S,2)
    window HIDE,<Window Name>
  end
  goto Evloop



And of course in your :Evloop label:
Code:


  wait "0.1",event



Remember to replace <Window Name> with the titlebar text or the window
identifer of your window.

See if that isn't what ya want. Smile

_________________
Bill Weckel
ShinobiSoft Software

"The way is known to all, but not all know it."
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger
GeoTrail
Valued Contributor
Valued Contributor


Joined: 18 Feb 2003
Posts: 572
Location: Bergen, Norway

PostPosted: Sun Mar 16, 2003 2:53 am    Post subject: Reply with quote

Thanks alot for your quick responses guys.
Still haven't learned how the timer functions work yet, but I'll throw myself into it right away Wink

_________________
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
FreezingFire
Admin Team


Joined: 23 Jun 2002
Posts: 3508

PostPosted: Sun Mar 16, 2003 2:55 am    Post subject: Reply with quote

Oops. Embarassed

BWeckel, you're right about this. My code is just for catching the minimize
event. Your code shows minimizing it to the task icon. Wink

_________________
FreezingFire
VDSWORLD.com
Site Admin Team
Back to top
View user's profile Send private message Visit poster's website
FreezingFire
Admin Team


Joined: 23 Jun 2002
Posts: 3508

PostPosted: Sun Mar 16, 2003 3:00 am    Post subject: Reply with quote

Quote:
Still haven't learned how the timer functions work yet, but I'll throw myself into it right away Wink


Are you talking about TIMER and @TIMER()? There's a good example which
shows the using of the TIMER command and the @TIMER() function with
Visual DialogScript's installation.

Otherwise, if you're talking about the WAIT EVENT,1 kind of stuff it's
really quite simple:

Code:
REM -- Wait for an event for 2 seconds --
wait event,2
goto @event()

:Timer
REM -- This label is just the event generated every two seconds. --
goto evloop

:Close
exit

_________________
FreezingFire
VDSWORLD.com
Site Admin Team
Back to top
View user's profile Send private message Visit poster's website
GeoTrail
Valued Contributor
Valued Contributor


Joined: 18 Feb 2003
Posts: 572
Location: Bergen, Norway

PostPosted: Sun Mar 16, 2003 3:04 am    Post subject: Reply with quote

Yeah, I understand the WAIT command.
But not the TIMER and @TIMER() functions.

I'll have a look at the examples Wink

Thanks guys.

_________________
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Garrett
Moderator Team


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

PostPosted: Sun Mar 16, 2003 6:31 am    Post subject: Reply with quote

Code:
  Title TestDialog
  DIALOG CREATE,TestDialog,10,10,300,200,CLASS TESTDIALOGWINDOW001
  DIALOG SHOW
  %%WinView = 1

:Eventloop
  Wait Event,0
  %E = @event()
  if %E
    goto %E
  end
  goto Eventloop

:TIMER
  If @equal(%%WinView,1)
    If @equal(@winpos(#TESTDIALOGWINDOW001,S),2)
      Window Hide,#TESTDIALOGWINDOW001
      DIALOG ADD,TASKICON,TASKICON1,%0,Test Dialog
      %%WinView = 0
    End
  End
  goto Eventloop

:CLOSE
  EXIT

:TASKICON1CLICK
  Window Normal,#TESTDIALOGWINDOW001
  Window Activate,#TESTDIALOGWINDOW001
  %%WinView = 1
  DIALOG REMOVE,TASKICON1
  goto Eventloop

_________________
'What you do not want done to yourself, do not do to others.' - Confucius (550 b.c. to 479 b.c.)
Back to top
View user's profile Send private message
GeoTrail
Valued Contributor
Valued Contributor


Joined: 18 Feb 2003
Posts: 572
Location: Bergen, Norway

PostPosted: Sun Mar 16, 2003 4:36 pm    Post subject: Reply with quote

Perfect. Thanks alot Garrett Wink

Sorry for all the trouble Embarassed Very Happy

_________________
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
GeoTrail
Valued Contributor
Valued Contributor


Joined: 18 Feb 2003
Posts: 572
Location: Bergen, Norway

PostPosted: Thu Nov 18, 2004 7:30 am    Post subject: Reply with quote

I was just about to ask the same question again, but did a search and here it was Laughing

Guess I've been away from VDS too long. Wink

_________________
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
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