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 


Minimize to Tray

 
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: Thu Feb 10, 2005 11:30 pm    Post subject: Minimize to Tray Reply with quote

Minimizes to tray with normal minimize button. Uses the
window handle in case there is more than one instance
running.

Add a variable to monitor whether the app is showing,
so it only uses the timer when needed. Wink
Code:

OPTION SCALE, 96
OPTION DECIMALSEP, "."
TITLE "By Mac"
DIALOG CREATE,"Minimize to Tray",-1,0,300,200
  %%hwnd = @winexists("Minimize to Tray")
  DIALOG ADD,TASKICON,TrayIcon,," Minimize to Tray Program "
DIALOG SHOW
%%show = 1

:EVLOOP
  if %%show
     WAIT EVENT, ".5"
  else
     WAIT EVENT
  end
  goto @event()

:TIMER
  rem -- check display state for "minimized" --
  if @equal(@winpos(%%hwnd, S), 2)
     DIALOG HIDE
     %%show = ""
  end
  goto EVLOOP

:TrayIconCLICK
  DIALOG SHOW
  WINDOW NORMAL, %%hwnd
  %%show = 1
  goto EVLOOP

:CLOSE
  EXIT

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
andrewm
Newbie


Joined: 13 Jun 2007
Posts: 11

PostPosted: Wed Jun 13, 2007 6:09 pm    Post subject: Help?? Reply with quote

Hi Mac,

I was searching for a tray minimize snippet and came across this.

I am brand new to VDS....we have an inhouse app that someone wrote then quit so I need to learn it!

I put the code into my program, but now all I see is a blank window with minimize to tray as the title, I don't see my app anymore.

I have posted the app below, can you tell me where to put this code?

Code:

option filename,long
option regbuf,20000
option decimalsep,.
%a = @sysinfo(pixperin)
option scale,%a

%%title = CIGL I.T. Helpdesk Ticket Monitor - Campbell Systems
title %%title
gosub get user
%%path = @path(%0)

%%activedir = %%path"active"
%%closeddir = %%path"closed"
%%configdir = %%path"config"

:create dialog
  DIALOG CREATE,%%title,5,5,559,179
REM *** Modified by Dialog Designer on 18/04/2007 - 11:55 ***
  DIALOG ADD,TAB,TAB1,1,1,553,140,Assigned to me|Unassigned
  DIALOG ADD,LIST,LST1,25,5,541,109,,,sorted,dblclick
  dialog add,list,lstX,1,1,1,1
  dialog add,list,lstY,1,3,1,1
  dialog add,list,lst7,1,5,1,1
  dialog add,list,lstUNASSIGNED,1,11,1,1 
  DIALOG ADD,STATUS,ST1,Ready - Displaying workload assigned to %%user
  DIALOG ADD,PROGRESS,PR1,142,5,346,12,0
  DIALOG ADD,BUTTON,BUTTON1,2,218,134,18,Refresh
  DIALOG SHOW
 
%%date  = @datetime(MM-DD-YYYY) 

if @file(%%configdir\master-%%date.txt)
   file delete,%%configdir\master-%%date.txt
   end

if @not(@file(%%configdir\master-%%date.txt))
   dialog set,st1,Generating Master Worklist
   gosub generate master
   end

%%tab = 1   
dialog set,st1,Generating Master Worklist   
gosub process master   
dialog set,st1,Ready - Displaying workload assigned to %%user
%a = 1

     
:loop1
  wait 0.5,event
  %E = @event()
     goto %E

:TIMER
  %A = @succ(%A)
  dialog set,pr1,%a
  if @equal(%a,100)
     gosub generate master
     gosub process master
     %a = 0
     end
  goto loop1

:close
exit


:button1button
%a = 98
goto loop1

:lst1dblclick
%%item = @dlgtext(lst1)
parse "%%item1;%%item2", %%item
inifile open,c:\temp\auto-open.txt
inifile write,data,auto-open,%%item2
wait 1
shell open,%%path"workflow-register-V1.exe"
goto loop1


:Assigned to meCLICK
%%tab = 1
list clear,lst1
list assign,lst1,lst7
goto loop1

:UnassignedCLICK
%%tab = 2
list clear,lst1
list assign,lst1,lstUNASSIGNED
goto loop1


:generate master
list clear,lstX
list clear,lstY
list filelist,lstX,%%activedir\*.txt
%%count = @count(lstX)
if @equal(%%count,0)
   exit
   end
list seek,lstX,0
repeat
%%file = @dlgtext(lstX)
inifile open,%%file
rem due date
%%item1 = @iniread(data,11)
rem client
%%item2 = @iniread(data,06)
rem type
%%item3 = @iniread(data,20)
rem assigned to
%%item4 = @iniread(data,19)
rem ticket ID
%%name = @name(%%file)

list add,lstY,%%item4|%%item1|%%item2|%%item3|%%name
list delete,lstX
%%count = @count(lstX)
until @equal(%%count,0)
file delete,%%configdir\master-%%date.txt
list savefile,lstY,%%configdir\master-%%date.txt
exit


:Process master
list clear,lstX
list clear,lstY
list clear,lst7
list clear,lstUNASSIGNED
list loadfile,lstX,%%configdir\master-%%date.txt
list loadfile,lstY,%%configdir\date compare.txt

%%count = @count(lstX)
if @equal(%%count,0)
   exit
   end
list seek,lstX,0   

repeat
%%item = @dlgtext(lstX)
parse "%%item5;%%item1;%%item2;%%item3;%%item4;%%name", %%item
if @equal(%%item5,Unassigned)
   list add,lstUNASSIGNED,%%item1 - %%item2 - %%item3|%%item4
   end
if @equal(%%item5,%%user)
   list add,lst7,%%item1 - %%item2 - %%item3|%%item4
end

list delete,lstX
%%count = @count(lstX)
until @equal(%%count,0)
list clear,lst1
if @equal(%%tab,1)
   list assign,lst1,lst7
   else
   list assign,lst1,lstUNASSIGNED
   end
exit

:get user
%%user = @env(username)
if @equal(%%user,"")
   %%user = @regread(LOCAL,Network\Logon,username)
   end
if @equal(%%user,"")
   %%user = @regread(CURUSER,Software\Microsoft\Windows\CurrenVersion\Explorer,Logon User Name)
   end
if @equal(%%user,"")
   %%user = @regread(CURUSER,Software\Microsoft\Outlook Express,UserName)
   end
if @equal(%%user,"")
    %%user = @regread(CURUSER,Software\Microsoft\Exchange,UserName)
    end   
if @equal(%%user,"")
   warn Cannot detect your user ID and as such your access will be restricted.  Try rebooting to correct this problem.
   end
exit
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 -> 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