Process identifier

Process identifier

Postby Natter » Fri Dec 10, 2010 7:10 pm

Hi, all !

The file MY.EXE is launched
As I can find a process identifier MY.EXE ?
Natter
 
Posts: 1215
Joined: Mon May 14, 2007 9:49 am

Re: Process identifier

Postby ukoenig » Sat Dec 11, 2010 3: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 )

Image

Best regards
Uwe :lol:
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.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Re: Process identifier

Postby Natter » Sat Dec 11, 2010 3:47 pm

And how it will help to define a process identifier ?
Natter
 
Posts: 1215
Joined: Mon May 14, 2007 9:49 am

Re: Process identifier

Postby ukoenig » Sat Dec 11, 2010 5: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" ) )

Image

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

Image

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.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Re: Process identifier

Postby Natter » Sat Dec 11, 2010 7: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.
Natter
 
Posts: 1215
Joined: Mon May 14, 2007 9:49 am

Re: Process identifier

Postby Natter » Sun Dec 12, 2010 7: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"
Natter
 
Posts: 1215
Joined: Mon May 14, 2007 9:49 am


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot], nageswaragunupudi, RSalazarU and 76 guests