#91637 - 2003-02-28 03:07 PM
Re: PowerPoint.application
|
MightyR1
MM club member
   
Registered: 1999-09-09
Posts: 1264
Loc: The Netherlands
|
Eric,
saw that docu too... Didn't help me much (not possible to open 2 instances of powerpoint...)
So I solved it in an other way:
code:
;**************************************************************************** ; ;SCRIPT : HALVIEWER.KIX ; ;AUTHOR : Patrick Rutten (MightyR1@hotmail.com) ; ;CONTRIBUTORS : ; ;ACTION : Runs a PPS and checks for update ; if update found, kill PPS, copy update, run new PPS ; ;SYNTAX : HALVIEWER.KIX ; ;VERSION : 1.0 - Initial release ; ;PARAMETERS : - ; ;REMARKS : - ; ;RETURNS : - ; ;DEPENDENCIES : WMI, Powerpoint, KIX32, hidetbar.exe ; ;KIXTART VER : 4.20 ; ;EXAMPLE(S) : - ; ;KNOWN ISSUES : - ; ;**************************************************************************** ; ; Break on $rc=SetOption("Explicit","On")
;Declare Vars Dim $rc, $masterpps, $updatepps, $hidetbar, $runcmd, $startcmd Dim $sleeptime, $copytime, $killtime, $runpps
$masterpps=@scriptdir+'\master.pps' $updatepps=@scriptdir+'\update.pps' $hidetbar=@scriptdir+'\hidetbar.exe' $runcmd='Run "%comspec% /c ' $startcmd='Run "%comspec% /c start ' $sleeptime=30 $copytime=3 $killtime=3 $runpps=1
;Hide Taskbar $rc=Execute("$runcmd $hidetbar chr(34)")
;infinite loop While 1 Sleep $sleeptime
;if update found: kill current, copy new, delete new If Exist($updatepps) $rc=wmikill("Powerpnt.exe") Sleep $killtime Copy $updatepps $masterpps Sleep $copytime Del $updatepps Sleep $killtime $runpps=1 EndIf ;if runflag is 1 then start the pps If $runpps $rc=Execute("$startcmd $masterpps chr(34)") $runpps=0 EndIf Loop Exit 0
Function WMIKill($proc_to_kill,optional $computer) Dim $wmistring, $wmi, $process, $processes, $kill If NOT $computer $computer = @WKSTA EndIf $wmistring = "winmgmts:{impersonationlevel=impersonate}!//" + $computer $wmi = GetObject($wmistring) If $wmi $processes = $wmi.instancesof("win32_process") For Each $process In $processes If $process.name = $proc_to_kill $kill = $process.terminate(0) If @ERROR = 0 $wmi = 0 Exit 0 Else $wmi = 0 Exit 1 EndIf EndIf Next Else Exit 2 EndIf EndFunction
I made the desktop black, no Icons and used an "updating.bmp" as image.
Now I can start the pps (no createobject since it flashes powerpoint), sleep and check for update (manually copied by a cmd file). If exist, kill powerpnt.exe (shows black desktop with updating.bmp), copy update and start all over again...
Now to get rid of the mouse pointer...
_________________________
Greetz, Patrick Rutten
- We'll either find a way or make one... - Knowledge is power; knowing how to find it is more powerful... - Problems don't exist; they are challenges...
|
|
Top
|
|
|
|
Moderator: Shawn, ShaneEP, Ruud van Velsen, Arend_, Jochen, Radimus, Glenn Barnas, Allen, Mart
|
0 registered
and 2220 anonymous users online.
|
|
|