Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Process Handle - > ProcessID
Message
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
00797981
Message ID:
00798037
Views:
31
The GetProcessId function retrieves the process identifier of the specified process.
void GetProcessId(
  HANDLE Process
);
If the function succeeds, the return value is the process identifier of the specified process. If the function fails, the return value is zero.

FoxPro declaration:
DECLARE INTEGER GetProcessId IN kernel32 INTEGER hProcess
Looks like this function is available starting from Windows XP, not in earlier versions.

* * *
Another option is process enumeration. Having all running processes enumerated with all their Process Id and Process Handles available, you just search a handle in the list.

On my site I have two examples in member area:

Enumerating Processes -- WinNT
http://www.news2news.com/vfp/?example=162

Enumerating Processes -- Win9*
http://www.news2news.com/vfp/?example=164

There should be something in UT archives on process enumeration too. Recently I saw a thread on this subject.
Previous
Reply
Map
View

Click here to load this message in the networking platform