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 "ONTOP" Utility...

 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> Visual DialogScript 3 Source Code
View previous topic :: View next topic  
Author Message
Mac
Professional Member
Professional Member


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

PostPosted: Mon Sep 02, 2002 11:16 pm    Post subject: Window "ONTOP" Utility... Reply with quote

I wrote this utility a while back for a friend, but I use it
fairly often myself (mostly to make the "SYSMON.EXE"
utility stay ontop). It makes any window stay "ONTOP"
for the duration of the window's current session.

The "Display" subroutine just lets you know the program
is active.
________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________
Code:

%%width = @sysinfo(SCREENWIDTH)

OPTION SCALE, 96
OPTION DECIMALSEP, "."
TITLE "By Mac"
DIALOG CREATE,"Set Window Ontop",0,@diff(@div(%%width, 2), 70),140,40,SMALLCAPS,ONTOP
  DIALOG ADD,BITBTN,Start,0,0,50,20,,"Start"," Start "
  DIALOG ADD,BITBTN,Cancel,0,50,50,20,,"Cancel"," Cancel "
  DIALOG ADD,BITBTN,Help,0,100,40,20,,"??"," Help "
  DIALOG ADD,STATUS,Status,"Ready..."
DIALOG SHOW

:CancelBUTTON
:EVLOOP
  %g = ""
  DIALOG SET, Status, "Ready..."
  rem -- Kill any extra events --
  %d = @event()
  WAIT EVENT
  %d = @event()
  if @equal(%d, CLOSE)@equal(%d, CancelBUTTON)@equal(%d, HelpBUTTON)
     goto %d
  end
  %g = ""
  %s = ?
  REPEAT
    DIALOG SET, Status, "Click a window "%s
    GOSUB Display
    %e = @event()
  UNTIL @not(@equal(@winactive(),"Set Window Ontop"))%e
  WAIT .5
  %w = @winactive()
  if %e
     goto %e
  end
  goto %d

:StartButton
  DIALOG SET, Status, "Ready..."
  WINDOW ONTOP, %w
  goto EVLOOP

:HelpBUTTON
  DIALOG SET, Status, "Ready..."
  INFO "Click the 'Start' button, then click on any"@cr()"open window (or its' taskbar button) that"@cr()"you wish to remain ontop."@cr()@cr()"Closing and re-opening the chosen window"@tab()@cr()"will reset to the original status."
  goto EVLOOP

:CLOSE
  EXIT
  STOP

rem -------- GOSUB -----------

:Display
  if @greater(@len(%s), 18)
     %g = 1
  end
  if @greater(2,@len(%s))
     %g = ""
     %s = ?
  end
  if %g
     %s = @substr(%s, 2, @len(%s))
  else
     %s = " "%s
  end
  WAIT ".01"
  exit

EDIT - Removed what appeared to be an unecessary loop to
kill extra events in EVLOOP (hey, I said I wrote it a while back).

Cheers, Mac

_________________
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
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> Visual DialogScript 3 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