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
Goto page 1, 2  Next
 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> Visual DialogScript 5 Source Code
View previous topic :: View next topic  
Author Message
andrewm
Newbie


Joined: 13 Jun 2007
Posts: 11

PostPosted: Wed Jun 13, 2007 6:28 pm    Post subject: Minimize to tray Reply with quote

Hey everyone,

Brand new to VDS...we have an inhouse app and the developer quit...(I'm the network guy, but I guess I know the most about programming...)

One of the things he left not done was minimizing to the system tray. I did a search and came across code in the VDS 3 forum, but couldn't get it to work...can someone help with this? Is there something builtin to VDS 5 that does this for me?

Thanks!!

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


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

PostPosted: Thu Jun 14, 2007 12:08 am    Post subject: Reply with quote

It depends on what version of VDS you are currently using there. If it's VDS 3 and not 5, then the solution will be slightly different.

-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
DaveR
Valued Contributor
Valued Contributor


Joined: 03 Sep 2005
Posts: 413
Location: Australia

PostPosted: Thu Jun 14, 2007 1:38 am    Post subject: Reply with quote

For VDS 5

Minimize to Tray demo:
Code:

  rem MSGEVENTs to capture non-client mouse clicks
  rem Trap LEFT mouse button down
  option msgevent,$000000A1,WM_NCLBUTTONDOWN
  rem Trap RIGHT mouse button down to capture sysmenu/Minimize
  option msgevent,$000000A4,WM_NCRBUTTONDOWN
  option scale,96

  title Min2Tray Demo
  DIALOG CREATE,Min2Tray Demo,-1,0,240,82,RESIZABLE
  DIALOG ADD,CHECK,MinCheck,30,14,180,18,Mininize to system tray,1
  DIALOG ADD,TASKICON,TrayIcon,app.ico," Min2Tray Demo "
  dialog show
  %%dlg0 = @winexists(Min2Tray Demo)

:evloop
  wait event
  goto @event()

:TrayIconCLICK
  # If Right-Click show popup menu
  if @equal(@click(B),right)
  end
  # If Left-Click restore or iconize window
  if @equal(@click(B),left)
    dialog show
    window activate,%%dlg0
  end
  goto evloop
 
:WM_NCRBUTTONDOWN
:WM_NCLBUTTONDOWN
  # Non-standard window behaviors should be user optional
  if @dlgtext(MinCheck)
    # Test if window status is 2 = iconized / hide taskbar button
    rem info @msgparams(WL)
    if @equal(@winpos(%%dlg0,S),2)
      dialog hide
      rem dialog add,taskicon,TrayIcon
    end
  end
  goto evloop

:Resize
  goto evloop
 
:Close
  exit 

_________________
cheers

Dave
Back to top
View user's profile Send private message Visit poster's website
DaveR
Valued Contributor
Valued Contributor


Joined: 03 Sep 2005
Posts: 413
Location: Australia

PostPosted: Thu Jun 14, 2007 1:59 am    Post subject: Reply with quote

To add to existing VDS 5 code:

Add this near the beginning of your script:
Code:
# MSGEVENTs to capture non-client mouse clicks
  # Trap LEFT mouse button down
  option msgevent,$000000A1,WM_NCLBUTTONDOWN
  # Trap RIGHT mouse button down to capture sysmenu/Minimize
  option msgevent,$000000A4,WM_NCRBUTTONDOWN
  option scale,96


Make sure your main window has the 'resizable' style'. Just add ',RESIZABLE' to the end of the 'dialog create' line.
Example:
Code:
DIALOG CREATE,Min2Tray Demo,-1,0,240,82,RESIZABLE


Add this after the main window's 'dialog show' - but change 'Min2Tray Demo' to the name of your main window (from the 'dialog create' line)
Code:
%%dlg0 = @winexists(Min2Tray Demo)


Add the following near the end of your script (only really has to be after your event loop code):
Code:
:TrayIconCLICK
  # If Right-Click show popup menu (if desired)
  if @equal(@click(B),right)
    rem popup menu code would go here
  end
  # If Left-Click restore or iconize window
  if @equal(@click(B),left)
    dialog show
    window activate,%%dlg0
  end
  goto evloop
 
:WM_NCRBUTTONDOWN
:WM_NCLBUTTONDOWN
  # Test if window status is 2 = iconized / hide taskbar button
  if @equal(@winpos(%%dlg0,S),2)
    dialog hide
  end
  goto evloop


If your script does not already include a 'resize' label add this near the end of your script (only really has to be after your event loop code):
Code:
:Resize
  goto evloop


NOTE: If your event loop label is called something other than :evloop you'll need to change all the 'goto evloop' lines above by replacing 'evloop' with the name of your event loop label.

_________________
cheers

Dave
Back to top
View user's profile Send private message Visit poster's website
andrewm
Newbie


Joined: 13 Jun 2007
Posts: 11

PostPosted: Thu Jun 14, 2007 4:06 pm    Post subject: Can't restore... Reply with quote

Hi Dave,

Thanks soo much for the walkthrough!! I have it minimizing, but it's not in my tray...how do I restore it?

~Andrew
Back to top
View user's profile Send private message
DaveR
Valued Contributor
Valued Contributor


Joined: 03 Sep 2005
Posts: 413
Location: Australia

PostPosted: Fri Jun 15, 2007 3:16 am    Post subject: Reply with quote

You need to add a 'taskicon' element to your dialog. Add the following line of code before your existing 'dialog show' line:
Code:
  DIALOG ADD,TASKICON,TrayIcon,app.ico," Min2Tray Demo "

Replace app.ico with the path and name of the icon you want to use (the same icon as the compiled exe uses?). Replace " Min2Tray Demo " with the hint text you want to display when someone hovers the mouse over the tray icon.

Then add the following near the end of code (it only has to be after your evloop).
Code:

:TrayIconCLICK
  # If Right-Click show popup menu
  if @equal(@click(B),right)
    rem You can add code for a right-click popup menu if desired - which would appear when the suer right-clicks on the tray icon.
  end
  # If Left-Click restore window
  if @equal(@click(B),left)
    dialog show
    window activate,%%dlg0
  end
  goto evloop


Once you have this working I'll show you how to restore the tray icon after Explorer crashes.

_________________
cheers

Dave
Back to top
View user's profile Send private message Visit poster's website
DaveR
Valued Contributor
Valued Contributor


Joined: 03 Sep 2005
Posts: 413
Location: Australia

PostPosted: Fri Jun 15, 2007 3:49 am    Post subject: Reply with quote

Dave wrote:
Once you have this working I'll show you how to restore the tray icon after Explorer crashes.

Here you go.

Near the top of your script add the following:
Code:
  #define command,TrayIco
  # Get current SysTray ID into %%shell_TrayWnd_ID
  TrayIco


Then edit your evloop so the 'wait event' line uses the optional wait period.
Code:
:Evloop
  wait event,5
  goto @event()


Then add the following after your evloop.
Code:
:Timer
  # Restore Tray Icon if needed
  # Syntax: TrayIco <TaskIcon-name>,<Icon-path/name>[,<hint>]
  #         1st and 2nd parameters are required
  TrayIco TrayIcon,app.ico," Min2Tray Demo "
  goto evloop

Again, replace app.ico with the path and name of the icon you want to use. And replace " Min2Tray Demo " with the hint text you want to display when someone hovers the mouse over the tray icon. You'll need to change 'TrayIcon' if your dialog's taskicon name is something different. Note: This is the 'TrayIcon' which is the first parameter to the TrayIco command - not the TrayIco command name itself.


Then add the following near the end of your code (it only has to be after your evloop).
Code:
:TrayIco
  # TrayIco command - Restore Tray Icon if needed
  if %%shell_TrayWnd_ID
    # Grab the current System Tray Window ID
    %s = @winexists(#shell_TrayWnd)
    # Test to see if the SysTray's Window ID has changed
    if @both(@unequal(%s,%%shell_TrayWnd_ID),%s)
      # SysTray has restarted - remove and reload trayicon
      if @both(%1,%2)
        # We need both %1 and %2 for the 'dialog add'
        dialog remove,%1
        dialog add,taskicon,%1,%2,%3
        # Update variable with the SysTray's new Window ID
        %%shell_TrayWnd_ID = %s
      end
    end
  else
    # Grab the original System Tray Window ID
    %%shell_TrayWnd_ID = @winexists(#shell_TrayWnd)
  end
  exit

To test just use task manager to kill and restart Explorer.

_________________
cheers

Dave
Back to top
View user's profile Send private message Visit poster's website
andrewm
Newbie


Joined: 13 Jun 2007
Posts: 11

PostPosted: Fri Jun 15, 2007 12:19 pm    Post subject: Reply with quote

Thanks Dave!

I have added everything you listed, but it's not working right, it was minimizing, but it was minimizing to the taskbar and the tray and I couldn't maximize it from the tray.

I couldn't get the icon to display either, it was just blank...I think this is just a path issue as we run the app from a server.

I didn't test the explorer crash piece yet...the entire app is below:

Code:



option filename,long
option regbuf,20000
option decimalsep,.
%a = @sysinfo(pixperin)
option scale,%a
#define command,TrayIco
# Get current SysTray ID into %%shell_TrayWnd_ID
TrayIco

# MSGEVENTs to capture non-client mouse clicks
# Trap LEFT mouse button down
option msgevent,$000000A1,WM_NCLBUTTONDOWN
# Trap RIGHT mouse button down to capture sysmenu/Minimize
option msgevent,$000000A4,WM_NCRBUTTONDOWN
option scale,96


%%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,RESIZABLE
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 ADD,TASKICON,TrayIcon,%%configdir\cowan.ico," CIGL I.T. Helpdesk Ticket Monitor "
  DIALOG SHOW
 
  %%dlg0 = @winexists(%%title)
 
  %%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
  # Restore Tray Icon if needed
  # Syntax: TrayIco <TaskIcon-name>,<Icon-path/name>[,<hint>]
  #         1st and 2nd parameters are required
  TrayIco TrayIcon,app.ico," Min2Tray Demo "
  goto evloop
  goto loop1

:TrayIconCLICK
  # If Right-Click show popup menu
  if @equal(@click(B),right)
    rem You can add code for a right-click popup menu if desired - which would appear when the suer right-clicks on the tray icon.
  end
  # If Left-Click restore window
  if @equal(@click(B),left)
    dialog show
    window activate,%%dlg0
  end
  goto loop1
:close

:Resize
  goto loop1
 
exit

:TrayIco
  # TrayIco command - Restore Tray Icon if needed
  if %%shell_TrayWnd_ID
    # Grab the current System Tray Window ID
    %s = @winexists(#shell_TrayWnd)
    # Test to see if the SysTray's Window ID has changed
    if @both(@unequal(%s,%%shell_TrayWnd_ID),%s)
      # SysTray has restarted - remove and reload trayicon
      if @both(%1,%2)
        # We need both %1 and %2 for the 'dialog add'
        dialog remove,%1
        dialog add,taskicon,%1,%2,%3
        # Update variable with the SysTray's new Window ID
        %%shell_TrayWnd_ID = %s
      end
    end
  else
    # Grab the original System Tray Window ID
    %%shell_TrayWnd_ID = @winexists(#shell_TrayWnd)
  end
  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
DaveR
Valued Contributor
Valued Contributor


Joined: 03 Sep 2005
Posts: 413
Location: Australia

PostPosted: Fri Jun 15, 2007 3:25 pm    Post subject: Reply with quote

Hi Andrew,

There were a couple of small mistakes and one important bit you missed. I've fixed your code and it's now working fine here. I also tidied up the formatting a bit to make it easier for me to read. Wink
Code:

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

  #define command,TrayIco
  # Get current SysTray ID into %%shell_TrayWnd_ID
  TrayIco

  # MSGEVENTs to capture non-client mouse clicks
  # Trap LEFT mouse button down
  option msgevent,$000000A1,WM_NCLBUTTONDOWN
  # Trap RIGHT mouse button down to capture sysmenu/Minimize
  option msgevent,$000000A4,WM_NCRBUTTONDOWN


  %%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,RESIZABLE
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 ADD,TASKICON,TrayIcon,C:\temp\cowan.ico," CIGL I.T. Helpdesk Ticket Monitor "
  DIALOG SHOW
 
  %%dlg0 = @winexists(%%title)
 
  %%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 event,0.5
  %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
  # Restore Tray Icon if needed
  # Syntax: TrayIco <TaskIcon-name>,<Icon-path/name>[,<hint>]
  #         1st and 2nd parameters are required
  TrayIco TrayIcon,C:\temp\cowan.ico," CIGL I.T. Helpdesk Ticket Monitor "
  goto loop1


:TrayIconCLICK
  # If Right-Click show popup menu
  if @equal(@click(B),right)
    rem You can add code for a right-click popup menu if desired - which would appear when the suer right-clicks on the tray icon.
  end
  # If Left-Click restore window
  if @equal(@click(B),left)
    dialog show
    window activate,%%dlg0
  end
  goto loop1


 
:WM_NCRBUTTONDOWN
:WM_NCLBUTTONDOWN
  # Test if window status is 2 = iconized / hide taskbar button
  if @equal(@winpos(%%dlg0,S),2)
    dialog hide
  end
  goto loop1
 
 
:Resize
  goto loop1

 
:close
  exit


:TrayIco
  # TrayIco command - Restore Tray Icon if needed
  if %%shell_TrayWnd_ID
    # Grab the current System Tray Window ID
    %s = @winexists(#shell_TrayWnd)
    # Test to see if the SysTray's Window ID has changed
    if @both(@unequal(%s,%%shell_TrayWnd_ID),%s)
      # SysTray has restarted - remove and reload trayicon
      if @both(%1,%2)
        # We need both %1 and %2 for the 'dialog add'
        dialog remove,%1
        dialog add,taskicon,%1,%2,%3
        # Update variable with the SysTray's new Window ID
        %%shell_TrayWnd_ID = %s
      end
    end
  else
    # Grab the original System Tray Window ID
    %%shell_TrayWnd_ID = @winexists(#shell_TrayWnd)
  end
  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

The icon path can't be a variable, as it's added to the exe as a resource when the script is compiled (so it will be available for every user). In the code above I have used 'C:\temp\cowan.ico' as the icon's location. You'll need to change it to suit where it's located on the PC that is running the VDS IDE compiler.

Just open the project's *.dsp file in a text editor and copy the icon location (it's on the line 3rd line). Or with the project open in the IDE select 'Project Manager' from the view menu and copy the icon's path from there.

You'll need to change the icon's path in 2 places in the code above.

_________________
cheers

Dave
Back to top
View user's profile Send private message Visit poster's website
andrewm
Newbie


Joined: 13 Jun 2007
Posts: 11

PostPosted: Fri Jun 15, 2007 4:23 pm    Post subject: Reply with quote

Thank you sooo much Dave!!

It works like a charm...I just need to do this to the other app and I'm set.

Along the same line, I did a search of the forums but didn't see anything relating to this...The app you worked on for me, whenever it refreshes, it checks to see if there are any new tickets...would there be a way, if the user has it minimized for it to trigger a "new mail" type thing when a new file is found?

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


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

PostPosted: Fri Jun 15, 2007 8:44 pm    Post subject: Reply with quote

I don't have any codes handy or references handy, but I know I've seen several here do this. Maybe check the examples section of the main site here to see if there are any there.
_________________
'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
DaveR
Valued Contributor
Valued Contributor


Joined: 03 Sep 2005
Posts: 413
Location: Australia

PostPosted: Sat Jun 16, 2007 3:43 am    Post subject: Reply with quote

You can do what you want with Vic's balloon.DSU
http://www.vdsworld.com/download.php?id=356&sid=30cf6bd27a4409921df81b0600dd8ccb

Download and unzip balloon.dsu and put the balloon.dsu file in the same directory as your project's *.dsc and *.dsp files.

I've integrated the necessary code to use balloon.dsu into your script - but there is one more thing still left to do. Somewhere within either the 'process master' or 'generate master' blocks of code we need to add a conditional statement that calls the 'NewTicketFound' gosub if a new ticket is found. Your previous programmer was a bit light on including comments in his code, which makes it hard to figure just where to insert the necessary code.

Here's what I've got so far:
Code:

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

  #include balloon.dsu
  #define command, balloon
  balloon init
  # Extract glyph.bmp
  gosub ExtractBMP
  # Extract sound.wav
  gosub ExtractWAV

  #define command,TrayIco
  # Get current SysTray ID into %%shell_TrayWnd_ID
  TrayIco

  # MSGEVENTs to capture non-client mouse clicks
  # Trap LEFT mouse button down
  option msgevent,$000000A1,WM_NCLBUTTONDOWN
  # Trap RIGHT mouse button down to capture sysmenu/Minimize
  option msgevent,$000000A4,WM_NCRBUTTONDOWN


  %%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 ADD,TASKICON,TrayIcon,C:\temp\cowan.ico," CIGL I.T. Helpdesk Ticket Monitor "
  DIALOG SHOW
 
  %%dlg0 = @winexists(%%title)
 
  %%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 event,0.5
  %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
  # Restore Tray Icon if needed
  # Syntax: TrayIco <TaskIcon-name>,<Icon-path/name>[,<hint>]
  #         1st and 2nd parameters are required
  TrayIco TrayIcon,C:\temp\cowan.ico," CIGL I.T. Helpdesk Ticket Monitor "
  goto loop1


:TrayIconCLICK
  # If Right-Click show popup menu
  if @equal(@click(B),right)
    rem You can add code for a right-click popup menu if desired - which would appear when the suer right-clicks on the tray icon.
  end
  # If Left-Click restore window
  if @equal(@click(B),left)
    dialog show
    window activate,%%dlg0
  end
  goto loop1


:BalloonClick
  dialog show
  window activate,%%dlg0
  goto loop1

 
:NewTicketFound
  balloon CIGL I.T. Helpdesk Ticket Monitor, New Ticket Found, 100, 1, @windir(T)\glyph.bmp, @windir(T)\sound.wav, ,
  exit


:WM_NCRBUTTONDOWN
:WM_NCLBUTTONDOWN
  # Test if window status is 2 = iconized / hide taskbar button
  if @equal(@winpos(%%dlg0,S),2)
    dialog hide
  end
  goto loop1

 
:Close
  # This command will remove the balloon *.bmp files which were created in the temporary directory.
  balloon removefiles
  # Delete our bmp and wav files.
  file delete,@windir(T)\sound.wav
  file delete,@windir(T)\glyph.bmp
  exit


:TrayIco
  # TrayIco command - Restore Tray Icon if needed
  if %%shell_TrayWnd_ID
    # Grab the current System Tray Window ID
    %s = @winexists(#shell_TrayWnd)
    # Test to see if the SysTray's Window ID has changed
    if @both(@unequal(%s,%%shell_TrayWnd_ID),%s)
      # SysTray has restarted - remove and reload trayicon
      if @both(%1,%2)
        # We need both %1 and %2 for the 'dialog add'
        dialog remove,%1
        dialog add,taskicon,%1,%2,%3
        # Update variable with the SysTray's new Window ID
        %%shell_TrayWnd_ID = %s
      end
    end
  else
    # Grab the original System Tray Window ID
    %%shell_TrayWnd_ID = @winexists(#shell_TrayWnd)
  end
  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
   
   
:ExtractBMP
  # glyph.bmp
  %o =
  %o = %o"42 4D 36 03 00 00 00 00 00 00 36 00 00 00 28 00 00 00 10 00 00 00 10 00 00 00 01 00 18 00 00 00 00 "
  %o = %o"00 00 03 00 00 C4 0E 00 00 C4 0E 00 00 00 00 00 00 00 00 00 00 FF FF FF FF FF FF FF FF FF FF FF FF "
  %o = %o"FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF "
  %o = %o"FF FF FF FF FF FF 85 B6 D8 0F 6D AE 16 72 B1 1A 74 B1 1A 74 B0 18 76 B3 17 77 B3 13 7A B6 0D 7C BA "
  %o = %o"0A 7C BA 07 7A B8 02 79 BA 00 6E AF 7F AF CE FF FF FF FF FF FF 11 80 CB 1F 89 D0 2A 8F D2 2F 91 D2 "
  %o = %o"2E 92 D3 2C 94 D4 29 98 D5 24 9D D7 1C A1 DA 15 A2 DA 0D A1 D9 05 9B D9 01 8E D0 00 6C AE FF FF FF "
  %o = %o"FF FF FF 19 8A D5 2C 94 D9 37 99 DB 3D 9D DC 3C 9D DC 39 9F DD 34 A3 DE 2E A8 E0 24 AD E2 1C B0 E3 "
  %o = %o"13 B0 E3 0A AC E2 04 9B D9 02 76 B8 FF FF FF FF FF FF 22 8E D7 38 9A DB FF FF FF FF FF FF FF FF FF "
  %o = %o"FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF 0E B0 E3 08 A0 DA 05 7B BA FF FF FF FF FF FF "
  %o = %o"2C 94 D9 42 9E DD 4B A3 DE 4F A5 DF 4C A5 DF 46 A5 DF 40 A8 E0 37 AB E2 2C B0 E3 23 B1 E4 1A B1 E4 "
  %o = %o"14 AD E2 0F A1 DA 0B 7D BB FF FF FF FF FF FF 35 98 DA 4B A3 DE FF FF FF FF FF FF FF FF FF FF FF FF "
  %o = %o"FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF 19 AA E1 18 A0 D9 12 7F BB FF FF FF FF FF FF 3F 9D DC "
  %o = %o"53 A7 E0 56 A9 E0 55 A8 E0 50 A5 DF 48 A3 DF 40 A2 DE 36 A3 DF 2C A5 DF 23 A4 DF 1D A5 DF 1D A2 DE "
  %o = %o"1F 9C D8 18 7E B9 FF FF FF FF FF FF 45 A0 DE 5A AA E1 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF "
  %o = %o"FF FF FF FF FF FF FF FF FF FF FF FF 22 9B DC 25 98 D6 1D 7D B8 FF FF FF FF FF FF 4F A5 DF 63 AF E3 "
  %o = %o"61 AD E2 FB FD FE 8B C2 EA 48 A0 DD 3F 9C DC 36 9A DB 55 AC E2 FF FF FF 23 96 DA 26 96 DA 2A 94 D5 "
  %o = %o"21 7C B7 FF FF FF FF FF FF 53 A7 E0 6C B4 E5 68 B2 E4 5E AB E1 FF FF FF CB E4 F5 60 AD E2 A5 D1 EF "
  %o = %o"FF FF FF 2B 95 DA 29 95 D9 2B 96 DA 2D 93 D4 23 7C B7 FF FF FF FF FF FF 5E AC E2 7A BC E7 70 B6 E5 "
  %o = %o"63 AE E3 5A A9 E1 FF FF FF E7 F3 FB FF FF FF 38 98 DB 33 97 DA 30 96 DA 30 96 DA 2F 93 D4 23 7B B6 "
  %o = %o"FF FF FF FF FF FF 6B B4 E5 8D C5 EA 80 BF E8 6F B6 E5 67 B1 E3 60 AD E2 FF FF FF 53 A6 E0 4C A3 DF "
  %o = %o"49 A1 DE 41 9E DD 3A 9B DB 30 93 D4 1E 78 B5 FF FF FF FF FF FF 77 BA E7 9D CD EE 8C C5 EA 79 BB E7 "
  %o = %o"70 B6 E5 6A B2 E4 65 B0 E3 62 AE E2 5D AD E2 56 AA E0 4E A5 DF 41 9E DD 2F 92 D3 19 75 B3 FF FF FF "
  %o = %o"FF FF FF B2 D7 F1 76 B9 E6 67 B1 E4 5B AA E1 54 A7 E0 4F A5 DF 4A A2 DE 4B A3 DE 46 A1 DE 3F 9D DC "
  %o = %o"3B 9B DC 31 96 D9 23 8A CF 8A BA DA FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF "
  %o = %o"FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF "
  if @not(@file(@windir(T)\glyph.bmp))
    binfile open,1,@windir(T)\glyph.bmp,create
    binfile write,1,hex,%o
    binfile close,1
  end
  exit


:ExtractWAV
  # sound.wav
  %o =
  %o = %o"52 49 46 46 F8 18 00 00 57 41 56 45 66 6D 74 20 "
  %o = %o"10 00 00 00 01 00 01 00 22 56 00 00 44 AC 00 00 "
  %o = %o"02 00 10 00 64 61 74 61 D4 18 00 00 00 00 00 00 "
  %o = %o"00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 "
  %o = %o"00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 "
  %o = %o"00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 "
  %o = %o"00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 "
  %o = %o"00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 "
  %o = %o"00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 "
  %o = %o"00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 "
  %o = %o"00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 "
  %o = %o"00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 "
  %o = %o"00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 "
  %o = %o"00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 "
  %o = %o"00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 "
  %o = %o"00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 "
  %o = %o"00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 "
  %o = %o"00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 "
  %o = %o"00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 "
  %o = %o"00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 "
  %o = %o"00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 "
  %o = %o"00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 "
  %o = %o"00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 "
  %o = %o"00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 "
  %o = %o"00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 "
  %o = %o"00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 "
  %o = %o"00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 "
  %o = %o"00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 "
  %o = %o"00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 "
  %o = %o"00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 "
  %o = %o"00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 "
  %o = %o"00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 "
  %o = %o"00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 "
  %o = %o"00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 "
  %o = %o"00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 "
  %o = %o"00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 "
  %o = %o"00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 "
  %o = %o"00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 "
  %o = %o"00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 "
  %o = %o"00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 "
  %o = %o"00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 "
  %o = %o"00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 "
  %o = %o"00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 "
  %o = %o"00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 "
  %o = %o"00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 "
  %o = %o"00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 "
  %o = %o"00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 "
  %o = %o"00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 "
  %o = %o"00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 "
  %o = %o"00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 "
  %o = %o"00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 "
  %o = %o"00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 "
  %o = %o"00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 "
  %o = %o"00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 "
  %o = %o"00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 "
  %o = %o"00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 "
  %o = %o"00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 "
  %o = %o"00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 "
  %o = %o"00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 "
  %o = %o"00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 "
  %o = %o"00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 "
  %o = %o"00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 "
  %o = %o"00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 "
  %o = %o"00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 "
  %o = %o"00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 "
  %o = %o"00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 "
  %o = %o"00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 "
  %o = %o"00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 "
  %o = %o"00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 "
  %o = %o"00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 "
  %o = %o"00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 "
  %o = %o"00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 "
  %o = %o"00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 "
  %o = %o"00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 "
  %o = %o"00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 "
  %o = %o"00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 "
  %o = %o"00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 "
  %o = %o"00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 "
  %o = %o"00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 "
  %o = %o"00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 "
  %o = %o"00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 "
  %o = %o"00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 "
  %o = %o"00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 "
  %o = %o"00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 "
  %o = %o"00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 "
  %o = %o"00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 "
  %o = %o"00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 "
  %o = %o"00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 "
  %o = %o"00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 "
  %o = %o"00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 "
  %o = %o"00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 "
  %o = %o"00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 "
  %o = %o"00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 "
  %o = %o"00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 "
  %o = %o"00 00 00 00 00 00 00 00 00 00 00 00 00 00 FF FF "
  %o = %o"00 00 00 00 00 00 00 00 00 00 FF FF 00 00 00 00 "
  %o = %o"01 00 00 00 FF FF FF FF FF FF 00 00 01 00 FF FF "
  %o = %o"00 00 FF FF FF FF 03 00 01 00 FF FF FE FF 00 00 "
  %o = %o"00 00 01 00 01 00 FE FF FF FF FF FF 01 00 00 00 "
  %o = %o"FF FF FD FF FF FF 01 00 01 00 01 00 01 00 01 00 "
  %o = %o"FF FF FD FF 00 00 00 00 01 00 01 00 04 00 01 00 "
  %o = %o"FF FF FE FF FC FF FF FF 02 00 02 00 02 00 FF FF "
  %o = %o"FC FF 00 00 00 00 04 00 FE FF 00 00 02 00 FF FF "
  %o = %o"00 00 00 00 00 00 FE FF FF FF 00 00 FF FF 02 00 "
  %o = %o"05 00 01 00 FC FF FF FF 00 00 01 00 FE FF 03 00 "
  %o = %o"03 00 02 00 FF FF FD FF FD FF 01 00 00 00 FD FF "
  %o = %o"F7 FF 01 00 03 00 06 00 05 00 00 00 FB FF 05 00 "
  %o = %o"07 00 04 00 FF FF F9 FF 00 00 FB FF FF FF FA FF "
  %o = %o"03 00 0B 00 08 00 FC FF FE FF FA FF 07 00 07 00 "
  %o = %o"FC FF F8 FF F7 FF FE FF 0E 00 08 00 F6 FF FC FF "
  %o = %o"F9 FF 00 00 FD FF FE FF FE FF 0A 00 F7 FF F9 FF "
  %o = %o"00 00 07 00 00 00 03 00 FF FF 04 00 F6 FF 0C 00 "
  %o = %o"09 00 F8 FF 04 00 F8 FF F9 FF 0C 00 FD FF 01 00 "
  %o = %o"F6 FF FD FF FA FF FC FF 07 00 F7 FF F7 FF 03 00 "
  %o = %o"02 00 F2 FF 09 00 15 00 03 00 F7 FF 01 00 F9 FF "
  %o = %o"06 00 08 00 07 00 FD FF F8 FF 11 00 FB FF 08 00 "
  %o = %o"FF FF F9 FF F2 FF 03 00 FF FF F2 FF EE FF 09 00 "
  %o = %o"0A 00 F7 FF FC FF 09 00 FF FF 09 00 11 00 F7 FF "
  %o = %o"F5 FF 01 00 02 00 11 00 05 00 07 00 08 00 F6 FF "
  %o = %o"F9 FF E7 FF F6 FF 0B 00 FA FF F2 FF FA FF F2 FF "
  %o = %o"FB FF 20 00 08 00 FB FF FE FF 02 00 0E 00 03 00 "
  %o = %o"FE FF F0 FF F0 FF 00 00 FC FF 0F 00 0C 00 F6 FF "
  %o = %o"DE FF FF FF 15 00 10 00 08 00 F8 FF F2 FF F9 FF "
  %o = %o"01 00 0A 00 03 00 0B 00 FA FF F2 FF 08 00 FD FF "
  %o = %o"EF FF FB FF E1 FF 0F 00 0D 00 FD FF F5 FF FE FF "
  %o = %o"0A 00 13 00 31 00 22 00 F3 FF E8 FF 0C 00 FA FF "
  %o = %o"02 00 EC FF 0C 00 08 00 10 00 0A 00 EF FF C9 FF "
  %o = %o"C8 FF 00 00 13 00 00 00 11 00 E3 FF E9 FF 15 00 "
  %o = %o"12 00 1C 00 2C 00 FD FF F5 FF 08 00 0B 00 21 00 "
  %o = %o"1F 00 0A 00 F3 FF CF FF ED FF 03 00 15 00 06 00 "
  %o = %o"FC FF 0E 00 EC FF DB FF FC FF 09 00 0F 00 05 00 "
  %o = %o"11 00 28 00 E1 FF E2 FF EB FF F6 FF FF FF 28 00 "
  %o = %o"F5 FF E7 FF 19 00 F5 FF E7 FF 0E 00 24 00 28 00 "
  %o = %o"2B 00 CE FF F8 FF 18 00 0C 00 F2 FF F0 FF 08 00 "
  %o = %o"0E 00 0F 00 00 00 DA FF FD FF 16 00 22 00 F7 FF "
  %o = %o"B4 FF AB FF F8 FF 34 00 41 00 16 00 EA FF BF FF "
  %o = %o"11 00 19 00 EE FF 34 00 10 00 3E 00 F9 FF D6 FF "
  %o = %o"CA FF FF FF 27 00 13 00 12 00 D7 FF FC FF D4 FF "
  %o = %o"14 00 08 00 14 00 0E 00 DA FF 01 00 ED FF 28 00 "
  %o = %o"60 00 BE FF C3 FF F7 FF 02 00 2A 00 26 00 F8 FF "
  %o = %o"C3 FF 22 00 F7 FF 29 00 06 00 DD FF 40 00 04 00 "
  %o = %o"D5 FF F5 FF F5 FF F5 FF 2C 00 07 00 B6 FF 1A 00 "
  %o = %o"F1 FF 35 00 36 00 F5 FF E1 FF 0E 00 2A 00 2E 00 "
  %o = %o"CC FF E5 FF FA FF 44 00 24 00 01 00 F2 FF AC FF "
  %o = %o"C6 FF 0B 00 1A 00 01 00 F7 FF 0E 00 1B 00 0F 00 "
  %o = %o"1D 00 4C 00 0D 00 AD FF E5 FF F7 FF 05 00 3B 00 "
  %o = %o"DF FF 19 00 AA FF 26 00 3C 00 3B 00 13 00 02 00 "
  %o = %o"E9 FF 1E 00 11 00 A1 FF DB FF E9 FF 43 00 40 00 "
  %o = %o"B7 FF E2 FF 25 00 F1 FF 06 00 E6 FF 1C 00 19 00 "
  %o = %o"FF FF 36 00 1E 00 1A 00 B5 FF A2 FF C2 FF F8 FF "
  %o = %o"0B 00 61 00 4C 00 BF FF D5 FF E5 FF 54 00 86 00 "
  %o = %o"1F 00 E9 FF E5 FF 5E FF 2E 00 F1 FF 05 00 BA FF "
  %o = %o"E3 FF FA FF 1F 00 1E 00 13 00 34 00 41 00 4D 00 "
  %o = %o"F6 FF C7 FF 38 00 21 00 03 00 E5 FF 17 00 D9 FF "
  %o = %o"9A FF B8 FF 1B 00 15 00 16 00 A7 FF 9E FF 41 00 "
  %o = %o"41 00 EE FF C6 FF A5 FF 23 00 06 00 46 00 9C 00 "
  %o = %o"B6 FF 0A 00 EA FF BF FF FC FF 02 00 4C 00 DF FF "
  %o = %o"E8 FF 4B 00 FB FF 18 00 2D 00 E5 FF CE FF 1B 00 "
  %o = %o"14 00 2A 00 C5 FF B0 FF D3 FF F9 FF 1B 00 F9 FF "
  %o = %o"68 FF CA FF 6D 00 4F 00 4E 00 C8 FF BE FF 17 00 "
  %o = %o"FC FF 79 00 3F 00 EA FF 10 00 23 00 D2 FF E1 FF "
  %o = %o"33 00 ED FF E2 FF E1 FF EB FF 68 00 E1 FF 70 00 "
  %o = %o"72 FF D7 FF E8 FF 6E 00 41 00 B8 FF 64 FF CD FF "
  %o = %o"F6 FF 9C 00 5A 00 EA FF BE FF CE FF 03 00 32 00 "
  %o = %o"02 00 A7 FF E7 FF 05 00 BB 00 4D 00 4D 00 E1 FF "
  %o = %o"97 FF BA FF 77 00 23 00 2C 00 10 00 76 FF E2 FF "
  %o = %o"25 00 1E 00 26 00 C3 FF 30 00 DC FF D0 FF 32 00 "
  %o = %o"0F 00 08 00 87 FF 0F 00 1C 00 85 FF 17 00 D4 FF "
  %o = %o"F0 FF 1D 00 20 00 5B 00 1B 00 EA FF 2A 00 C4 FF "
  %o = %o"3D 00 F7 FF 1C 00 A6 FF 16 00 D7 FF E2 FF 6A FF "
  %o = %o"DF FF 29 00 7A 00 75 00 F2 FF F6 FF FC FF 09 00 "
  %o = %o"21 00 2C 00 A2 FF BB FF EE FF 08 00 F7 FF 9C FF "
  %o = %o"C9 FF EF FF DA FF 7C 00 23 00 51 00 11 00 B8 FF "
  %o = %o"25 00 19 00 FE FF 03 00 E4 FF C5 FF 09 00 0B 00 "
  %o = %o"6E 00 51 00 97 FF F9 FF 22 00 80 00 21 00 DA FF "
  %o = %o"7B FF 9E FF E3 FF 3C 00 30 00 48 00 C8 FF 8D 00 "
  %o = %o"4F 00 BE FF DA FF B4 FF AE FF 08 00 5B 00 94 00 "
  %o = %o"E1 FF 03 00 C8 FF 5B 00 0E 00 24 00 E1 FF BD FF "
  %o = %o"B6 FF E1 FF 1F 00 6F 00 EE FF F8 FF 6C 00 1B 00 "
  %o = %o"A9 FF FC FF 19 00 DA FF 09 00 CE FF 31 00 FC FF "
  %o = %o"A9 FF AB FF 1A 00 FF FF 58 00 27 00 57 00 26 00 "
  %o = %o"6B FF BE FF 0F 00 F4 FF 53 00 3A 00 F7 FF AD FF "
  %o = %o"9B FF 1C 00 43 00 1E 00 0B 00 D2 FF 27 00 DB FF "
  %o = %o"15 00 CB FF FC FF C9 FF A2 00 61 00 85 FF 6D FF "
  %o = %o"34 00 0A 00 67 00 5B 00 A0 FF AA FF FB FF 0C 00 "
  %o = %o"55 00 D4 FF 07 00 02 00 E6 FF E1 FF 3D 00 D6 FF "
  %o = %o"C8 FF D8 FF 2E 00 02 00 2C 00 EE FF D9 FF 04 00 "
  %o = %o"18 00 CD FF 2F 00 D2 FF DB FF FA FF 15 00 DE FF "
  %o = %o"D2 FF 48 00 5A 00 9E FF 25 00 E1 FF 07 00 03 00 "
  %o = %o"C9 FF 7B 00 E2 FF 13 00 FE FF B1 FF 13 00 24 00 "
  %o = %o"00 00 CA FF 07 00 42 00 C3 FF 83 00 E5 FF EB FF "
  %o = %o"9B FF F8 FF F4 FF B9 FF 37 00 9A FF E7 FF 4D 00 "
  %o = %o"43 00 0F 00 61 FF 5E 00 E9 FF 07 00 63 00 E2 FF "
  %o = %o"FE FF FC FF FD FF 35 00 C9 FF 54 00 E2 FF 35 FF "
  %o = %o"0D 00 18 00 5D 00 B2 FF 3C 00 57 00 93 FF 66 00 "
  %o = %o"1D 00 59 00 C3 FF 9A FF 2D FF 1D 00 52 00 65 00 "
  %o = %o"FA FF 11 FF CC FF 7A 00 15 00 C6 FF FA FF 07 00 "
  %o = %o"31 00 78 00 A1 00 F9 FF 82 FF 9A FF 8B 00 5D FF "
  %o = %o"3F 00 7D 00 C7 FF F8 FF 24 00 6F 00 E7 FF BA FF "
  %o = %o"A1 FF 16 00 F8 FF E9 FF B8 00 26 FF F8 FF D9 FF "
  %o = %o"53 00 36 00 70 FF 3B 00 79 00 7B 00 16 00 9D FF "
  %o = %o"83 FF E6 FF 7F 00 58 00 24 00 CA FF 79 FF 52 00 "
  %o = %o"3C 00 0C 00 99 FF 37 FF CD FF 2F 00 93 00 50 00 "
  %o = %o"B8 FF C7 FF A4 FF 0E 00 4C 00 52 00 B8 FF 60 FF "
  %o = %o"3A FF 2C 00 B0 00 4F 00 1E 00 B4 FF 59 FF FE FF "
  %o = %o"14 00 04 00 81 00 65 FF AB FF A1 00 0A 00 51 00 "
  %o = %o"B5 FF 65 FF FF FF 33 00 8D 00 27 00 6F FF 34 FF "
  %o = %o"10 00 71 00 96 00 32 00 CC FF C2 FF CF FF 7B FF "
  %o = %o"7C FF 80 00 03 00 99 00 0A 00 A4 FF 0A 00 48 FF "
  %o = %o"0F 00 FA 00 DC FF EC FF 26 00 C5 FF 0F 00 04 00 "
  %o = %o"38 00 B1 FF C7 FF DA FF A5 00 6E 00 E4 FF 69 FF "
  %o = %o"0E 00 E3 FF 09 00 DB FF C9 FF BC 00 25 00 5E FF "
  %o = %o"6C 00 9C FF 17 00 FE FF 8A FF 1C 00 E9 FF 17 00 "
  %o = %o"34 00 78 00 34 00 3E 00 17 00 89 FF 05 00 A5 FF "
  %o = %o"FA FF 3F 00 1C 00 49 00 5F FF A7 00 EE FF BE FF "
  %o = %o"F7 FF 9D FF C3 FF AC 00 C9 FF 1C 00 BC FF 3D 00 "
  %o = %o"E9 FF 07 00 FC 00 77 FF D4 FF E1 FF 38 00 4F FF "
  %o = %o"9A FF 5F 00 6B 00 3B 00 5E FF C0 FF 98 FF 2A 00 "
  %o = %o"BE 00 D3 FF 3B 00 FB FF C7 FF 53 00 94 FF E2 FF "
  %o = %o"92 FF D9 FF 4A 00 1D 00 EC FF 36 00 27 00 58 00 "
  %o = %o"FE FF 84 FF 3C 00 33 00 21 00 60 00 53 FF 26 00 "
  %o = %o"E8 FF A0 00 02 00 1E 00 20 00 89 FF EB FF 4F 00 "
  %o = %o"E0 FF F9 FF 4D 00 F8 FF 3E 00 D6 FF 2B 00 0D 00 "
  %o = %o"D0 FF D0 FF 23 00 D0 FF 2A 00 0E 00 54 00 01 00 "
  %o = %o"D2 FF 34 00 E8 FF BA FF 30 00 EF FF 03 00 E7 FF "
  %o = %o"96 00 92 FF 24 00 2D 00 EC FF 09 00 F6 FF 94 FF "
  %o = %o"0A 00 3A 00 19 00 FD FF D3 FF 03 00 06 00 20 00 "
  %o = %o"E0 FF B8 FF 10 00 11 00 59 00 3D 00 ED FF 10 00 "
  %o = %o"EC FF ED FF F1 FF 04 00 1F 00 08 00 E4 FF ED FF "
  %o = %o"18 00 02 00 D9 FF 06 00 DD FF 2C 00 2C 00 1A 00 "
  %o = %o"CD FF CD FF 0D 00 10 00 15 00 19 00 11 00 EC FF "
  %o = %o"E7 FF FD FF 17 00 18 00 CE FF 0E 00 10 00 3B 00 "
  %o = %o"13 00 EB FF EA FF F2 FF F2 FF F2 FF 0D 00 0F 00 "
  %o = %o"E2 FF 21 00 15 00 F7 FF FF FF EE FF F6 FF E1 FF "
  %o = %o"18 00 1A 00 F3 FF 07 00 F9 FF 03 00 0C 00 11 00 "
  %o = %o"FA FF FA FF F9 FF 0B 00 FC FF 05 00 FA FF 03 00 "
  %o = %o"0A 00 07 00 FA FF FE FF FB FF F6 FF 14 00 FE FF "
  %o = %o"EB FF FC FF FC FF EA FF D9 FF C4 FF A9 FF A8 FF "
  %o = %o"B9 FF AC FF A1 FF 9C FF 94 FF 79 FF 7E FF 88 FF "
  %o = %o"90 FF 88 FF 79 FF 64 FF 4B FF 49 FF 4D FF 5B FF "
  %o = %o"56 FF 4A FF 20 FF F4 FE D5 FE A5 FE 74 FE 54 FE "
  %o = %o"2E FE 03 FE DE FD EC FD F4 FD DE FD D5 FD AD FD "
  %o = %o"49 FD C8 FC CB FC 0E FD 8B FD 6E FE 8B FF EA 00 "
  %o = %o"76 02 59 04 40 06 03 08 48 09 36 0A B8 0A E0 0A "
  %o = %o"E7 0A A1 0A CC 09 52 08 49 06 D6 03 3B 01 B1 FE "
  %o = %o"3A FC EF F9 A6 F7 75 F5 AD F3 A4 F2 64 F2 CC F2 "
  %o = %o"E4 F3 5B F5 27 F7 52 F9 11 FC 18 FF 58 02 92 05 "
  %o = %o"6D 08 A7 0A 39 0C 6B 0D 37 0E 60 0E AB 0D 0A 0C "
  %o = %o"96 09 AB 06 8E 03 6E 00 3E FD 03 FA EF F6 39 F4 "
  %o = %o"1D F2 DC F0 8C F0 16 F1 3C F2 DF F3 1B F6 F4 F8 "
  %o = %o"62 FC 1B 00 D5 03 32 07 02 0A 4B 0C 12 0E 3E 0F "
  %o = %o"9E 0F 15 0F 81 0D 02 0B F3 07 A8 04 3C 01 B3 FD "
  %o = %o"21 FA C4 F6 DB F3 C0 F1 92 F0 53 F0 E3 F0 2B F2 "
  %o = %o"1C F4 A0 F6 CF F9 91 FD 8C 01 69 05 B7 08 5B 0B "
  %o = %o"61 0D C5 0E 68 0F 0E 0F 9F 0D 34 0B 15 08 A0 04 "
  %o = %o"14 01 7C FD F5 F9 B5 F6 F4 F3 05 F2 16 F1 25 F1 "
  %o = %o"12 F2 B6 F3 FB F5 D4 F8 30 FC E4 FF 9C 03 FE 06 "
  %o = %o"CA 09 ED 0B 58 0D 0E 0E F7 0D F7 0C 0B 0B 65 08 "
  %o = %o"48 05 FC 01 AD FE 80 FB 93 F8 13 F6 36 F4 35 F3 "
  %o = %o"1F F3 D7 F3 3C F5 42 F7 BA F9 98 FC B8 FF E9 02 "
  %o = %o"D6 05 51 08 2B 0A 60 0B E4 0B B6 0B C7 0A 12 09 "
  %o = %o"BC 06 F2 03 FF 00 0A FE 4A FB A6 F8 60 F6 EE F4 "
  %o = %o"37 F4 E4 F3 A7 F4 FC F5 BC F7 2F FA B8 FC 95 FF "
  %o = %o"7D 02 16 05 79 07 1E 09 50 0A EC 0A B0 0A 0C 0A "
  %o = %o"7C 08 8E 06 26 04 7B 01 08 FF 6B FC 12 FA 33 F8 "
  %o = %o"9E F6 D9 F5 8D F5 F6 F5 08 F7 75 F8 73 FA B1 FC "
  %o = %o"1C FF 9D 01 ED 03 12 06 AC 07 C3 08 66 09 6C 09 "
  %o = %o"EA 08 C9 07 3B 06 29 04 EA 01 AE FF 7D FD 6A FB "
  %o = %o"AD F9 43 F8 84 F7 27 F7 71 F7 46 F8 8E F9 24 FB "
  %o = %o"15 FD 25 FF 51 01 4F 03 26 05 94 06 9D 07 24 08 "
  %o = %o"36 08 C1 07 CF 06 6F 05 C3 03 D8 01 DC FF E8 FD "
  %o = %o"19 FC 7D FA 3C F9 70 F8 20 F8 50 F8 E6 F8 F2 F9 "
  %o = %o"55 FB 02 FD D6 FE BB 00 8B 02 2E 04 88 05 92 06 "
  %o = %o"30 07 61 07 16 07 5E 06 34 05 C5 03 1E 02 64 00 "
  %o = %o"9C FE F2 FC 79 FB 51 FA 81 F9 21 F9 2E F9 A5 F9 "
  %o = %o"74 FA A3 FB 13 FD BB FE 6E 00 1E 02 A7 03 F8 04 "
  %o = %o"FC 05 AD 06 F4 06 D4 06 42 06 55 05 14 04 9D 02 "
  %o = %o"FB 00 53 FF AD FD 28 FC DD FA E5 F9 43 F9 06 F9 "
  %o = %o"2E F9 B4 F9 92 FA B9 FB 20 FD AB FE 44 00 CD 01 "
  %o = %o"3B 03 7A 04 73 05 1E 06 6C 06 53 06 E7 05 22 05 "
  %o = %o"1C 04 DE 02 7B 01 04 00 96 FE 45 FD 28 FC 4E FB "
  %o = %o"BF FA 7B FA 8E FA F4 FA A8 FB A2 FC CD FD 13 FF "
  %o = %o"68 00 AD 01 DC 02 E0 03 B0 04 37 05 70 05 55 05 "
  %o = %o"EE 04 41 04 5D 03 4E 02 24 01 E9 FF B3 FE 9C FD "
  %o = %o"AD FC EE FB 72 FB 3B FB 48 FB 99 FB 29 FC EC FC "
  %o = %o"D9 FD DE FE F5 FF 07 01 08 02 E8 02 9E 03 19 04 "
  %o = %o"5B 04 60 04 29 04 BC 03 1A 03 4F 02 65 01 6F 00 "
  %o = %o"7C FF 9A FE D2 FD 32 FD B6 FC 72 FC 64 FC 90 FC "
  %o = %o"F4 FC 84 FD 33 FE F7 FE CD FF A9 00 7F 01 44 02 "
  %o = %o"E3 02 58 03 A1 03 B9 03 A9 03 70 03 09 03 7E 02 "
  %o = %o"D4 01 1A 01 5F 00 A8 FF 02 FF 6B FE EE FD 91 FD "
  %o = %o"59 FD 46 FD 5D FD 97 FD ED FD 58 FE D9 FE 64 FF "
  %o = %o"F4 FF 7E 00 02 01 70 01 CD 01 10 02 3C 02 50 02 "
  %o = %o"48 02 22 02 E8 01 9F 01 44 01 E3 00 7D 00 17 00 "
  %o = %o"B6 FF 64 FF 1E FF EA FE C3 FE B2 FE B1 FE C6 FE "
  %o = %o"E5 FE 18 FF 46 FF 70 FF CE FF 24 00 83 00 DF 00 "
  %o = %o"31 01 79 01 AF 01 D9 01 F5 01 01 02 02 02 ED 01 "
  %o = %o"C8 01 95 01 54 01 14 01 CD 00 83 00 30 00 E1 FF "
  %o = %o"92 FF 53 FF 1C FF F5 FE DC FE D0 FE D4 FE EA FE "
  %o = %o"12 FF 4E FF 96 FF E5 FF 37 00 8E 00 E2 00 34 01 "
  %o = %o"7A 01 B2 01 D8 01 E6 01 E4 01 CA 01 A4 01 6C 01 "
  %o = %o"24 01 D0 00 71 00 10 00 B7 FF 61 FF 17 FF D8 FE "
  %o = %o"A8 FE 89 FE 84 FE 96 FE BF FE FA FE 43 FF 99 FF "
  %o = %o"F6 FF 57 00 C0 00 20 01 76 01 BF 01 F9 01 1F 02 "
  %o = %o"33 02 2F 02 16 02 E7 01 A2 01 50 01 F0 00 8B 00 "
  %o = %o"25 00 C0 FF 60 FF 0A FF C6 FE 93 FE 74 FE 6A FE "
  %o = %o"75 FE 95 FE C6 FE 0B FF 5D FF BE FF 1F 00 85 00 "
  %o = %o"E7 00 3F 01 90 01 CE 01 FA 01 0F 02 0C 02 F4 01 "
  %o = %o"C7 01 88 01 3A 01 DD 00 77 00 0E 00 AA FF 48 FF "
  %o = %o"F3 FE AA FE 75 FE 54 FE 4A FE 5B FE 83 FE C1 FE "
  %o = %o"11 FF 6E FF D7 FF 43 00 B4 00 1D 01 77 01 C6 01 "
  %o = %o"FD 01 26 02 34 02 2E 02 0F 02 D9 01 90 01 38 01 "
  %o = %o"D4 00 6C 00 02 00 9A FF 3B FF EA FE AB FE 80 FE "
  %o = %o"6D FE 71 FE 88 FE B8 FE FA FE 4D FF AE FF 12 00 "
  %o = %o"77 00 D5 00 2C 01 78 01 B2 01 D9 01 E8 01 DE 01 "
  %o = %o"BD 01 86 01 3E 01 E8 00 87 00 23 00 BD FF 5B FF "
  %o = %o"02 FF BB FE 8A FE 6C FE 62 FE 6E FE 8F FE C5 FE "
  %o = %o"0E FF 66 FF C8 FF 2D 00 91 00 F0 00 47 01 90 01 "
  %o = %o"C9 01 ED 01 F9 01 EB 01 C8 01 93 01 50 01 01 01 "
  %o = %o"A6 00 47 00 E5 FF 87 FF 35 FF F2 FE BF FE 9E FE "
  %o = %o"8E FE 90 FE A6 FE CF FE 0C FF 53 FF A1 FF F2 FF "
  %o = %o"43 00 92 00 DC 00 1B 01 4A 01 6A 01 75 01 6F 01 "
  %o = %o"5B 01 38 01 06 01 C8 00 82 00 39 00 ED FF A6 FF "
  %o = %o"66 FF 2C FF FF FE E2 FE D2 FE D6 FE E9 FE 0E FF "
  %o = %o"3D FF 76 FF B7 FF FD FF 45 00 8D 00 CF 00 07 01 "
  %o = %o"33 01 51 01 5E 01 5E 01 4A 01 28 01 F9 00 BF 00 "
  %o = %o"7B 00 33 00 EB FF A7 FF 67 FF 30 FF 07 FF EB FE "
  %o = %o"DE FE E2 FE F5 FE 17 FF 48 FF 83 FF C1 FF 02 00 "
  %o = %o"44 00 83 00 BD 00 EA 00 0E 01 22 01 26 01 1B 01 "
  %o = %o"03 01 DF 00 AE 00 73 00 33 00 EF FF AF FF 74 FF "
  %o = %o"43 FF 1B FF FE FE EE FE EE FE FD FE 1B FF 42 FF "
  %o = %o"73 FF A9 FF DE FF 16 00 4D 00 7E 00 AA 00 C8 00 "
  %o = %o"DC 00 E1 00 DD 00 CD 00 B3 00 90 00 65 00 37 00 "
  %o = %o"0A 00 DC FF B4 FF 90 FF 72 FF 59 FF 4A FF 46 FF "
  %o = %o"4A FF 57 FF 6E FF 89 FF AA FF CE FF F5 FF 1C 00 "
  %o = %o"42 00 65 00 84 00 9B 00 AB 00 B3 00 B3 00 A8 00 "
  %o = %o"95 00 7A 00 59 00 33 00 0A 00 E3 FF BA FF 94 FF "
  %o = %o"75 FF 5A FF 49 FF 3E FF 3D FF 44 FF 56 FF 6E FF "
  %o = %o"8E FF B2 FF D9 FF FE FF 24 00 49 00 6A 00 85 00 "
  %o = %o"97 00 A0 00 9F 00 97 00 86 00 6C 00 4F 00 27 00 "
  %o = %o"FE FF D6 FF A9 FF 84 FF 5F FF 41 FF 2B FF 1E FF "
  %o = %o"1A FF 22 FF 33 FF 4F FF 6F FF 98 FF C4 FF F2 FF "
  %o = %o"20 00 4E 00 78 00 9C 00 B6 00 C8 00 D0 00 CD 00 "
  %o = %o"BF 00 A8 00 88 00 62 00 35 00 08 00 D8 FF A9 FF "
  %o = %o"7F FF 5A FF 3D FF 28 FF 1C FF 1A FF 21 FF 32 FF "
  %o = %o"4B FF 6A FF 8F FF B7 FF DD FF 00 00 23 00 41 00 "
  %o = %o"5D 00 6F 00 7A 00 7C 00 76 00 67 00 55 00 3F 00 "
  %o = %o"25 00 08 00 EC FF CD FF B1 FF 99 FF 87 FF 7A FF "
  %o = %o"6E FF 66 FF 66 FF 69 FF 72 FF 80 FF 92 FF A4 FF "
  %o = %o"B6 FF CA FF DC FF EF FF 04 00 16 00 23 00 2C 00 "
  %o = %o"34 00 3B 00 3F 00 42 00 40 00 3A 00 31 00 24 00 "
  %o = %o"17 00 0A 00 FA FF E8 FF D4 FF BE FF A9 FF 98 FF "
  %o = %o"88 FF 7E FF 72 FF 6C FF 67 FF 69 FF 6F FF 7E FF "
  %o = %o"8E FF A2 FF B7 FF CE FF E5 FF FD FF 16 00 2A 00 "
  %o = %o"3B 00 45 00 48 00 49 00 42 00 36 00 26 00 0E 00 "
  %o = %o"F5 FF D7 FF B9 FF 9E FF 87 FF 72 FF 62 FF 58 FF "
  %o = %o"56 FF 59 FF 66 FF 79 FF 90 FF AA FF C8 FF E7 FF "
  %o = %o"04 00 21 00 3C 00 4F 00 5B 00 5F 00 5B 00 50 00 "
  %o = %o"3C 00 21 00 01 00 DE FF B9 FF 93 FF 71 FF 53 FF "
  %o = %o"3B FF 2B FF 25 FF 27 FF 32 FF 49 FF 67 FF 8B FF "
  %o = %o"B4 FF E0 FF 0B 00 34 00 58 00 77 00 8D 00 9A 00 "
  %o = %o"9D 00 94 00 7F 00 63 00 40 00 17 00 EA FF BA FF "
  %o = %o"8C FF 60 FF 3E FF 21 FF 10 FF 08 FF 0B FF 18 FF "
  %o = %o"31 FF 55 FF 7D FF AE FF DD FF 0A 00 34 00 5B 00 "
  %o = %o"7C 00 95 00 A2 00 A3 00 99 00 84 00 68 00 47 00 "
  %o = %o"1D 00 F3 FF C3 FF 95 FF 6B FF 4A FF 31 FF 20 FF "
  %o = %o"17 FF 16 FF 20 FF 34 FF 50 FF 75 FF 9B FF C2 FF "
  %o = %o"EA FF 0C 00 2F 00 50 00 66 00 74 00 78 00 72 00 "
  %o = %o"64 00 50 00 37 00 17 00 F4 FF CE FF A8 FF 86 FF "
  %o = %o"6A FF 55 FF 47 FF 40 FF 40 FF 4A FF 5B FF 74 FF "
  %o = %o"93 FF B6 FF D7 FF FA FF 1A 00 38 00 52 00 65 00 "
  %o = %o"70 00 71 00 6B 00 60 00 4F 00 38 00 1B 00 00 00 "
  %o = %o"E2 FF C1 FF A6 FF 8F FF 7B FF 6E FF 66 FF 64 FF "
  %o = %o"6A FF 76 FF 88 FF 9D FF B6 FF CF FF E7 FF FE FF "
  %o = %o"14 00 26 00 32 00 3B 00 3D 00 37 00 2D 00 21 00 "
  %o = %o"11 00 FD FF E8 FF D4 FF BF FF AE FF A0 FF 98 FF "
  %o = %o"94 FF 94 FF 99 FF A1 FF AC FF B9 FF C9 FF D9 FF "
  %o = %o"E9 FF F7 FF 01 00 0D 00 13 00 16 00 16 00 14 00 "
  %o = %o"0E 00 05 00 FA FF EF FF E5 FF D7 FF CD FF C4 FF "
  %o = %o"BD FF B9 FF B7 FF B7 FF BB FF C0 FF C7 FF D1 FF "
  %o = %o"DA FF E4 FF ED FF F4 FF FC FF FF FF 02 00 03 00 "
  %o = %o"03 00 FF FF FB FF F4 FF EF FF EA FF E4 FF DF FF "
  %o = %o"D9 FF D2 FF D0 FF D0 FF D2 FF D2 FF D5 FF D8 FF "
  %o = %o"DB FF E1 FF E7 FF ED FF F1 FF F2 FF F2 FF F1 FF "
  %o = %o"F0 FF EE FF EB FF E5 FF E0 FF D9 FF D5 FF D3 FF "
  %o = %o"D1 FF D0 FF D1 FF D3 FF D7 FF DD FF E5 FF EE FF "
  %o = %o"F7 FF FD FF 03 00 06 00 0B 00 0F 00 10 00 0F 00 "
  %o = %o"08 00 02 00 FC FF F1 FF E8 FF DB FF D1 FF C6 FF "
  %o = %o"BC FF B6 FF B3 FF B3 FF B7 FF BD FF C5 FF D0 FF "
  %o = %o"DE FF EC FF FB FF 08 00 15 00 1F 00 27 00 2D 00 "
  %o = %o"2E 00 2D 00 27 00 1C 00 10 00 01 00 F1 FF E1 FF "
  %o = %o"D0 FF C1 FF B3 FF A8 FF A3 FF A2 FF A5 FF AB FF "
  %o = %o"B7 FF C4 FF D3 FF E7 FF F9 FF 0B 00 1B 00 2A 00 "
  %o = %o"34 00 3C 00 40 00 3E 00 38 00 2D 00 1F 00 0C 00 "
  %o = %o"FC FF E9 FF D6 FF C4 FF B3 FF A6 FF 9D FF 9A FF "
  %o = %o"9C FF A2 FF AD FF BC FF CF FF E2 FF F7 FF 0C 00 "
  %o = %o"1F 00 2F 00 3E 00 48 00 4E 00 4D 00 49 00 3F 00 "
  %o = %o"31 00 1E 00 0B 00 F6 FF E1 FF CD FF BB FF AA FF "
  %o = %o"9F FF 95 FF 94 FF 95 FF 9D FF A8 FF B8 FF CA FF "
  %o = %o"DF FF F2 FF 08 00 18 00 2B 00 37 00 43 00 43 00 "
  if @not(@file(@windir(T)\sound.wav))
    binfile open,1,@windir(T)\sound.wav,create
    binfile write,1,hex,%o
    binfile close,1
  end
  exit

PS I've removed the 'resizable' style because it wasn't needed, and actually screwed up your app's window if the user resized it. Embarassed

_________________
cheers

Dave
Back to top
View user's profile Send private message Visit poster's website
andrewm
Newbie


Joined: 13 Jun 2007
Posts: 11

PostPosted: Sun Jun 17, 2007 12:11 am    Post subject: Reply with quote

Hi Dave,

From what I know, the master is a text file that is just an index of the tickets. When the monitor app refreshes (either progress bar hits the end or user clicks refresh) it deletes the index file and recreates it and adds any new tickets.

So I would think process master would be the right one?

I really really appreciate your help with this...once this is done the app will be really useful for our dept.!

~Andrew
Back to top
View user's profile Send private message
DaveR
Valued Contributor
Valued Contributor


Joined: 03 Sep 2005
Posts: 413
Location: Australia

PostPosted: Sun Jun 17, 2007 2:25 pm    Post subject: Reply with quote

Hi Andrew,

I've played around a bit more with your code. I neatened up the dialog and the code a bit. And added some more comments, a right-click context menu for the tray icon with hide/show/exit options and an 'about' info box, & made the window positionable.

For the version info in the about box you need to set the project's version info under "View > Project Manager > Version Info".

Note: That while the popup balloon works reasonably well, it does prevent other events from being processed while the balloon is open. So if the user presses a button, or selects something from the right-click menu, it won't be processed until after the balloon has closed. And sometimes events get lost while the balloon is open requiring the user to press the button again after the balloon has closed.

You can press the balloon's X button to close the balloon sooner. And if you click on the balloon's "New Ticket Found' text (which is a link) the main window will be activated if it was minimised.

I think I've got the 'New Ticket Found' code working correctly.

PS you need balloon.DSU as mentioned in my previous post.

Code:
#-----------------------------------------------------------------------------#
# Program:    CIGL I.T. Helpdesk Ticket Monitor                               #
# Filename:   Helpdesk Ticket Monitor.dsc                                     #
# Author:                                                                     #
# Copyright:  2007, Campbell Systems                                          #
#-----------------------------------------------------------------------------#

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

  #include balloon.dsu
  #define command,balloon
  balloon init
  # Extract balloon glyph.bmp
  gosub ExtractBMP
  # Extract balloon sound.wav
  gosub ExtractWAV

  #define command,TrayIco
  # Get current SysTray ID into %%shell_TrayWnd_ID
  TrayIco

  # MSGEVENTs to capture non-client mouse clicks
  # Trap LEFT mouse button down
  option msgevent,$000000A1,WM_NCLBUTTONDOWN
  # Trap RIGHT mouse button down to capture sysmenu/Minimize
  option msgevent,$000000A4,WM_NCRBUTTONDOWN

  # For right-click tray icon menu
  external vdspopup.dll,DEMO
  #define command,popup


  %%title = CIGL I.T. Helpdesk Ticket Monitor - Campbell Systems
  title %%title
  %%popuptitle = CIGL I.T. Helpdesk Ticket Monitor
  gosub get user

  %%path = @path(%0)
  %%activedir = %%path"active"
  %%closeddir = %%path"closed"
  %%configdir = %%path"config"


:create dialog
  DIALOG CREATE,%%title,5,5,550,178,savepos,ontop
  DIALOG ADD,TAB,TAB1,1,1,553,140,Assigned to me|Unassigned
  DIALOG ADD,TASKICON,TrayIcon,C:\temp\cowan.ico," CIGL I.T. Helpdesk Ticket Monitor "
  DIALOG ADD,BUTTON,Refresh,2,437,58,18,Refresh
  DIALOG ADD,BUTTON,About,2,498,49,18,About
  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,PROGRESS,ProgressBar,143,5,540,12,0
  DIALOG ADD,STATUS,StatusBar,"  "Ready - Displaying workload assigned to %%user
  DIALOG SHOW
 
  %%dlg0 = @winexists(%%title)
 
  %%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,statusbar,"  "Generating Master Worklist
    gosub generate master
  end

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

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


#------------------------------------------------------------------------------
# Events
   
:Close
:ExitMENU
  # This command will remove the balloon *.bmp files which were created in the temporary directory.
  balloon removefiles
  # Delete our bmp and wav files.
  file delete,@windir(T)\sound.wav
  file delete,@windir(T)\glyph.bmp
  exit


:TIMER
  dialog select,0
  # Increment progressbar 1% each 0.5 seconds
  %%refresh = @succ(%%refresh)
  dialog set,progressbar,%%refresh
  if @equal(%%refresh,100)
    # Generate & process master list when progressbar reaches 100%
    gosub generate master
    gosub process master
    %%refresh = 0
  end
  # Restore Tray Icon if needed (if explorer has crashed)
  # Syntax: TrayIco <TaskIcon-name>,<Icon-path/name>[,<hint>]
  #         1st and 2nd parameters are required
  TrayIco TrayIcon,C:\temp\cowan.ico," CIGL I.T. Helpdesk Ticket Monitor "
  if %%new
    # Show 'new ticket' balloon
    goto NewTicketFound
  end
  goto loop1


:TrayIconCLICK
  # If Right-Click show popup menu
  if @equal(@click(B),right)
    if @winexists(%%dlg0)
      %w = @strdel(@winexists(%%dlg0),1,)
      loadlib User32.dll
      if @lib(user32,IsWindowVisible,BOOL:,%w)
        # POPUP <menu items>,<x position>,<y position>,<styles>
        popup %%popuptitle;;;;;;1|-|Hide|Exit|About,SMOOTH
      else
        popup %%popuptitle;;;;;;1|-|Show|Exit|About,SMOOTH
      end
      freelib User32.dll
    end
  end
  # If Left-Click restore window
  if @equal(@click(B),left)
    dialog show
    window activate,%%dlg0
  end
  goto loop1


:ShowMENU
:BalloonClick
  # Activate and show window
  dialog show
  window activate,%%dlg0
  goto loop1


:HideMENU
  # Minimize to tray
  dialog hide
  goto loop1
 

:AboutMENU
:AboutBUTTON
  # Show 'about' info
  title About Helpdesk Ticket Monitor
  info %%popuptitle"    "@cr()@cr()"            "Version @verinfo(%0,V)@cr()@cr()Copyright Cambell Systems
  title %%title
  goto loop1

 
:NewTicketFound
  # Show 'new ticket' balloon
  balloon CIGL I.T. Helpdesk Ticket Monitor, New Ticket Found, 100, 1, @windir(T)\glyph.bmp, @windir(T)\sound.wav, ,
  goto loop1


:WM_NCRBUTTONDOWN
:WM_NCLBUTTONDOWN
  # Test if window status is 2 = iconized / hide taskbar button
  if @equal(@winpos(%%dlg0,S),2)
    dialog hide
  end
  goto loop1


:RefreshBUTTON
  # Refresh master list
  %%refresh = 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
  # Show tickets assigned to me
  %%tab = 1
  list clear,lst1
  list assign,lst1,lst7
  goto loop1


:UnassignedCLICK
  # Show unassigned tickets
  %%tab = 2
  list clear,lst1
  list assign,lst1,lstUNASSIGNED
  goto loop1


#------------------------------------------------------------------------------
# Gosubs
   
:Generate Master
  list clear,lstX
  list clear,lstY
  list filelist,lstX,%%activedir\*.txt
  %%count = @count(lstX)

  # Check if any new tickets 
  if @not(%%oldcount)
    if %%count
      %%oldcount = %%count
    else
      %%oldcount = 0
    end
  else
    if @greater(%%count,%%oldcount)
      %%oldcount = %%count
      %%new = 1
    else
      %%new =
    end
  end
 
  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
  # Get user's login name
  %%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

   
#------------------------------------------------------------------------------
# User Commands
   
:TrayIco
  # TrayIco command - Restore Tray Icon if needed
  if %%shell_TrayWnd_ID
    # Grab the current System Tray Window ID
    %s = @winexists(#shell_TrayWnd)
    # Test to see if the SysTray's Window ID has changed
    if @both(@unequal(%s,%%shell_TrayWnd_ID),%s)
      # SysTray has restarted - remove and reload trayicon
      if @both(%1,%2)
        # We need both %1 and %2 for the 'dialog add'
        dialog remove,%1
        dialog add,taskicon,%1,%2,%3
        # Update variable with the SysTray's new Window ID
        %%shell_TrayWnd_ID = %s
      end
    end
  else
    # Grab the original System Tray Window ID
    %%shell_TrayWnd_ID = @winexists(#shell_TrayWnd)
  end
  exit


#------------------------------------------------------------------------------
# Embedded Resources
   
:ExtractBMP
  # glyph.bmp
  %o =
  %o = %o"42 4D 36 03 00 00 00 00 00 00 36 00 00 00 28 00 00 00 10 00 00 00 10 00 00 00 01 00 18 00 00 00 00 "
  %o = %o"00 00 03 00 00 C4 0E 00 00 C4 0E 00 00 00 00 00 00 00 00 00 00 FF FF FF FF FF FF FF FF FF FF FF FF "
  %o = %o"FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF "
  %o = %o"FF FF FF FF FF FF 85 B6 D8 0F 6D AE 16 72 B1 1A 74 B1 1A 74 B0 18 76 B3 17 77 B3 13 7A B6 0D 7C BA "
  %o = %o"0A 7C BA 07 7A B8 02 79 BA 00 6E AF 7F AF CE FF FF FF FF FF FF 11 80 CB 1F 89 D0 2A 8F D2 2F 91 D2 "
  %o = %o"2E 92 D3 2C 94 D4 29 98 D5 24 9D D7 1C A1 DA 15 A2 DA 0D A1 D9 05 9B D9 01 8E D0 00 6C AE FF FF FF "
  %o = %o"FF FF FF 19 8A D5 2C 94 D9 37 99 DB 3D 9D DC 3C 9D DC 39 9F DD 34 A3 DE 2E A8 E0 24 AD E2 1C B0 E3 "
  %o = %o"13 B0 E3 0A AC E2 04 9B D9 02 76 B8 FF FF FF FF FF FF 22 8E D7 38 9A DB FF FF FF FF FF FF FF FF FF "
  %o = %o"FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF 0E B0 E3 08 A0 DA 05 7B BA FF FF FF FF FF FF "
  %o = %o"2C 94 D9 42 9E DD 4B A3 DE 4F A5 DF 4C A5 DF 46 A5 DF 40 A8 E0 37 AB E2 2C B0 E3 23 B1 E4 1A B1 E4 "
  %o = %o"14 AD E2 0F A1 DA 0B 7D BB FF FF FF FF FF FF 35 98 DA 4B A3 DE FF FF FF FF FF FF FF FF FF FF FF FF "
  %o = %o"FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF 19 AA E1 18 A0 D9 12 7F BB FF FF FF FF FF FF 3F 9D DC "
  %o = %o"53 A7 E0 56 A9 E0 55 A8 E0 50 A5 DF 48 A3 DF 40 A2 DE 36 A3 DF 2C A5 DF 23 A4 DF 1D A5 DF 1D A2 DE "
  %o = %o"1F 9C D8 18 7E B9 FF FF FF FF FF FF 45 A0 DE 5A AA E1 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF "
  %o = %o"FF FF FF FF FF FF FF FF FF FF FF FF 22 9B DC 25 98 D6 1D 7D B8 FF FF FF FF FF FF 4F A5 DF 63 AF E3 "
  %o = %o"61 AD E2 FB FD FE 8B C2 EA 48 A0 DD 3F 9C DC 36 9A DB 55 AC E2 FF FF FF 23 96 DA 26 96 DA 2A 94 D5 "
  %o = %o"21 7C B7 FF FF FF FF FF FF 53 A7 E0 6C B4 E5 68 B2 E4 5E AB E1 FF FF FF CB E4 F5 60 AD E2 A5 D1 EF "
  %o = %o"FF FF FF 2B 95 DA 29 95 D9 2B 96 DA 2D 93 D4 23 7C B7 FF FF FF FF FF FF 5E AC E2 7A BC E7 70 B6 E5 "
  %o = %o"63 AE E3 5A A9 E1 FF FF FF E7 F3 FB FF FF FF 38 98 DB 33 97 DA 30 96 DA 30 96 DA 2F 93 D4 23 7B B6 "
  %o = %o"FF FF FF FF FF FF 6B B4 E5 8D C5 EA 80 BF E8 6F B6 E5 67 B1 E3 60 AD E2 FF FF FF 53 A6 E0 4C A3 DF "
  %o = %o"49 A1 DE 41 9E DD 3A 9B DB 30 93 D4 1E 78 B5 FF FF FF FF FF FF 77 BA E7 9D CD EE 8C C5 EA 79 BB E7 "
  %o = %o"70 B6 E5 6A B2 E4 65 B0 E3 62 AE E2 5D AD E2 56 AA E0 4E A5 DF 41 9E DD 2F 92 D3 19 75 B3 FF FF FF "
  %o = %o"FF FF FF B2 D7 F1 76 B9 E6 67 B1 E4 5B AA E1 54 A7 E0 4F A5 DF 4A A2 DE 4B A3 DE 46 A1 DE 3F 9D DC "
  %o = %o"3B 9B DC 31 96 D9 23 8A CF 8A BA DA FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF "
  %o = %o"FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF "
  if @not(@file(@windir(T)\glyph.bmp))
    binfile open,1,@windir(T)\glyph.bmp,create
    binfile write,1,hex,%o
    binfile close,1
  end
  exit


:ExtractWAV
  # sound.wav
  %o =
  %o = %o"52 49 46 46 F8 18 00 00 57 41 56 45 66 6D 74 20 "
  %o = %o"10 00 00 00 01 00 01 00 22 56 00 00 44 AC 00 00 "
  %o = %o"02 00 10 00 64 61 74 61 D4 18 00 00 00 00 00 00 "
  %o = %o"00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 "
  %o = %o"00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 "
  %o = %o"00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 "
  %o = %o"00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 "
  %o = %o"00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 "
  %o = %o"00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 "
  %o = %o"00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 "
  %o = %o"00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 "
  %o = %o"00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 "
  %o = %o"00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 "
  %o = %o"00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 "
  %o = %o"00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 "
  %o = %o"00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 "
  %o = %o"00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 "
  %o = %o"00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 "
  %o = %o"00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 "
  %o = %o"00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 "
  %o = %o"00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 "
  %o = %o"00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 "
  %o = %o"00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 "
  %o = %o"00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 "
  %o = %o"00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 "
  %o = %o"00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 "
  %o = %o"00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 "
  %o = %o"00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 "
  %o = %o"00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 "
  %o = %o"00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 "
  %o = %o"00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 "
  %o = %o"00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 "
  %o = %o"00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 "
  %o = %o"00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 "
  %o = %o"00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 "
  %o = %o"00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 "
  %o = %o"00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 "
  %o = %o"00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 "
  %o = %o"00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 "
  %o = %o"00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 "
  %o = %o"00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 "
  %o = %o"00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 "
  %o = %o"00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 "
  %o = %o"00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 "
  %o = %o"00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 "
  %o = %o"00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 "
  %o = %o"00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 "
  %o = %o"00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 "
  %o = %o"00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 "
  %o = %o"00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 "
  %o = %o"00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 "
  %o = %o"00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 "
  %o = %o"00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 "
  %o = %o"00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 "
  %o = %o"00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 "
  %o = %o"00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 "
  %o = %o"00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 "
  %o = %o"00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 "
  %o = %o"00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 "
  %o = %o"00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 "
  %o = %o"00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 "
  %o = %o"00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 "
  %o = %o"00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 "
  %o = %o"00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 "
  %o = %o"00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 "
  %o = %o"00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 "
  %o = %o"00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 "
  %o = %o"00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 "
  %o = %o"00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 "
  %o = %o"00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 "
  %o = %o"00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 "
  %o = %o"00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 "
  %o = %o"00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 "
  %o = %o"00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 "
  %o = %o"00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 "
  %o = %o"00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 "
  %o = %o"00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 "
  %o = %o"00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 "
  %o = %o"00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 "
  %o = %o"00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 "
  %o = %o"00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 "
  %o = %o"00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 "
  %o = %o"00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 "
  %o = %o"00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 "
  %o = %o"00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 "
  %o = %o"00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 "
  %o = %o"00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 "
  %o = %o"00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 "
  %o = %o"00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 "
  %o = %o"00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 "
  %o = %o"00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 "
  %o = %o"00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 "
  %o = %o"00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 "
  %o = %o"00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 "
  %o = %o"00 00 00 00 00 00 00 00 00 00 00 00 00 00 FF FF "
  %o = %o"00 00 00 00 00 00 00 00 00 00 FF FF 00 00 00 00 "
  %o = %o"01 00 00 00 FF FF FF FF FF FF 00 00 01 00 FF FF "
  %o = %o"00 00 FF FF FF FF 03 00 01 00 FF FF FE FF 00 00 "
  %o = %o"00 00 01 00 01 00 FE FF FF FF FF FF 01 00 00 00 "
  %o = %o"FF FF FD FF FF FF 01 00 01 00 01 00 01 00 01 00 "
  %o = %o"FF FF FD FF 00 00 00 00 01 00 01 00 04 00 01 00 "
  %o = %o"FF FF FE FF FC FF FF FF 02 00 02 00 02 00 FF FF "
  %o = %o"FC FF 00 00 00 00 04 00 FE FF 00 00 02 00 FF FF "
  %o = %o"00 00 00 00 00 00 FE FF FF FF 00 00 FF FF 02 00 "
  %o = %o"05 00 01 00 FC FF FF FF 00 00 01 00 FE FF 03 00 "
  %o = %o"03 00 02 00 FF FF FD FF FD FF 01 00 00 00 FD FF "
  %o = %o"F7 FF 01 00 03 00 06 00 05 00 00 00 FB FF 05 00 "
  %o = %o"07 00 04 00 FF FF F9 FF 00 00 FB FF FF FF FA FF "
  %o = %o"03 00 0B 00 08 00 FC FF FE FF FA FF 07 00 07 00 "
  %o = %o"FC FF F8 FF F7 FF FE FF 0E 00 08 00 F6 FF FC FF "
  %o = %o"F9 FF 00 00 FD FF FE FF FE FF 0A 00 F7 FF F9 FF "
  %o = %o"00 00 07 00 00 00 03 00 FF FF 04 00 F6 FF 0C 00 "
  %o = %o"09 00 F8 FF 04 00 F8 FF F9 FF 0C 00 FD FF 01 00 "
  %o = %o"F6 FF FD FF FA FF FC FF 07 00 F7 FF F7 FF 03 00 "
  %o = %o"02 00 F2 FF 09 00 15 00 03 00 F7 FF 01 00 F9 FF "
  %o = %o"06 00 08 00 07 00 FD FF F8 FF 11 00 FB FF 08 00 "
  %o = %o"FF FF F9 FF F2 FF 03 00 FF FF F2 FF EE FF 09 00 "
  %o = %o"0A 00 F7 FF FC FF 09 00 FF FF 09 00 11 00 F7 FF "
  %o = %o"F5 FF 01 00 02 00 11 00 05 00 07 00 08 00 F6 FF "
  %o = %o"F9 FF E7 FF F6 FF 0B 00 FA FF F2 FF FA FF F2 FF "
  %o = %o"FB FF 20 00 08 00 FB FF FE FF 02 00 0E 00 03 00 "
  %o = %o"FE FF F0 FF F0 FF 00 00 FC FF 0F 00 0C 00 F6 FF "
  %o = %o"DE FF FF FF 15 00 10 00 08 00 F8 FF F2 FF F9 FF "
  %o = %o"01 00 0A 00 03 00 0B 00 FA FF F2 FF 08 00 FD FF "
  %o = %o"EF FF FB FF E1 FF 0F 00 0D 00 FD FF F5 FF FE FF "
  %o = %o"0A 00 13 00 31 00 22 00 F3 FF E8 FF 0C 00 FA FF "
  %o = %o"02 00 EC FF 0C 00 08 00 10 00 0A 00 EF FF C9 FF "
  %o = %o"C8 FF 00 00 13 00 00 00 11 00 E3 FF E9 FF 15 00 "
  %o = %o"12 00 1C 00 2C 00 FD FF F5 FF 08 00 0B 00 21 00 "
  %o = %o"1F 00 0A 00 F3 FF CF FF ED FF 03 00 15 00 06 00 "
  %o = %o"FC FF 0E 00 EC FF DB FF FC FF 09 00 0F 00 05 00 "
  %o = %o"11 00 28 00 E1 FF E2 FF EB FF F6 FF FF FF 28 00 "
  %o = %o"F5 FF E7 FF 19 00 F5 FF E7 FF 0E 00 24 00 28 00 "
  %o = %o"2B 00 CE FF F8 FF 18 00 0C 00 F2 FF F0 FF 08 00 "
  %o = %o"0E 00 0F 00 00 00 DA FF FD FF 16 00 22 00 F7 FF "
  %o = %o"B4 FF AB FF F8 FF 34 00 41 00 16 00 EA FF BF FF "
  %o = %o"11 00 19 00 EE FF 34 00 10 00 3E 00 F9 FF D6 FF "
  %o = %o"CA FF FF FF 27 00 13 00 12 00 D7 FF FC FF D4 FF "
  %o = %o"14 00 08 00 14 00 0E 00 DA FF 01 00 ED FF 28 00 "
  %o = %o"60 00 BE FF C3 FF F7 FF 02 00 2A 00 26 00 F8 FF "
  %o = %o"C3 FF 22 00 F7 FF 29 00 06 00 DD FF 40 00 04 00 "
  %o = %o"D5 FF F5 FF F5 FF F5 FF 2C 00 07 00 B6 FF 1A 00 "
  %o = %o"F1 FF 35 00 36 00 F5 FF E1 FF 0E 00 2A 00 2E 00 "
  %o = %o"CC FF E5 FF FA FF 44 00 24 00 01 00 F2 FF AC FF "
  %o = %o"C6 FF 0B 00 1A 00 01 00 F7 FF 0E 00 1B 00 0F 00 "
  %o = %o"1D 00 4C 00 0D 00 AD FF E5 FF F7 FF 05 00 3B 00 "
  %o = %o"DF FF 19 00 AA FF 26 00 3C 00 3B 00 13 00 02 00 "
  %o = %o"E9 FF 1E 00 11 00 A1 FF DB FF E9 FF 43 00 40 00 "
  %o = %o"B7 FF E2 FF 25 00 F1 FF 06 00 E6 FF 1C 00 19 00 "
  %o = %o"FF FF 36 00 1E 00 1A 00 B5 FF A2 FF C2 FF F8 FF "
  %o = %o"0B 00 61 00 4C 00 BF FF D5 FF E5 FF 54 00 86 00 "
  %o = %o"1F 00 E9 FF E5 FF 5E FF 2E 00 F1 FF 05 00 BA FF "
  %o = %o"E3 FF FA FF 1F 00 1E 00 13 00 34 00 41 00 4D 00 "
  %o = %o"F6 FF C7 FF 38 00 21 00 03 00 E5 FF 17 00 D9 FF "
  %o = %o"9A FF B8 FF 1B 00 15 00 16 00 A7 FF 9E FF 41 00 "
  %o = %o"41 00 EE FF C6 FF A5 FF 23 00 06 00 46 00 9C 00 "
  %o = %o"B6 FF 0A 00 EA FF BF FF FC FF 02 00 4C 00 DF FF "
  %o = %o"E8 FF 4B 00 FB FF 18 00 2D 00 E5 FF CE FF 1B 00 "
  %o = %o"14 00 2A 00 C5 FF B0 FF D3 FF F9 FF 1B 00 F9 FF "
  %o = %o"68 FF CA FF 6D 00 4F 00 4E 00 C8 FF BE FF 17 00 "
  %o = %o"FC FF 79 00 3F 00 EA FF 10 00 23 00 D2 FF E1 FF "
  %o = %o"33 00 ED FF E2 FF E1 FF EB FF 68 00 E1 FF 70 00 "
  %o = %o"72 FF D7 FF E8 FF 6E 00 41 00 B8 FF 64 FF CD FF "
  %o = %o"F6 FF 9C 00 5A 00 EA FF BE FF CE FF 03 00 32 00 "
  %o = %o"02 00 A7 FF E7 FF 05 00 BB 00 4D 00 4D 00 E1 FF "
  %o = %o"97 FF BA FF 77 00 23 00 2C 00 10 00 76 FF E2 FF "
  %o = %o"25 00 1E 00 26 00 C3 FF 30 00 DC FF D0 FF 32 00 "
  %o = %o"0F 00 08 00 87 FF 0F 00 1C 00 85 FF 17 00 D4 FF "
  %o = %o"F0 FF 1D 00 20 00 5B 00 1B 00 EA FF 2A 00 C4 FF "
  %o = %o"3D 00 F7 FF 1C 00 A6 FF 16 00 D7 FF E2 FF 6A FF "
  %o = %o"DF FF 29 00 7A 00 75 00 F2 FF F6 FF FC FF 09 00 "
  %o = %o"21 00 2C 00 A2 FF BB FF EE FF 08 00 F7 FF 9C FF "
  %o = %o"C9 FF EF FF DA FF 7C 00 23 00 51 00 11 00 B8 FF "
  %o = %o"25 00 19 00 FE FF 03 00 E4 FF C5 FF 09 00 0B 00 "
  %o = %o"6E 00 51 00 97 FF F9 FF 22 00 80 00 21 00 DA FF "
  %o = %o"7B FF 9E FF E3 FF 3C 00 30 00 48 00 C8 FF 8D 00 "
  %o = %o"4F 00 BE FF DA FF B4 FF AE FF 08 00 5B 00 94 00 "
  %o = %o"E1 FF 03 00 C8 FF 5B 00 0E 00 24 00 E1 FF BD FF "
  %o = %o"B6 FF E1 FF 1F 00 6F 00 EE FF F8 FF 6C 00 1B 00 "
  %o = %o"A9 FF FC FF 19 00 DA FF 09 00 CE FF 31 00 FC FF "
  %o = %o"A9 FF AB FF 1A 00 FF FF 58 00 27 00 57 00 26 00 "
  %o = %o"6B FF BE FF 0F 00 F4 FF 53 00 3A 00 F7 FF AD FF "
  %o = %o"9B FF 1C 00 43 00 1E 00 0B 00 D2 FF 27 00 DB FF "
  %o = %o"15 00 CB FF FC FF C9 FF A2 00 61 00 85 FF 6D FF "
  %o = %o"34 00 0A 00 67 00 5B 00 A0 FF AA FF FB FF 0C 00 "
  %o = %o"55 00 D4 FF 07 00 02 00 E6 FF E1 FF 3D 00 D6 FF "
  %o = %o"C8 FF D8 FF 2E 00 02 00 2C 00 EE FF D9 FF 04 00 "
  %o = %o"18 00 CD FF 2F 00 D2 FF DB FF FA FF 15 00 DE FF "
  %o = %o"D2 FF 48 00 5A 00 9E FF 25 00 E1 FF 07 00 03 00 "
  %o = %o"C9 FF 7B 00 E2 FF 13 00 FE FF B1 FF 13 00 24 00 "
  %o = %o"00 00 CA FF 07 00 42 00 C3 FF 83 00 E5 FF EB FF "
  %o = %o"9B FF F8 FF F4 FF B9 FF 37 00 9A FF E7 FF 4D 00 "
  %o = %o"43 00 0F 00 61 FF 5E 00 E9 FF 07 00 63 00 E2 FF "
  %o = %o"FE FF FC FF FD FF 35 00 C9 FF 54 00 E2 FF 35 FF "
  %o = %o"0D 00 18 00 5D 00 B2 FF 3C 00 57 00 93 FF 66 00 "
  %o = %o"1D 00 59 00 C3 FF 9A FF 2D FF 1D 00 52 00 65 00 "
  %o = %o"FA FF 11 FF CC FF 7A 00 15 00 C6 FF FA FF 07 00 "
  %o = %o"31 00 78 00 A1 00 F9 FF 82 FF 9A FF 8B 00 5D FF "
  %o = %o"3F 00 7D 00 C7 FF F8 FF 24 00 6F 00 E7 FF BA FF "
  %o = %o"A1 FF 16 00 F8 FF E9 FF B8 00 26 FF F8 FF D9 FF "
  %o = %o"53 00 36 00 70 FF 3B 00 79 00 7B 00 16 00 9D FF "
  %o = %o"83 FF E6 FF 7F 00 58 00 24 00 CA FF 79 FF 52 00 "
  %o = %o"3C 00 0C 00 99 FF 37 FF CD FF 2F 00 93 00 50 00 "
  %o = %o"B8 FF C7 FF A4 FF 0E 00 4C 00 52 00 B8 FF 60 FF "
  %o = %o"3A FF 2C 00 B0 00 4F 00 1E 00 B4 FF 59 FF FE FF "
  %o = %o"14 00 04 00 81 00 65 FF AB FF A1 00 0A 00 51 00 "
  %o = %o"B5 FF 65 FF FF FF 33 00 8D 00 27 00 6F FF 34 FF "
  %o = %o"10 00 71 00 96 00 32 00 CC FF C2 FF CF FF 7B FF "
  %o = %o"7C FF 80 00 03 00 99 00 0A 00 A4 FF 0A 00 48 FF "
  %o = %o"0F 00 FA 00 DC FF EC FF 26 00 C5 FF 0F 00 04 00 "
  %o = %o"38 00 B1 FF C7 FF DA FF A5 00 6E 00 E4 FF 69 FF "
  %o = %o"0E 00 E3 FF 09 00 DB FF C9 FF BC 00 25 00 5E FF "
  %o = %o"6C 00 9C FF 17 00 FE FF 8A FF 1C 00 E9 FF 17 00 "
  %o = %o"34 00 78 00 34 00 3E 00 17 00 89 FF 05 00 A5 FF "
  %o = %o"FA FF 3F 00 1C 00 49 00 5F FF A7 00 EE FF BE FF "
  %o = %o"F7 FF 9D FF C3 FF AC 00 C9 FF 1C 00 BC FF 3D 00 "
  %o = %o"E9 FF 07 00 FC 00 77 FF D4 FF E1 FF 38 00 4F FF "
  %o = %o"9A FF 5F 00 6B 00 3B 00 5E FF C0 FF 98 FF 2A 00 "
  %o = %o"BE 00 D3 FF 3B 00 FB FF C7 FF 53 00 94 FF E2 FF "
  %o = %o"92 FF D9 FF 4A 00 1D 00 EC FF 36 00 27 00 58 00 "
  %o = %o"FE FF 84 FF 3C 00 33 00 21 00 60 00 53 FF 26 00 "
  %o = %o"E8 FF A0 00 02 00 1E 00 20 00 89 FF EB FF 4F 00 "
  %o = %o"E0 FF F9 FF 4D 00 F8 FF 3E 00 D6 FF 2B 00 0D 00 "
  %o = %o"D0 FF D0 FF 23 00 D0 FF 2A 00 0E 00 54 00 01 00 "
  %o = %o"D2 FF 34 00 E8 FF BA FF 30 00 EF FF 03 00 E7 FF "
  %o = %o"96 00 92 FF 24 00 2D 00 EC FF 09 00 F6 FF 94 FF "
  %o = %o"0A 00 3A 00 19 00 FD FF D3 FF 03 00 06 00 20 00 "
  %o = %o"E0 FF B8 FF 10 00 11 00 59 00 3D 00 ED FF 10 00 "
  %o = %o"EC FF ED FF F1 FF 04 00 1F 00 08 00 E4 FF ED FF "
  %o = %o"18 00 02 00 D9 FF 06 00 DD FF 2C 00 2C 00 1A 00 "
  %o = %o"CD FF CD FF 0D 00 10 00 15 00 19 00 11 00 EC FF "
  %o = %o"E7 FF FD FF 17 00 18 00 CE FF 0E 00 10 00 3B 00 "
  %o = %o"13 00 EB FF EA FF F2 FF F2 FF F2 FF 0D 00 0F 00 "
  %o = %o"E2 FF 21 00 15 00 F7 FF FF FF EE FF F6 FF E1 FF "
  %o = %o"18 00 1A 00 F3 FF 07 00 F9 FF 03 00 0C 00 11 00 "
  %o = %o"FA FF FA FF F9 FF 0B 00 FC FF 05 00 FA FF 03 00 "
  %o = %o"0A 00 07 00 FA FF FE FF FB FF F6 FF 14 00 FE FF "
  %o = %o"EB FF FC FF FC FF EA FF D9 FF C4 FF A9 FF A8 FF "
  %o = %o"B9 FF AC FF A1 FF 9C FF 94 FF 79 FF 7E FF 88 FF "
  %o = %o"90 FF 88 FF 79 FF 64 FF 4B FF 49 FF 4D FF 5B FF "
  %o = %o"56 FF 4A FF 20 FF F4 FE D5 FE A5 FE 74 FE 54 FE "
  %o = %o"2E FE 03 FE DE FD EC FD F4 FD DE FD D5 FD AD FD "
  %o = %o"49 FD C8 FC CB FC 0E FD 8B FD 6E FE 8B FF EA 00 "
  %o = %o"76 02 59 04 40 06 03 08 48 09 36 0A B8 0A E0 0A "
  %o = %o"E7 0A A1 0A CC 09 52 08 49 06 D6 03 3B 01 B1 FE "
  %o = %o"3A FC EF F9 A6 F7 75 F5 AD F3 A4 F2 64 F2 CC F2 "
  %o = %o"E4 F3 5B F5 27 F7 52 F9 11 FC 18 FF 58 02 92 05 "
  %o = %o"6D 08 A7 0A 39 0C 6B 0D 37 0E 60 0E AB 0D 0A 0C "
  %o = %o"96 09 AB 06 8E 03 6E 00 3E FD 03 FA EF F6 39 F4 "
  %o = %o"1D F2 DC F0 8C F0 16 F1 3C F2 DF F3 1B F6 F4 F8 "
  %o = %o"62 FC 1B 00 D5 03 32 07 02 0A 4B 0C 12 0E 3E 0F "
  %o = %o"9E 0F 15 0F 81 0D 02 0B F3 07 A8 04 3C 01 B3 FD "
  %o = %o"21 FA C4 F6 DB F3 C0 F1 92 F0 53 F0 E3 F0 2B F2 "
  %o = %o"1C F4 A0 F6 CF F9 91 FD 8C 01 69 05 B7 08 5B 0B "
  %o = %o"61 0D C5 0E 68 0F 0E 0F 9F 0D 34 0B 15 08 A0 04 "
  %o = %o"14 01 7C FD F5 F9 B5 F6 F4 F3 05 F2 16 F1 25 F1 "
  %o = %o"12 F2 B6 F3 FB F5 D4 F8 30 FC E4 FF 9C 03 FE 06 "
  %o = %o"CA 09 ED 0B 58 0D 0E 0E F7 0D F7 0C 0B 0B 65 08 "
  %o = %o"48 05 FC 01 AD FE 80 FB 93 F8 13 F6 36 F4 35 F3 "
  %o = %o"1F F3 D7 F3 3C F5 42 F7 BA F9 98 FC B8 FF E9 02 "
  %o = %o"D6 05 51 08 2B 0A 60 0B E4 0B B6 0B C7 0A 12 09 "
  %o = %o"BC 06 F2 03 FF 00 0A FE 4A FB A6 F8 60 F6 EE F4 "
  %o = %o"37 F4 E4 F3 A7 F4 FC F5 BC F7 2F FA B8 FC 95 FF "
  %o = %o"7D 02 16 05 79 07 1E 09 50 0A EC 0A B0 0A 0C 0A "
  %o = %o"7C 08 8E 06 26 04 7B 01 08 FF 6B FC 12 FA 33 F8 "
  %o = %o"9E F6 D9 F5 8D F5 F6 F5 08 F7 75 F8 73 FA B1 FC "
  %o = %o"1C FF 9D 01 ED 03 12 06 AC 07 C3 08 66 09 6C 09 "
  %o = %o"EA 08 C9 07 3B 06 29 04 EA 01 AE FF 7D FD 6A FB "
  %o = %o"AD F9 43 F8 84 F7 27 F7 71 F7 46 F8 8E F9 24 FB "
  %o = %o"15 FD 25 FF 51 01 4F 03 26 05 94 06 9D 07 24 08 "
  %o = %o"36 08 C1 07 CF 06 6F 05 C3 03 D8 01 DC FF E8 FD "
  %o = %o"19 FC 7D FA 3C F9 70 F8 20 F8 50 F8 E6 F8 F2 F9 "
  %o = %o"55 FB 02 FD D6 FE BB 00 8B 02 2E 04 88 05 92 06 "
  %o = %o"30 07 61 07 16 07 5E 06 34 05 C5 03 1E 02 64 00 "
  %o = %o"9C FE F2 FC 79 FB 51 FA 81 F9 21 F9 2E F9 A5 F9 "
  %o = %o"74 FA A3 FB 13 FD BB FE 6E 00 1E 02 A7 03 F8 04 "
  %o = %o"FC 05 AD 06 F4 06 D4 06 42 06 55 05 14 04 9D 02 "
  %o = %o"FB 00 53 FF AD FD 28 FC DD FA E5 F9 43 F9 06 F9 "
  %o = %o"2E F9 B4 F9 92 FA B9 FB 20 FD AB FE 44 00 CD 01 "
  %o = %o"3B 03 7A 04 73 05 1E 06 6C 06 53 06 E7 05 22 05 "
  %o = %o"1C 04 DE 02 7B 01 04 00 96 FE 45 FD 28 FC 4E FB "
  %o = %o"BF FA 7B FA 8E FA F4 FA A8 FB A2 FC CD FD 13 FF "
  %o = %o"68 00 AD 01 DC 02 E0 03 B0 04 37 05 70 05 55 05 "
  %o = %o"EE 04 41 04 5D 03 4E 02 24 01 E9 FF B3 FE 9C FD "
  %o = %o"AD FC EE FB 72 FB 3B FB 48 FB 99 FB 29 FC EC FC "
  %o = %o"D9 FD DE FE F5 FF 07 01 08 02 E8 02 9E 03 19 04 "
  %o = %o"5B 04 60 04 29 04 BC 03 1A 03 4F 02 65 01 6F 00 "
  %o = %o"7C FF 9A FE D2 FD 32 FD B6 FC 72 FC 64 FC 90 FC "
  %o = %o"F4 FC 84 FD 33 FE F7 FE CD FF A9 00 7F 01 44 02 "
  %o = %o"E3 02 58 03 A1 03 B9 03 A9 03 70 03 09 03 7E 02 "
  %o = %o"D4 01 1A 01 5F 00 A8 FF 02 FF 6B FE EE FD 91 FD "
  %o = %o"59 FD 46 FD 5D FD 97 FD ED FD 58 FE D9 FE 64 FF "
  %o = %o"F4 FF 7E 00 02 01 70 01 CD 01 10 02 3C 02 50 02 "
  %o = %o"48 02 22 02 E8 01 9F 01 44 01 E3 00 7D 00 17 00 "
  %o = %o"B6 FF 64 FF 1E FF EA FE C3 FE B2 FE B1 FE C6 FE "
  %o = %o"E5 FE 18 FF 46 FF 70 FF CE FF 24 00 83 00 DF 00 "
  %o = %o"31 01 79 01 AF 01 D9 01 F5 01 01 02 02 02 ED 01 "
  %o = %o"C8 01 95 01 54 01 14 01 CD 00 83 00 30 00 E1 FF "
  %o = %o"92 FF 53 FF 1C FF F5 FE DC FE D0 FE D4 FE EA FE "
  %o = %o"12 FF 4E FF 96 FF E5 FF 37 00 8E 00 E2 00 34 01 "
  %o = %o"7A 01 B2 01 D8 01 E6 01 E4 01 CA 01 A4 01 6C 01 "
  %o = %o"24 01 D0 00 71 00 10 00 B7 FF 61 FF 17 FF D8 FE "
  %o = %o"A8 FE 89 FE 84 FE 96 FE BF FE FA FE 43 FF 99 FF "
  %o = %o"F6 FF 57 00 C0 00 20 01 76 01 BF 01 F9 01 1F 02 "
  %o = %o"33 02 2F 02 16 02 E7 01 A2 01 50 01 F0 00 8B 00 "
  %o = %o"25 00 C0 FF 60 FF 0A FF C6 FE 93 FE 74 FE 6A FE "
  %o = %o"75 FE 95 FE C6 FE 0B FF 5D FF BE FF 1F 00 85 00 "
  %o = %o"E7 00 3F 01 90 01 CE 01 FA 01 0F 02 0C 02 F4 01 "
  %o = %o"C7 01 88 01 3A 01 DD 00 77 00 0E 00 AA FF 48 FF "
  %o = %o"F3 FE AA FE 75 FE 54 FE 4A FE 5B FE 83 FE C1 FE "
  %o = %o"11 FF 6E FF D7 FF 43 00 B4 00 1D 01 77 01 C6 01 "
  %o = %o"FD 01 26 02 34 02 2E 02 0F 02 D9 01 90 01 38 01 "
  %o = %o"D4 00 6C 00 02 00 9A FF 3B FF EA FE AB FE 80 FE "
  %o = %o"6D FE 71 FE 88 FE B8 FE FA FE 4D FF AE FF 12 00 "
  %o = %o"77 00 D5 00 2C 01 78 01 B2 01 D9 01 E8 01 DE 01 "
  %o = %o"BD 01 86 01 3E 01 E8 00 87 00 23 00 BD FF 5B FF "
  %o = %o"02 FF BB FE 8A FE 6C FE 62 FE 6E FE 8F FE C5 FE "
  %o = %o"0E FF 66 FF C8 FF 2D 00 91 00 F0 00 47 01 90 01 "
  %o = %o"C9 01 ED 01 F9 01 EB 01 C8 01 93 01 50 01 01 01 "
  %o = %o"A6 00 47 00 E5 FF 87 FF 35 FF F2 FE BF FE 9E FE "
  %o = %o"8E FE 90 FE A6 FE CF FE 0C FF 53 FF A1 FF F2 FF "
  %o = %o"43 00 92 00 DC 00 1B 01 4A 01 6A 01 75 01 6F 01 "
  %o = %o"5B 01 38 01 06 01 C8 00 82 00 39 00 ED FF A6 FF "
  %o = %o"66 FF 2C FF FF FE E2 FE D2 FE D6 FE E9 FE 0E FF "
  %o = %o"3D FF 76 FF B7 FF FD FF 45 00 8D 00 CF 00 07 01 "
  %o = %o"33 01 51 01 5E 01 5E 01 4A 01 28 01 F9 00 BF 00 "
  %o = %o"7B 00 33 00 EB FF A7 FF 67 FF 30 FF 07 FF EB FE "
  %o = %o"DE FE E2 FE F5 FE 17 FF 48 FF 83 FF C1 FF 02 00 "
  %o = %o"44 00 83 00 BD 00 EA 00 0E 01 22 01 26 01 1B 01 "
  %o = %o"03 01 DF 00 AE 00 73 00 33 00 EF FF AF FF 74 FF "
  %o = %o"43 FF 1B FF FE FE EE FE EE FE FD FE 1B FF 42 FF "
  %o = %o"73 FF A9 FF DE FF 16 00 4D 00 7E 00 AA 00 C8 00 "
  %o = %o"DC 00 E1 00 DD 00 CD 00 B3 00 90 00 65 00 37 00 "
  %o = %o"0A 00 DC FF B4 FF 90 FF 72 FF 59 FF 4A FF 46 FF "
  %o = %o"4A FF 57 FF 6E FF 89 FF AA FF CE FF F5 FF 1C 00 "
  %o = %o"42 00 65 00 84 00 9B 00 AB 00 B3 00 B3 00 A8 00 "
  %o = %o"95 00 7A 00 59 00 33 00 0A 00 E3 FF BA FF 94 FF "
  %o = %o"75 FF 5A FF 49 FF 3E FF 3D FF 44 FF 56 FF 6E FF "
  %o = %o"8E FF B2 FF D9 FF FE FF 24 00 49 00 6A 00 85 00 "
  %o = %o"97 00 A0 00 9F 00 97 00 86 00 6C 00 4F 00 27 00 "
  %o = %o"FE FF D6 FF A9 FF 84 FF 5F FF 41 FF 2B FF 1E FF "
  %o = %o"1A FF 22 FF 33 FF 4F FF 6F FF 98 FF C4 FF F2 FF "
  %o = %o"20 00 4E 00 78 00 9C 00 B6 00 C8 00 D0 00 CD 00 "
  %o = %o"BF 00 A8 00 88 00 62 00 35 00 08 00 D8 FF A9 FF "
  %o = %o"7F FF 5A FF 3D FF 28 FF 1C FF 1A FF 21 FF 32 FF "
  %o = %o"4B FF 6A FF 8F FF B7 FF DD FF 00 00 23 00 41 00 "
  %o = %o"5D 00 6F 00 7A 00 7C 00 76 00 67 00 55 00 3F 00 "
  %o = %o"25 00 08 00 EC FF CD FF B1 FF 99 FF 87 FF 7A FF "
  %o = %o"6E FF 66 FF 66 FF 69 FF 72 FF 80 FF 92 FF A4 FF "
  %o = %o"B6 FF CA FF DC FF EF FF 04 00 16 00 23 00 2C 00 "
  %o = %o"34 00 3B 00 3F 00 42 00 40 00 3A 00 31 00 24 00 "
  %o = %o"17 00 0A 00 FA FF E8 FF D4 FF BE FF A9 FF 98 FF "
  %o = %o"88 FF 7E FF 72 FF 6C FF 67 FF 69 FF 6F FF 7E FF "
  %o = %o"8E FF A2 FF B7 FF CE FF E5 FF FD FF 16 00 2A 00 "
  %o = %o"3B 00 45 00 48 00 49 00 42 00 36 00 26 00 0E 00 "
  %o = %o"F5 FF D7 FF B9 FF 9E FF 87 FF 72 FF 62 FF 58 FF "
  %o = %o"56 FF 59 FF 66 FF 79 FF 90 FF AA FF C8 FF E7 FF "
  %o = %o"04 00 21 00 3C 00 4F 00 5B 00 5F 00 5B 00 50 00 "
  %o = %o"3C 00 21 00 01 00 DE FF B9 FF 93 FF 71 FF 53 FF "
  %o = %o"3B FF 2B FF 25 FF 27 FF 32 FF 49 FF 67 FF 8B FF "
  %o = %o"B4 FF E0 FF 0B 00 34 00 58 00 77 00 8D 00 9A 00 "
  %o = %o"9D 00 94 00 7F 00 63 00 40 00 17 00 EA FF BA FF "
  %o = %o"8C FF 60 FF 3E FF 21 FF 10 FF 08 FF 0B FF 18 FF "
  %o = %o"31 FF 55 FF 7D FF AE FF DD FF 0A 00 34 00 5B 00 "
  %o = %o"7C 00 95 00 A2 00 A3 00 99 00 84 00 68 00 47 00 "
  %o = %o"1D 00 F3 FF C3 FF 95 FF 6B FF 4A FF 31 FF 20 FF "
  %o = %o"17 FF 16 FF 20 FF 34 FF 50 FF 75 FF 9B FF C2 FF "
  %o = %o"EA FF 0C 00 2F 00 50 00 66 00 74 00 78 00 72 00 "
  %o = %o"64 00 50 00 37 00 17 00 F4 FF CE FF A8 FF 86 FF "
  %o = %o"6A FF 55 FF 47 FF 40 FF 40 FF 4A FF 5B FF 74 FF "
  %o = %o"93 FF B6 FF D7 FF FA FF 1A 00 38 00 52 00 65 00 "
  %o = %o"70 00 71 00 6B 00 60 00 4F 00 38 00 1B 00 00 00 "
  %o = %o"E2 FF C1 FF A6 FF 8F FF 7B FF 6E FF 66 FF 64 FF "
  %o = %o"6A FF 76 FF 88 FF 9D FF B6 FF CF FF E7 FF FE FF "
  %o = %o"14 00 26 00 32 00 3B 00 3D 00 37 00 2D 00 21 00 "
  %o = %o"11 00 FD FF E8 FF D4 FF BF FF AE FF A0 FF 98 FF "
  %o = %o"94 FF 94 FF 99 FF A1 FF AC FF B9 FF C9 FF D9 FF "
  %o = %o"E9 FF F7 FF 01 00 0D 00 13 00 16 00 16 00 14 00 "
  %o = %o"0E 00 05 00 FA FF EF FF E5 FF D7 FF CD FF C4 FF "
  %o = %o"BD FF B9 FF B7 FF B7 FF BB FF C0 FF C7 FF D1 FF "
  %o = %o"DA FF E4 FF ED FF F4 FF FC FF FF FF 02 00 03 00 "
  %o = %o"03 00 FF FF FB FF F4 FF EF FF EA FF E4 FF DF FF "
  %o = %o"D9 FF D2 FF D0 FF D0 FF D2 FF D2 FF D5 FF D8 FF "
  %o = %o"DB FF E1 FF E7 FF ED FF F1 FF F2 FF F2 FF F1 FF "
  %o = %o"F0 FF EE FF EB FF E5 FF E0 FF D9 FF D5 FF D3 FF "
  %o = %o"D1 FF D0 FF D1 FF D3 FF D7 FF DD FF E5 FF EE FF "
  %o = %o"F7 FF FD FF 03 00 06 00 0B 00 0F 00 10 00 0F 00 "
  %o = %o"08 00 02 00 FC FF F1 FF E8 FF DB FF D1 FF C6 FF "
  %o = %o"BC FF B6 FF B3 FF B3 FF B7 FF BD FF C5 FF D0 FF "
  %o = %o"DE FF EC FF FB FF 08 00 15 00 1F 00 27 00 2D 00 "
  %o = %o"2E 00 2D 00 27 00 1C 00 10 00 01 00 F1 FF E1 FF "
  %o = %o"D0 FF C1 FF B3 FF A8 FF A3 FF A2 FF A5 FF AB FF "
  %o = %o"B7 FF C4 FF D3 FF E7 FF F9 FF 0B 00 1B 00 2A 00 "
  %o = %o"34 00 3C 00 40 00 3E 00 38 00 2D 00 1F 00 0C 00 "
  %o = %o"FC FF E9 FF D6 FF C4 FF B3 FF A6 FF 9D FF 9A FF "
  %o = %o"9C FF A2 FF AD FF BC FF CF FF E2 FF F7 FF 0C 00 "
  %o = %o"1F 00 2F 00 3E 00 48 00 4E 00 4D 00 49 00 3F 00 "
  %o = %o"31 00 1E 00 0B 00 F6 FF E1 FF CD FF BB FF AA FF "
  %o = %o"9F FF 95 FF 94 FF 95 FF 9D FF A8 FF B8 FF CA FF "
  %o = %o"DF FF F2 FF 08 00 18 00 2B 00 37 00 43 00 43 00 "
  if @not(@file(@windir(T)\sound.wav))
    binfile open,1,@windir(T)\sound.wav,create
    binfile write,1,hex,%o
    binfile close,1
  end
  exit

#------------------------------------------------------------------------------

_________________
cheers

Dave
Back to top
View user's profile Send private message Visit poster's website
andrewm
Newbie


Joined: 13 Jun 2007
Posts: 11

PostPosted: Sun Jun 17, 2007 11:47 pm    Post subject: Reply with quote

Dave that's amazing! I can't tell you how much I appreciate your work.

I got the sound to play, but I got no balloon...I think it worked as I couldn't do anything with the icon just like you said, but I didn't get the balloon. I have balloon.dsu in the directory where we run the exe from...is that correct?

Thanks again...I have posted the main app below, more for your curiosity than anything else...we haven't thought of any aditions we need...there's a few small bugs but we deal with it.

Again, I am only posting this so you can see what you've been working on Smile

Thanks!!!

~Andrew

Code:


external vdsinet.dll,Public Freeware Key|90257236
#define command,net smtp
#define function,net smtp
#define command,net
#define function,net

REM ***MINIMIZE TO SYSTRAY CODE
#define command,TrayIco
  # Get current SysTray ID into %%shell_TrayWnd_ID
  TrayIco

  # MSGEVENTs to capture non-client mouse clicks
  # Trap LEFT mouse button down
  option msgevent,$000000A1,WM_NCLBUTTONDOWN
  # Trap RIGHT mouse button down to capture sysmenu/Minimize
  option msgevent,$000000A4,WM_NCRBUTTONDOWN
REM ***END MINIMIZE TO SYSTRAY CODE


option filename,long
option regbuf,1000000
option decimalsep,.
%a = @sysinfo(pixperin)
option scale,%a
gosub get user
%%title = CIGL I.T. Helpdesk - Campbell Systems
title %%title
%%path = @path(%0)
rem %%path = \\con-camb1-snp1\concamb\pension administration\000-Cowan Toolbar\register-IT\
%%path = \\cig-camb1-wsus1\register-it\

%%activedir = %%path"active"
%%activedir2 = %%path"active"
%%closeddir = %%path"closed"
%%closeddir2 = %%path"closed"
%%configdir = %%path"config"
%%configdir2 = %%path"config"
%%test = C:\My Data\vds5\Codehandler

:create dialog
  DIALOG CREATE,%%title,,,830,604
  dialog add,style,sty1,,10,b
  DIALOG ADD,STYLE,sty2,,,B,YELLOW,
  DIALOG ADD,list,lstX,1,1,1,1
  DIALOG ADD,list,lstY,1,3,1,1
  DIALOG ADD,list,lstZ,1,5,1,1
  dialog add,menu,Additional Commands,Delete Active Work Order,Restore Closed File back to Active,-,Show contents of Closed Directory,Return to Active Directory,-,Find All Overdue,Transfer Closed or Canceled,Send Update to User,Send Update to EMAIL Address
  DIALOG ADD,TAB,TAB1,2,2,822,560,Select/Create|Edit Work Order
  DIALOG ADD,STATUS,ST1,Ready
  DIALOG ADD,status,TEXT1A,Active Dir: XXX/Closed Dir:  XXX - %%path
  DIALOG ADD,TASKICON,TrayIcon,C:\temp\cowan.ico," CIGL I.T. Helpdesk "
  DIALOG SHOW
  %%dlg0 = @winexists(%%title)

rem auto open
inifile open,C:\temp\auto-open.txt
%%item = @iniread(data,auto-open)
if @not(@equal(%%item,""))
   %%active = %%item
   dialog set,st1,Ready - Active: %%active
   inifile write,data,auto-open,""
   else
   %%active = ""
   end
   
   
%a = Select/Create
%%tab = Select/Create
gosub check for super user
gosub %aOPEN
gosub filecount

:loop1
wait event, 0.5
goto @event()

:TIMER
  # Restore Tray Icon if needed
  # Syntax: TrayIco <TaskIcon-name>,<Icon-path/name>[,<hint>]
  #         1st and 2nd parameters are required
  TrayIco TrayIcon,C:\temp\cowan.ico," CIGL I.T. Helpdesk "
  goto loop1

:TrayIconCLICK
  # If Right-Click show popup menu
  if @equal(@click(B),right)
    rem You can add code for a right-click popup menu if desired - which would appear when the suer right-clicks on the tray icon.
  end
  # If Left-Click restore window
  if @equal(@click(B),left)
    dialog show
    window activate,%%dlg0
  end
  goto loop1


 
:WM_NCRBUTTONDOWN
:WM_NCLBUTTONDOWN
  # Test if window status is 2 = iconized / hide taskbar button
   if @equal(@winpos(%%dlg0,S),2)
    dialog hide
  end
  goto loop1
 
 
:Resize
  goto loop1

 
:close
  exit


:TrayIco
  # TrayIco command - Restore Tray Icon if needed
  if %%shell_TrayWnd_ID
    # Grab the current System Tray Window ID
    %s = @winexists(#shell_TrayWnd)
    # Test to see if the SysTray's Window ID has changed
    if @both(@unequal(%s,%%shell_TrayWnd_ID),%s)
      # SysTray has restarted - remove and reload trayicon
      if @both(%1,%2)
        # We need both %1 and %2 for the 'dialog add'
        dialog remove,%1
        dialog add,taskicon,%1,%2,%3
        # Update variable with the SysTray's new Window ID
        %%shell_TrayWnd_ID = %s
      end
    end
  else
    # Grab the original System Tray Window ID
    %%shell_TrayWnd_ID = @winexists(#shell_TrayWnd)
  end
  exit

exit

:Restore Closed File back to ActiveMENU
if @equal(%%Active,"")
   warn No work order selected
   goto loop1
   end
if @not(@equal(%%activedir,%%closeddir2))
   warn You are not viewing closed files - cannot perform restore
   goto loop1
   end
   
if @ask(Confirm restoration of:@cr()@cr()%%active@cr()@cr()to@cr()@cr()ACTIVE@cr()@cr()Proceed?)
   file copy,%%activedir\%%active.txt,%%activedir2
   file delete,%%activedir\%%active
   gosub refresh file list
   else
   end         
goto loop1


:Find All OverdueMENU
list clear,lstX
%%date = @datetime(MM-DD-YYYY)
list loadfile,lstX,%%configdir\master-%%date.txt
wait 0.3
list clear,lstY
list loadfile,lstY,%%configdir\date compare.txt
wait 0.5
%%date = @datetime(MMMM DD"," YYYY)
%%match = @match(lstY,%%date)
%%indexX = @index(lstY)

%%count = @count(lstX)
if @equal(%%count,0)
   goto loop1
   end
list clear,list1SC
repeat
%%active = @dlgtext(lstX)
parse "%%item1;%%item2;%%item3;%%item4;%%item5;%%item6", %%active
list seek,lstY,0
%%match = @match(lstY,%%item2)
%%index = @index(lstY)
if @greater(%%indexX,%%index)
   list add,list1SC,%%item6
   end
list delete,lstX
%%count = @count(lstX)
until @equal(%%count,0)
goto loop1   


:filecount
list clear,lstX
list filelist,lstX,%%activedir\*.txt
%%count1 = @count(lstX)
list clear,lstX
list filelist,lstX,%%closeddir\*.txt
%%count2 = @count(lstX)
dialog set,text1a,Active Dir: %%count1/Closed Dir: %%count2  - - - %%path
exit

:Delete Active Work OrderMENU
if @not(@equal(%%superuser,1))
   warn You do not have permission to delete data from this system (%%user)
   goto loop1
   end
if @equal(%%Active,"")
   warn No work order selected
   goto loop1
   end
if @ask(Confirm deletion of work order: %%active.  Proceed?)
   file delete,%%activedir\%%active.txt
   %%active = ""
   if @equal(%%tab,Select/Create)
      gosub refresh file list
      list clear,list2sc
      dialog set,st1,Ready
      gosub filecount
      end
   if @equal(%%tab,Edit Work Order)
      gosub clear edit tab
      dialog set,st1,Ready
      gosub filecount
      end
end
goto loop1

:clear edit tab
%%counter = 1
repeat
dialog set,edit%%counter,""
%%counter = @succ(%%counter)
until @equal(%%counter,24)
exit


:check for super user
list clear,lstX
list loadfile,lstX,%%configdir\superuser.txt
%%match = @match(lstX,%%user)
if @not(@equal(%%match,1))
   dialog remove,tab1
   DIALOG ADD,TAB,TAB1,2,2,822,560,Select/Create
   else
   %%superuser = 1
   end
exit

:Delete all old master indexesMENU
if @ask(This will delete the all master indexes including today. Today's index will be regenerated next time the monitor is launched by any user.  Proceed?)
   file delete,%%configdir\master-*.txt
   else
   end
goto loop1   


:Delete Current Master indexMENU
%%date = @datetime(MM-DD-YYYY)
if @ask(This will delete the master index for today [%%date]. It will be regenerated next time the monitor is launched by any user.  Proceed?)
   file delete,%%configdir\master-%%date.txt
   else
   end
goto loop1


:Select/CreateCLICK
%%tab = Select/Create
goto tabload1

:Edit Work OrderCLICK
%%tab = Edit Work Order
goto tabload1

:Generate Work OrderCLICK
%%tab = Generate Work Order
goto tabload1

:tabload1
   gosub %aCLOSE
   gosub %%tab"OPEN"
   %a = %%tab
   goto loop1

:Show contents of Closed DirectoryMENU
if @not(@equal(%%tab,Select/Create))
   warn (Please switch to the Select/Create tab before accessing Closed orders)
   goto loop1
   end
%%activedir = %%closeddir   
gosub refresh file list
info You are now accessing the Closed directory.  When you are ready switch back using the Return to Active Directory command.
gosub filecount
goto loop1   

:Return to Active DirectoryMENU
if @not(@equal(%%tab,Select/Create))
   warn (Please switch to the Select/Create tab before using this command)
   goto loop1
   end
%%activedir = %%activedir2   
gosub refresh file list
gosub filecount
goto loop1   



rem - - Select/Create tab
:Select/CreateOPEN
  DIALOG ADD,LIST,LIST1SC,29,8,180,466,,,click,sty1,sorted
  DIALOG ADD,TEXT,TEXT1SC,34,198,,,Sort by
  DIALOG ADD,COMBO,COMBO1SC,31,243,320,21
  DIALOG ADD,EDIT,EDIT1SC,56,243,180,19
  DIALOG ADD,BUTTON,BUTTON1SC,30,635,181,24,Create New Work Order
  DIALOG ADD,GROUP,GROUP1SC,102,204,606,448,Summary of Selected Work Order
  DIALOG ADD,LIST,LIST2SC,1,1,1,1,,,
  DIALOG ADD,EDIT,LIST2SCB,118,211,592,420,,,sty1,multi,wrap,scroll
  DIALOG ADD,COMBO,COMBO2SC,79,242,180,21,,,CLICK
  DIALOG ADD,BUTTON,BUTTON2SC,54,430,86,24,Refresh
  DIALOG ADD,BUTTON,BUTTON3SC,497,8,180,24,Generate Single Work Order
  DIALOG ADD,BUTTON,BUTTON4SC,521,8,180,24,Generate Multi Work Order
  DIALOG ADD,BUTTON,BUTTON5SC,55,635,181,24,Quick Ticket
  DIALOG ADD,COMBO,COMBO3SC,81,642,172,21

list loadfile,combo2SC,%%configdir\reports.txt   
list loadfile,combo1SC,%%configdir\filter list.txt 
list loadfile,combo3SC,%%configdir\quick1.txt 
dialog disable,button3sc
dialog disable,button4sc

gosub refresh file list
gosub loadSelect/Create
exit

:combo2SCCLICK
%%report = @dlgtext(combo2SC)
if @equal(%%report,Dump all data "(use filtered list)")
   gosub Dump all data (use filtered list)
   goto loop1
   end
info Invalid Request   
goto loop1   


:Dump all data (use filtered list)
list clear,lstX
list clear,lstY
list assign,lstY,list1SC
%%count = @count(lstY)
if @equal(%%count,0)
   exit
   end
%%orig = %%active   

rem add infokey
list seek,lstY,0
list insert,lstY,infokey
list seek,lstY,0
file copy,%%configdir\infokey.txt,%%activedir
repeat
%%active = @dlgtext(lstY)
gosub get data from ini
%%stream = %%a01|%%a02|%%a03|%%a04|%%a05|%%a06|%%a07|%%a08|%%a09|%%a10|%%a11|%%a12|%%a13|%%a14|%%a15|%%a16|%%a17|%%a18|%%a19|%%a20|%%a21|%%a22|%%a23|%%a24|%%a25|%%a26|%%a27|%%a28|%%a29|%%a30|%%a31|%%a32|%%a33|%%a34|%%a35|%%a36|%%a37|%%a38|%%a39|%%a40|%%a41|%%a42|%%a43|%%a44|%%a45|%%a46|%%a47|%%a48|%%a49|%%a50
list add,lstX,%%stream
list delete,lstY
%%count = @count(lstY)
until @equal(%%count,0)
list savefile,lstX,C:\temp\WO-data-dump.xls
wait 0.5
shell open,C:\temp\WO-data-dump.xls
%%active = %%orig
gosub get data from ini
file delete,%%activedir\infokey.txt
exit

:button5scbutton
%%qtype = @dlgtext(combo3SC)
if @equal(%%qtype,"")
   warn No order type selected
   goto loop1
   end

inifile open,%%configdir\quick2.txt
%%qtype2 = @iniread(%%qtype,file)
%%dateX = @datetime(MMDDYY-HHNNSS)
list clear,lstX
list loadfile,lstX,%%configdir\%%qtype2
wait 0.5

rem add counter
inifile open,%%configdir\counter.txt
%%counterX = @iniread(data,counter)
%%counterX = @succ(%%counterX)
inifile write,data,counter,%%counterX
list savefile,lstX,%%activedir\%%dateX-"T"%%counterX.txt
wait 0.5
gosub refresh file list
%%match = @match(list1SC,%%dateX)
%%date = @datetime(MMDDYY)
%%time = @datetime(HH:NN:SS)
rem update file info
inifile open,%%activedir\%%dateX-"T"%%counterX.txt
inifile write,data,01,%%user
inifile write,data,19,%%user
inifile write,data,02,%%date
inifile write,data,03,%%time
%%date = @datetime(MMMM DD"," YYYY)
inifile write,data,05,%%date
gosub filecount
info New work order created by %%user - %%dateX-"T"%%counterX
%%active = %%dateX-"T"%%counterX
dialog set,st1,Ready - Active: %%active
dialog set,list2SCB,""
goto loop1


:Transfer closed or canceledMENU
if @not(@equal(%%tab,Select/Create))
   warn (Please switch to the Select/Create tab before accessing this command)
   goto loop1
   end
if @ask(This will move all Closed or Canceled work orders to the closed directory.  They will not longer be viewable via the active list.  Proceed?)
   gosub transfer closed
   gosub refresh file list
   %%active = ""
   list clear,list2sc
   dialog set,st1,Ready
   else
   end
goto loop1

:transfer closed
if @equal(%%activedir,%%closeddir)
   exit
   end
list clear,lstX
list filelist,lstX,%%activedir\*.txt
%%count = @count(lstX)
if @equal(%%count,0)
   exit
   end
list seek,lstX,0
repeat
%%active = @dlgtext(lstX)
dialog set,st1,Checking %%active
inifile open,%%active
%%status = @iniread(data,18)

if @equal(%%status,Closed)
   file copy,%%active,%%closeddir
   file delete,%%active
   end
if @equal(%%status,Canceled)
   file copy,%%active,%%closeddir
   file delete,%%active
   end
list delete,lstX
%%count = @count(lstX)
until @equal(%%count,0)
gosub filecount
exit


:button4SCbutton
list clear,lstX
list clear,lstY
list assign,lstY,list1SC
%%count = @count(lstY)
if @equal(%%count,0)
   goto loop1
   end
   
list seek,lstY,0
%%orig = %%active
repeat
%%active = @dlgtext(lstY)
gosub get data from ini
gosub generate hard copy
list delete,lstY
%%count = @count(lstY)
until @equal(%%count,0)
list savefile,lstX,C:\temp\WO-%%active.wri
wait 0.5
shell print,C:\temp\WO-%%active.wri
wait 3
file delete,C:\temp\WO-%%active.wri
%%active = %%orig
gosub get data from ini
goto loop1   

:button2SCbutton
%%filtertype = @dlgtext(combo1SC)
%%filtercriteria = @dlgtext(edit1SC)
%%sub = @substr(%%filtertype,1,2)
if @equal(%%sub,XX)
   gosub refresh file list   
   goto loop1
   end
if @equal(%%sub,"")
   gosub refresh file list   
   goto loop1
   end

rem filter using criteria
list clear,lstX
list clear,list1SC
list filelist,lstX,%%activedir\*.txt
%%count = @count(lstX)
if @equal(%%count,0)
   exit
   end
list seek,lstX,0
repeat
%%fullpath = @dlgtext(lstX)
inifile open,%%fullpath
%%item = @iniread(data,%%sub)
if @equal(%%item,%%filtercriteria)
   %%name = @name(%%fullpath)
   list add,list1SC,%%name
   end
list delete,lstX
%%count = @count(lstX)
until @equal(%%count,0)
goto loop1


:Select/CreateCLOSE
gosub saveSelect/Create
  DIALOG REMOVE,LIST1SC
  DIALOG REMOVE,LIST2SC 
  DIALOG REMOVE,TEXT1SC
  DIALOG REMOVE,COMBO1SC
  DIALOG REMOVE,EDIT1SC
  DIALOG REMOVE,BUTTON1SC
  DIALOG REMOVE,GROUP1SC
  DIALOG REMOVE,COMBO2SC
  DIALOG REMOVE,COMBO3SC
  dialog remove,button2SC
  dialog remove,button3SC
  dialog remove,button4SC
  dialog remove,button5SC
rem  dialog remove,LIST2SCB
exit

:list1SCclick
%%active = @dlgtext(list1SC)
dialog set,list2SCB,LOADING",..."
gosub get data from ini
gosub create summary
dialog set,st1,Ready - Active: %%active
goto loop1


:button1SCbutton
%%dateX = @datetime(MMDDYY-HHNNSS)
list clear,lstX
list loadfile,lstX,%%configdir\blank.txt
wait 0.5
rem add counter
inifile open,%%configdir\counter.txt
%%counterX = @iniread(data,counter)
%%counterX = @succ(%%counterX)
inifile write,data,counter,%%counterX
list savefile,lstX,%%activedir\%%dateX-"T"%%counterX.txt
wait 0.5
gosub refresh file list
%%match = @match(list1SC,%%dateX)
%%date = @datetime(MMDDYY)
%%time = @datetime(HH:NN:SS)
rem update file info
inifile open,%%activedir\%%dateX-"T"%%counterX.txt
inifile write,data,01,%%user
inifile write,data,19,%%user
inifile write,data,02,%%date
inifile write,data,03,%%time
%%date = @datetime(MMMM DD"," YYYY)
inifile write,data,05,%%date
gosub filecount
info New work order created by %%user - %%dateX-"T"%%counterX
%%active = %%dateX-"T"%%counterX
dialog set,st1,Ready - Active: %%active
dialog set,list2SCB,""
goto loop1



:refresh file list
list clear,lstX
list clear,list1SC
list filelist,lstX,%%activedir\*.txt
%%count = @count(lstX)
if @equal(%%count,0)
   exit
   end
list seek,lstX,0
repeat
%%fullpath = @dlgtext(lstX)
%%name = @name(%%fullpath)
list add,list1SC,%%name
list delete,lstX
%%count = @count(lstX)
until @equal(%%count,0)
exit


:loadSelect/Create
if @equal(%%active,"")
   exit
   end
dialog set,list2SCB,LOADING",..."
gosub get data from ini
gosub create summary
gosub get data from ini
exit

:create summary
list clear,list2SC
list add,list2SC,Summary data for work order: %%active
list add,list2SC,Created on %%a02 at %%a03 by %%a01
list add,list2SC,
list add,list2SC,Request received on %%a05
list add,list2SC,From %%a06
list add,list2SC,OPCO: %%a09/%%a10
list add,list2SC,Email: %%a07
list add,list2SC,Phone: %%a08
list add,list2SC,Due date: %%a11
list add,list2SC,
list add,list2SC,Assigned to: %%a19
list add,list2SC,Priority: %%a17
list add,list2SC,Status: %%a18
list add,list2SC,Request Type: %%a20
list add,list2SC,
list add,list2SC,Additional Info
list add,list2SC,- - - - - - - - - - -
list add,list2SC,Processor: %%a12
list add,list2SC,O/S: %%a13
list add,list2SC,Office: %%a14
list add,list2SC,RAM: %%a15
list add,list2SC,Printer: %%a16

rem
%%sectionSTART = START-PROBLEM-AKI0530
%%sectionEND = END-PROBLEM-AKI0530
gosub get_text_block-VIEW
list add,list2SC,
list add,list2SC,Problem:
list add,list2SC,%%text
rem
%%sectionSTART = START-RESOLUTION-AKI0530
%%sectionEND = END-RESOLUTION-AKI0530
gosub get_text_block-VIEW
list add,list2SC,
list add,list2SC,Resolution:
list add,list2SC,%%text
rem
%%sectionSTART = START-NOTES-AKI0530
%%sectionEND = END-NOTES-AKI0530
gosub get_text_block-VIEW
list add,list2SC,
list add,list2SC,Notes:
list add,list2SC,%%text

%%text = @text(list2sc)
dialog set,list2scB,%%text
exit

:get data from ini
inifile open,%%activedir\%%active.txt
%%a01 = @iniread(data,01)
%%a02 = @iniread(data,02)
%%a03 = @iniread(data,03)
%%a04 = @iniread(data,04)
%%a05 = @iniread(data,05)
%%a06 = @iniread(data,06)
%%a07 = @iniread(data,07)
%%a08 = @iniread(data,08)
%%a09 = @iniread(data,09)
%%a10 = @iniread(data,10)
rem
%%a11 = @iniread(data,11)
%%a12 = @iniread(data,12)
%%a13 = @iniread(data,13)
%%a14 = @iniread(data,14)
%%a15 = @iniread(data,15)
%%a16 = @iniread(data,16)
%%a17 = @iniread(data,17)
%%a18 = @iniread(data,18)
%%a19 = @iniread(data,19)
%%a20 = @iniread(data,20)
exit

:saveSelect/Create
if @equal(%%active,"")
   exit
   end
exit


rem - - for each tab
:Edit Work OrderOPEN
  DIALOG ADD,TEXT,TEXT1,49,17,,,Date Received from Client
  DIALOG ADD,TEXT,TEXT2,74,17,,,Client ID (LAN)
  DIALOG ADD,TEXT,TEXT3,95,17,,,Email
  DIALOG ADD,TEXT,TEXT4,116,17,,,Phone
  DIALOG ADD,TEXT,TEXT5,137,17,,,OPCO Code (Branch)
  DIALOG ADD,TEXT,TEXT6,158,17,,,OPCO
  DIALOG ADD,TEXT,TEXT7,181,17,,,Due Date (to client)
  DIALOG ADD,TEXT,TEXT8,203,17,,,Processor
  DIALOG ADD,TEXT,TEXT9,224,17,,,O/S
  DIALOG ADD,TEXT,TEXT10,249,17,,,Office
  DIALOG ADD,TEXT,TEXT11,269,17,,,RAM/Monitor
  DIALOG ADD,TEXT,TEXT12,292,17,,,Printer Info 
  DIALOG ADD,TEXT,TEXT13,317,17,,,Priority
  DIALOG ADD,TEXT,TEXT14,339,17,,,Status
  DIALOG ADD,TEXT,TEXT15,361,17,,,Assigned to
  DIALOG ADD,TEXT,TEXT16,386,17,,,Request Type 
  DIALOG ADD,TEXT,TEXT17,28,17,,,Ticket number: %%Active,,sty1
  DIALOG ADD,TEXT,TEXT18,538,16,,,Save your changes by clicking back to the Select/Create TAB,,sty1
rem
  DIALOG ADD,EDIT,EDIT1,46,174,180,19,,,readonly
  DIALOG ADD,COMBO,EDIT2,68,174,180,21,,,
  DIALOG ADD,EDIT,EDIT3,92,174,180,19
  DIALOG ADD,EDIT,EDIT4,113,174,180,19
  DIALOG ADD,EDIT,EDIT5,134,174,180,19
  DIALOG ADD,EDIT,EDIT6,157,174,180,21
  DIALOG ADD,EDIT,EDIT7,181,174,180,19
  DIALOG ADD,EDIT,EDIT8,203,174,180,19
  DIALOG ADD,EDIT,EDIT9,225,174,180,19
  DIALOG ADD,EDIT,EDIT10,247,174,180,19
  DIALOG ADD,EDIT,EDIT11,269,174,180,19
  DIALOG ADD,EDIT,EDIT12,291,174,180,19
  DIALOG ADD,COMBO,EDIT13,313,174,180,21
  DIALOG ADD,COMBO,EDIT14,337,174,180,21
  DIALOG ADD,COMBO,EDIT15,361,174,180,21
  DIALOG ADD,COMBO,EDIT16,385,174,180,21, 
  DIALOG ADD,COMBO,COMBO1,35,635,82,21,,,click
  DIALOG ADD,COMBO,COMBO2,35,727,82,21,,,click
  DIALOG ADD,CALENDAR,CALENDAR1,60,630,185,108
  DIALOG ADD,BUTTON,BUTTON1,69,359,86,20,Auto-complete
  DIALOG ADD,BUTTON,BUTTON2,180,359,87,20,Grab Date
  DIALOG ADD,BUTTON,BUTTON3,1,1,1,1,Auto-complete (add this info to Printer Info field)
  DIALOG ADD,BUTTON,BUTTON4,418,17,336,24,Edit Problem Info
  DIALOG ADD,BUTTON,BUTTON5,444,17,336,24,Edit Resolution Info
  DIALOG ADD,BUTTON,BUTTON6,471,17,336,24,Edit Additional Notes
  DIALOG ADD,BUTTON,BUTTON7,1,1,1,1,Save Changes
  DIALOG ADD,LIST,LIST1,198,453,363,268
  %P = @sendmsg(@winexists(~LIST1),$0194,2000,0)
 
 
list loadfile,combo1,%%configdir\month-1.txt
list loadfile,combo2,%%configdir\years.txt
list loadfile,edit2,%%configdir\clients.txt
list loadfile,edit13,%%configdir\priority.txt
list loadfile,edit14,%%configdir\status.txt
list loadfile,edit15,%%configdir\assigned to.txt
list loadfile,edit16,%%configdir\request type.txt
list loadfile,list1,%%configdir\library1.txt
gosub set calendar
gosub loadEdit Work Order
dialog disable,button3
exit


:Send Update to userMENU
inifile open,%%path"config\mailer-config.txt"
inifile write,data,path,%%activedir\%%active.txt
wait 1
shell open,%%path"mail-server-01.exe"
info Update sent
goto loop1

:Send Update to EMAIL ADDRESSMENU
inifile open,%%path"config\mailer-config.txt"
%%server = @iniread(data,server)
%%from = "cig.ithelpdesk@cowangroup.ca"
%%input = @input(Enter email address)
%%text = @dlgtext(LIST2SCB)

if @equal(%%input,"")
   warn No email address entered - aborting
   goto loop1
   end

wait 0.5
net socket,close
net smtp,recipients,clear
net smtp,message,clear
net smtp,message,add,%%text
net smtp,from,%%from
net smtp,recipients,clear
net smtp,recipients,add,%%input
net smtp,subject,Ticket update: %%active
net smtp,send,%%server
net socket,close
info Message sent
goto loop1

:Send update on close
inifile open,%%path"config\mailer-config.txt"
%%server = @iniread(data,server)
%%fromX = @iniread(data,from)
%%subjectX = @iniread(messages,mailer3-subject)
%%messageX = @iniread(messages,mailer3-message)
inifile open,%%activedir\%%active.txt
%%name = @name(%%activedir\%%active.txt)
%%to = @iniread(data,07)

if @equal(%%to,"")
   warn No email address entered - aborting
   exit
   end

wait 0.5
net socket,close
net smtp,recipients,clear
net smtp,message,clear
net smtp,message,add,%%messageX
net smtp,from,%%fromX
net smtp,recipients,clear
net smtp,recipients,add,%%to
net smtp,subject,%%subjectX %%name
net smtp,send,%%server
net socket,close
info Auto-notify on close sent to: %%to
exit

:button4button
if @equal(%%active,"")
   goto loop1
   end
%%sectionSTART = START-PROBLEM-AKI0530
%%sectionEND = END-PROBLEM-AKI0530
gosub get_text_block-VIEW
goto child1

:button5button
if @equal(%%active,"")
   goto loop1
   end
%%sectionSTART = START-RESOLUTION-AKI0530
%%sectionEND = END-RESOLUTION-AKI0530
gosub get_text_block-VIEW
goto child1

:button6button
if @equal(%%active,"")
   goto loop1
   end
%%sectionSTART = START-NOTES-AKI0530
%%sectionEND = END-NOTES-AKI0530
gosub get_text_block-VIEW
goto child1


:Get_Text_Block-VIEW
list clear,lstX
list clear,lstY
list loadfile,lstX,%%activedir\%%active.txt
wait 0.5
%%match = @match(lstX,%%sectionSTART)
repeat
%%item2 = @dlgtext(lstX)
if @not(@equal(%%item2,%%sectionSTART))
   if @not(@equal(%%item2,%%sectionEND))
   list add,lstY,%%item2
   end
   end
list delete,lstX   
until @equal(%%item2,%%sectionEND)     
%%text = @text(lstY)
exit


:child1
window hide,%%title
  DIALOG CREATE,Edit Details,,,430,236,NOSYS
  DIALOG ADD,BUTTON,BT1CH1,200,5,419,34,SAVE AND CLOSE
  DIALOG ADD,EDIT,EDIT1CH1,5,3,422,190,%%text,,,multi,wrap,scroll
  DIALOG SHOW

:Child1_loop
   wait event
   parse "%E;%D",@event(D)
   if @zero(%D)
      dialog select,1
      dialog focus,bt1CH1
      goto Child1_loop
   else
      goto Child1_%E
   end

:child1_BT1CH1BUTTON
window normal,%%title
gosub save edit
dialog close,1
wait event
%b = @event()
goto LOOP1
rem - - - - child end


:save edit
rem grab new text
%%text = @dlgtext(edit1CH1)
list create,1
list clear,1
list add,1,%%text
rem load orig text
list create,2
list loadfile,2,%%activedir\%%active.txt
wait 0.5
%%match = @match(2,%%sectionSTART)
%%counter = @index(2)
%%counter = @succ(%%counter)
list seek,2,%%counter
rem insert new text
list seek,1,0
repeat
%%item2 = @item(1)
list insert,2,%%item2
list delete,1
%%count = @count(1)
until @equal(%%count,0)
rem delete old text up to section end label
%%counter = @index(2)
%%counter = @succ(%%counter)
list seek,2,%%counter
repeat
%%item2 = @item(2)
if @not(@equal(%%item2,%%sectionEND))
   list delete,2
   end
until @equal(%%item2,%%sectionEND)
rem save updated list
list savefile,2,%%activedir\%%active.txt
wait 0.5
list close,1
list close,2
exit

:edit2click
goto loop1   


:button1button
%%client = @dlgtext(edit2)
rem autocomplete1
list clear,lstX
list loadfile,lstX,%%configdir\auto-complete.txt
wait 0.5
%%match = @match(lstX,%%client)
rem Email|Full Name|City|OPCO Code|Phone #|Department|OPCO|FAX #
if @equal(%%match,1)
   %%item = @dlgtext(lstX)
   parse "%%item1;%%item2;%%item3;%%item4;%%item5;%%item6;%%item7;%%item8", %%item
   if @not(@equal(%%item1,""))
      dialog set,edit3,%%item1
      end
   if @not(@equal(%%item4,""))
      dialog set,edit5,%%item4
      end
   if @not(@equal(%%item5,""))
      dialog set,edit4,%%item5
      end
   if @not(@equal(%%item7,""))
      dialog set,edit6,%%item7
      end
   end
rem search for printer
list seek,list1,0
%%match = @match(list1,%%client)
rem grab data for printer
%%item = @dlgtext(list1)
if @not(@equal(%%item,""))
   dialog set,edit12,%%item
   end
rem autocomplete2
list clear,lstX
list loadfile,lstX,%%configdir\auto-complete2.txt
wait 0.5
%%match = @match(lstX,%%client)
rem Email|processor|OS|office|RAM|Monitor|Printer
if @equal(%%match,1)
   %%item = @dlgtext(lstX)
   parse "%%item1;%%item2;%%item3;%%item4;%%item5;%%item6;%%item7", %%item
   if @not(@equal(%%item2,""))
      dialog set,edit8,%%item2
      end
   if @not(@equal(%%item3,""))
      dialog set,edit9,%%item3
      end
   if @not(@equal(%%item4,""))
      dialog set,edit10,%%item4
      end
   if @not(@equal(%%item5,""))
      dialog set,edit11,%%item5/%%item6
      end
   end
goto loop1   
   
:button2button
%%target = edit7
goto grab date

:grab date
%%month = @dlgtext(combo1)
%%year = @dlgtext(combo2)
%%day = @dlgtext(calendar1)
parse "%%item1;%%day;%%item2", %%day
dialog set,%%target, %%month %%day"," %%year
goto loop1

:set calendar
%%month = @datetime(MM)
%%day = @datetime(DD)
%%year = @datetime(YYYY)
dialog set,calendar1,%%month/%%day/%%year
dialog set,combo2,%%year
list loadfile,lstX,%%configdir\month-2.txt
%%match = @match(lstX,%%month)
%%index = @index(lstX)
list seek,combo1,0
list seek,combo1,%%index
exit

:combo1click
:combo2click
%%month = @dlgtext(combo1)
rem translate friendly name into number
list loadfile,lstX,%%configdir\month-1.txt
%%match = @match(lstX,%%month)
%%index = @index(lstX)
list loadfile,lstX,%%configdir\month-2.txt
list seek,lstX,0
list seek,lstX,%%index
%%month = @dlgtext(lstX)
%%day = @datetime(DD)
%%year = @dlgtext(combo2)
dialog set,calendar1,%%month/%%day/%%year
goto loop1

:Edit Work OrderCLOSE
gosub saveEdit Work Order
rem remove text
%%counter = 1
repeat
dialog remove,text%%counter
%%counter = @succ(%%counter)
until @equal(%%counter,19)

rem remove edit
%%counter = 1
repeat
dialog remove,edit%%counter
%%counter = @succ(%%counter)
until @equal(%%counter,17)

rem remove button
%%counter = 1
repeat
dialog remove,button%%counter
%%counter = @succ(%%counter)
until @equal(%%counter,8)

rem misc
DIALOG remove,CALENDAR1
DIALOG remove,Combo1
DIALOG remove,Combo2
dialog remove,list1
exit

:loadEdit Work Order
if @equal(%%active,"")
   exit
   end
dialog set,edit1,%%a05
dialog set,edit2,%%a06
dialog set,edit3,%%a07
dialog set,edit4,%%a08
dialog set,edit5,%%a09
dialog set,edit6,%%a10
dialog set,edit7,%%a11
dialog set,edit8,%%a12
dialog set,edit9,%%a13
dialog set,edit10,%%a14
dialog set,edit11,%%a15
dialog set,edit12,%%a16
dialog set,edit13,%%a17
dialog set,edit14,%%a18
dialog set,edit15,%%a19
dialog set,edit16,%%a20
exit

:button7button
gosub saveEdit Work Order
goto loop1

:saveEdit Work Order
if @equal(%%active,"")
   exit
   end
%%a05 = @dlgtext(edit1)
%%a06 = @dlgtext(edit2)
%%a07 = @dlgtext(edit3)
%%a08 = @dlgtext(edit4)
%%a09 = @dlgtext(edit5)
%%a10 = @dlgtext(edit6)
%%a11 = @dlgtext(edit7)
%%a12 = @dlgtext(edit8)
%%a13 = @dlgtext(edit9)
%%a14 = @dlgtext(edit10)
%%a15 = @dlgtext(edit11)
%%a16 = @dlgtext(edit12)
%%a17 = @dlgtext(edit13)
%%a18 = @dlgtext(edit14)
%%a19 = @dlgtext(edit15)
%%a20 = @dlgtext(edit16)
inifile open,%%activedir\%%active.txt
inifile write,data,05,%%a05
inifile write,data,06,%%a06
inifile write,data,07,%%a07
inifile write,data,08,%%a08
inifile write,data,09,%%a09
inifile write,data,10,%%a10
inifile write,data,11,%%a11
inifile write,data,12,%%a12
inifile write,data,13,%%a13
inifile write,data,14,%%a14
inifile write,data,15,%%a15
inifile write,data,16,%%a16
inifile write,data,17,%%a17
inifile write,data,18,%%a18
inifile write,data,19,%%a19
inifile write,data,20,%%a20
%%dateX = @datetime(MMDDYY-HHNNSS)
inifile write,history,%%dateX,%%user|%%a05|%%a11|%%a17|%%a18|%%a19|%%a20

if @equal(%%a18,Closed)
   gosub send update on close     
   file copy,%%activedir\%%active.txt,%%closeddir
   file delete,%%activedir\%%active.txt
   %%active = ""
   dialog set,st1,No active file
   end

if @equal(%%status,Canceled)
   gosub send update on close     
   file copy,%%activedir\%%active.txt,%%closeddir
   file delete,%%activedir\%%active.txt
   %%active = ""
   dialog set,st1,No active file
   end
exit

   
:dummy dialog
  DIALOG CREATE,%%title,,,830,589
REM *** Modified by Dialog Designer on 10/04/2007 - 14:04 ***
  DIALOG ADD,TAB,TAB1,2,2,822,560,X
  DIALOG ADD,STATUS,ST1,Ready
rem copy all code below this line
  DIALOG SHOW

: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 5 Source Code All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
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