evewebber wrote:

> I would like to be able to close PowerPro such that, at the next 
> startup, it loads the same programs as were running at the previous 
> shutdown. I assume that at Scheduler startup I would run a script of 
> the relevant program paths with the name PproShutdown created during 
> the previous session. However, I don't know where to find the paths of
> running programs to create that script. I could capture them when I 
> call the programs but I would have to delete from the list any
> programs that close before shutdown, and I can't see how to keep the
> list coherent until shutdown. Can anyone help?
> 

I started a similar project a while ago but it's unfinished. Here's the 
code.
All it does is to enumerate windows in a way similar to Bruce's 
suggestion. It illustrates most of the window/process info that you can 
get using the win.dll plugin. All info fields of each window are 
concatenated into a string which is then stored in a glabal map 
variable. The map is then saved to disk using vars.var_save from the 
vars.dll plugin - found in the yahoo group files section. Run the script 
and take a look at the file created by vars.dll to get a good idea of 
the internal structure of the map variable. Info fields are separated by 
character hex 0x02.
A companion script could read the map back from disk using 
vars.var_restore and restart programs using the information included in 
each field.

Pay attention to join folding lines below:

local hl=win.handlelist("*",0) ;; 0=visible, 1=hidden, 2=hidden no blank 
caption
local ml=word(hl,0)
if(0==ml)
  quit
local m="gv"++scriptname ;; global map name
do("global "++m++"=map.create("++ml++")")
local i h s
local n=esc(?"0x02",0)
for(i=1; i<ml; i=i+1)
  h=word(hl,i)
  s = win.caption(h) ;;+
    ++n++win.exename(h) ;;+
    ++n++win.exepath(h) ;;+
    ++n++win.getprocessid(h) ;;+
    ++n++win.class(h) ;;+
    ++n++win.maxxed(h)++win.minned(h)++win.rolled(h)++win.topmost(h)
++win.trayminned(h) ;;+
    ++n++win.left(h)++","++win.top(h)++","++win.width(h)
++","++win.height(h) ;;+
    ++""
  do(m++"["++i++"]="++?'?"'++s++?'"')
endfor
vars.save_var(m)
quit



------------------------ Yahoo! Groups Sponsor --------------------~--> 
Get Bzzzy! (real tools to help you find a job). Welcome to the Sweet Life.
http://us.click.yahoo.com/KIlPFB/vlQLAA/TtwFAA/JV_rlB/TM
--------------------------------------------------------------------~-> 

Attention: PowerPro's Web site has moved: http://www.ppro.org 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/power-pro/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Reply via email to