|
-
Dec 16th, 2005, 09:10 AM
#1
Thread Starter
New Member
Running an application from PowerPoint
Hi,
First, I am very much not a developer without any knowledge in VB...
I need to run a small clock application from within a PowerPoint presentation.
I have created a command button object in a PowerPoint slide. The code behind it is:
VB Code:
Private Sub Timer_Click()
Shell "C:\Temp\timer.exe", 6
End Sub
This works well without a problem. However, if the timer.exe is set to be "always on top" then the timer window becomes the active window.
I then need to click on the PowerPoint slide so it becomes active.
How do I force that at all times the PowerPoint presentation is the active window, regardless of the application being run?
Please advise what command should be added to the script so PowerPoint is always the active window.
Thanks,
--Spinacia
-
Dec 18th, 2005, 09:50 PM
#2
Re: Running an application from PowerPoint
Hi Spinacia, Welcome to the Forum.
Does this help:
VB Code:
Option Explicit
Private Declare Function SetForegroundWindow Lib "user32" (ByVal hwnd As Long) As Long
Private Sub Timer_Click()
Shell "C:\Temp\timer.exe", vbNormalFocus
SetForegroundWindow Me.hwnd
End Sub
Additional info at allapi.net: http://www.mentalis.org/apilist/SetF...ndWindow.shtml
Last edited by Bruce Fox; Dec 18th, 2005 at 09:53 PM.
-
Dec 21st, 2005, 05:10 AM
#3
Thread Starter
New Member
Re: Running an application from PowerPoint
Thanks Bruce.
I'll give it a try.
Spinacia.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|