Get process handle of an out-of-process task 
Author Message
 Get process handle of an out-of-process task

Hi all:

I'm developing an ActiveX component that makes use of Matlab. From this
ActiveX component I want the change the base priority of Matlab from
normal to realtime, using the win32 api 'SetPriorityClass'. This api
requires the process handle hProcess.
I start Matlab using: CreateObject("Matlab.Application").
How can I obtain the process handle of Matlab?

regards,
Theo ter Meer.



Sat, 28 Jun 2003 17:17:33 GMT  
 Get process handle of an out-of-process task


Quote:
> Hi all:

> I'm developing an ActiveX component that makes use of Matlab. From
this
> ActiveX component I want the change the base priority of Matlab from
> normal to realtime, using the win32 api 'SetPriorityClass'. This api
> requires the process handle hProcess.
> I start Matlab using: CreateObject("Matlab.Application").
> How can I obtain the process handle of Matlab?

It is easiest if you can use FindWindow to get the hWnd of a window
created by Matlab. Then use GetWindowThreadProcessId to find the
ProcessID. You can use Process Master (free) from the web site below to
identify a suitable window (if there is one).

If not, you will have to enumerate the process. On all except NT4 you
can use CreateToolhelp32Snapshot, which is quite straightforward. On
NT4 you will have to use the PSAPI. There are full details of both on
MSDN.
--
Roger Abbott, RHA (Minisystems) Ltd - http://www.rhaminisys.com
DDE Client and Server ActiveX controls for Visual Basic
DDE FAQ and DDE utility tools, browser URL monitor,
Program launcher/setup menu, other freeware and shareware

Sent via Deja.com
http://www.deja.com/



Sun, 29 Jun 2003 17:13:20 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Q: Getting calling process from in-process server dll

2. Q: Getting calling process from in-process server dll

3. Q: Getting calling process from in-process server dll

4. Getting the task/process ID for application

5. Getting running process Ids/killing task under NT

6. Getting running process Ids/killing task under NT

7. Getting a Process ID from an Object handle

8. Installation process and Update process finished.

9. VCM, In-Process, Out-Process

10. How to hide my process from Process Liste with win XP

11. ActiveX exe used to process large processing jobs

12. in-process and out-process, what are they?

 

 
Powered by phpBB® Forum Software