FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Process identifier
Posts: 1392
Joined: Mon May 14, 2007 09:49 AM
Process identifier
Posted: Fri Dec 10, 2010 07:10 PM

Hi, all !

The file MY.EXE is launched
As I can find a process identifier MY.EXE ?

Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM
Re: Process identifier
Posted: Sat Dec 11, 2010 03:09 PM
Natter,

there is a internal FWH-function.
You can create a Array.
Next search inside the Array for Your EXE ( Title of MainWindow )

aTasks := GetTasks()
xBROWSE( aTasks )



Best regards
Uwe :-)
Since 1995 ( the first release of FW 1.9 )

i work with FW.

If you have any questions about special functions, maybe i can help.
Posts: 1392
Joined: Mon May 14, 2007 09:49 AM
Re: Process identifier
Posted: Sat Dec 11, 2010 03:47 PM

And how it will help to define a process identifier ?

Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM
Re: Process identifier
Posted: Sat Dec 11, 2010 05:00 PM
I using a VBS-Script, that creates a Excel-sheet with all Informations.
Would that work for You ?. You can start it from inside Your Application if needed.
It is tested with XP and Vista

API-Function for FWH :

DLL32 FUNCTION GetCurProI( );
AS LONG PASCAL;
FROM "GetCurrentProcessId" LIB "KERNEL32"


The Info :
...
...
ACTION ( MsgAlert( GetCurProI(), "Process-ID" ) )



Maybe You still need a list of Service-processes ??? :



Using the Service Process Identifier

To launch the Service Process Identifier, just double-click the ServiceProcessID.vbs file.
While the script is running, you’ll see a series of popup dialog boxes that will keep
you informed of the program’s progress.

When the script finishes compiling its list of services, it will launch Excel and display
the worksheet, which consists of two columns—one for the Process ID (PID) and the other
for the Services. The PIDs will be listed in ascending order and appear in red.
The Services will be listed by their full name and appear in blue.
Right below the full name, you’ll find the command line, which will appear in black,
used to launch the service.

When the spreadsheet appears, press [Ctrl][Shift][Esc] to access Task Manager.
With Task Manager up and running, select the Processes tab. If you don’t see a column titled PID,
pull down the View menu, choose the Select Columns command,
select the PID (Process Identifier) check box, and then click OK. Now, click
the PID column header to sort the list of processes by the PID number in ascending order.
If you wish, you and click and drag the PID column to reposition it on the left-hand side
of the Processes display.

At this point, you can scroll through the Processes display, locate the process you’re
interested in and match its PID to the one in the Service Process Identifier worksheet.

Saving the spreadsheet
While this spreadsheet is only meant for temporary use during a troubleshooting operation,
you may want to save it for future reference. However, keep in mind that the original
format of the data is a simple Comma Separated Value (CSV) file, so Excel will prompt you
to make a decision as to formatting before it will allow you to save the file.
In order to preserve the formatting and save the file in Excel format, follow the
instructions displayed in the dialog box.
Since 1995 ( the first release of FW 1.9 )

i work with FW.

If you have any questions about special functions, maybe i can help.
Posts: 1392
Joined: Mon May 14, 2007 09:49 AM
Re: Process identifier
Posted: Sat Dec 11, 2010 07:04 PM

For determination of a process identifier I use WMI (class Win32_Process). Properti ParentProcessID contains the parent process identifier.

For example:

In MY.EXE I do CreateObject (Word. Application). I want on ParentProcessID process WinWord.Exe to define the parent of this process.

Posts: 1392
Joined: Mon May 14, 2007 09:49 AM
Re: Process identifier
Posted: Sun Dec 12, 2010 07:49 PM

I start function GetCurProI( ) from inside my Application, but has received it is empty

DLL32 FUNCTION GetCurProI( );
AS LONG PASCAL;
FROM "GetCurrentProcessId" LIB "KERNEL32"

Continue the discussion