-----------------------------------------------------------

New Message on BDOTNET

-----------------------------------------------------------
From: spark
Message 8 in Discussion



Thanks for pointing the original question Pooj. 
It is appended below. Is this the question? 

I am not sure about a clear 
answer for that, however here is an indirect methods - you can always list 
processes and check the creation time of processes.

Let me explain with a 
WMI script sample
(listprocs.vbs)]

set serv = 
GetObject("winmgmts://./root/cimv2")
set objs = serv.ExecQuery("select * from 
Win32_Process")
for each obj in 
objs
        wscript.echo obj.name & " 
" & obj.CReationDate _
        
        & " " & obj.ProcessId &" 
"& _
        
        obj.ThreadCount &" "& 
obj.KernelModeTime
next

Run this on the console by 
typing
> cscript listproc.vbs

And 
it will list all the details that you notice there. Now if you can sort the data 
by the 'CreationDate' value then ypou can determine the last started 
process.
In the .Net world the interface to WMI is using the namespace 
'System.Management'- you will find it very easy to do the equivalent of the 
above sample.

As a note, here are the properties exposed by the 
Win32_Process class:

Caption
CreationClassName
CreationDate
CSCreationClassName
CSName
Description
ExecutablePath
ExecutionState
Handle
HandleCount
InstallDate
KernelModeTime
MaximumWorkingSetSize
MinimumWorkingSetSize
Name
OSCreationClassName
OSName
OtherOperationCount
OtherTransferCount
PageFaults
PageFileUsage
ParentProcessId
PeakPageFileUsage
PeakVirtualSize
PeakWorkingSetSize
Priority
PrivatePageCount
ProcessId
QuotaNonPagedPoolUsage
QuotaPagedPoolUsage
QuotaPeakNonPagedPoolUsage
QuotaPeakPagedPoolUsage
ReadOperationCount
ReadTransferCount
SessionId
Status
TerminationDate
ThreadCount
UserModeTime
VirtualSize
WindowsVersion
WorkingSetSize
WriteOperationCount
WriteTransferCount

Does 
this help ?

Rosh

Ps. Someday we will do a session on windows 
scripting in b.net, that should be a lot of fun :)

-----Original 
Message-----
From: Malpani, Pooja
Sent: Monday, August 25, 2003 6:07 
PM
To: James, Roshan


Hello evry 
1
 i have  asked this question may tm  but until know ia 
hven't got  reply
  i want to know  is ther  any 
function  win32API that  will return  me the appliaction 
which  was just  started   by th user   i wnat to 
get this  information .
 either  appliaction is  started 
by  program ur shortcut even through icons or there is any function through 
which  i can check if particular  application has been activated 
or  not

 PLz Reply Me Soon
 Muddasir 
Qidwai
 HAve A nice day
BYe
With REgards
  


-----------------------------------------------------------

To stop getting this e-mail, or change how often it arrives, go to your E-mail 
Settings.
http://groups.msn.com/bdotnet/_emailsettings.msnw

Need help? If you've forgotten your password, please go to Passport Member Services.
http://groups.msn.com/_passportredir.msnw?ppmprop=help

For other questions or feedback, go to our Contact Us page.
http://groups.msn.com/contact

If you do not want to receive future e-mail from this MSN group, or if you received 
this message by mistake, please click the "Remove" link below. On the pre-addressed 
e-mail message that opens, simply click "Send". Your e-mail address will be deleted 
from this group's mailing list.
mailto:[EMAIL PROTECTED]

Reply via email to