Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    Visual Basic




System.Diagnostics.Process - How To Reference


Hope someone can help me.

How do i go about referencing the system object, in rticular to reference a process. Is it a reference that needs to be added into my project or am I missing something.

When I say referencing I mean that the VB editor recognises that it is a reserved word and pops up the intellisense window.

thanks




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Newbie Question [Launch An App With System.Diagnostics.Process]
I am a geezer trying to come into the 21st century and learn VB.Net and replace basic, fortran and Pascal with which I am familiar.

I am tring to read a file, post the text in a text window, have that text stay put in the window long enough to read it and then decide whether or not to continue. I would like a press a key to continue but can't figure out how to do that with keyPress--the program continues on its own.

so, I decided maybe to launch NotePad and write data to it I can't find the commands to write to it.

I found a code on msdn library to launch NotePad
Shell("c:winnt
otepad.exe", AppWinStyle.MaximizedFocus, False, -1)

Dim p As System.Diagnostics.Process = New Process
p.StartInfo.FileName = "c:winnt
otepad.exe"
p.StartInfo.WindowStyle = ProcessWindowStyle.Maximized
p.StartInfo.UseShellExecute = False
p.Start()

But it doesn't seem to be an object which I can write text to. Help please.

frustrated

glenn

Invalid Qualifier When Calling System.Diagnostics.Process.Start
Hi All,

I get this "Invalid Qualifier" compiler error on "System.Diagnostics.Process.Start". I done some research online with no avail.

Any help is really appreciated!!

Thanks,
Tabbey


Moved from VB.NET to VB General



Edited by - djjeavons on 8/17/2005 3:50:42 PM

How To Know Which Running Process Is A System Process
I have a piece of code which gives me the list of currently running processes in vb. Know I want to sort those processes according to their type for example : system processes seperatly etc.

Any ideas on this?

Critical Process (System Process)
Hello

Iam So Happy To be Here With The Greatest Programers In The World
And Iam so sorry for My First message Is A question

Iam really In A problem

Iam Making A program That Required Me Somethings But It's very Hard For Me

My problem Is :

My Program running On Win XP
So It's apear In Two Tab In Task Manager
The First Tab 's Name is Applications I can Ti Hide My program From It
But The second Tab 's Name Is Process So The All Process That Runing on Windows are apearing in this tab So The User Can End Any Process with easly But He Can't End Any System Process apear In the Process Tab

So I wanna to Make My Program Critical process Or System Process So The User Can't Ending My Program from The process Tab

I Hope helping me

And I will Wait For Ur Answer

Bye

Cross Process Reference With DOS Box/DOS Programs
I posted sumthin' regardin' game hackin', and someone help
me with this cross process reference method.
Basically it allows me to view and modify values contained within
other process' or program's memory.
Sort of GameHack...
So, I succeed in modifying W32 programs, however, that's not
the case with DOS programs.
How can I do that?

Thx

Chinese Diagnostics.
I'm in an awkward predicament. I'm using a Chinese language version of Windows+VB6+MS SQL Server. I don't read Chinese. I'm actually teaching some programming classes in China. Mostly stuff that I know, and I'm a very experienced programmer (well, very old anyway) - unfortunately I got landed with VB6+MS SQL Server - which I've had to get up to speed with over the weekend.

So, I'm trying to set up SQL servers in Chinese, Modifying (guessing) datalink settings (in the Data View window) in Chinese, and running a simple program to connect to the database that gives me an error message in Chinese (after a delay that suggests it's trying to do something).

It has some English...

"Run-time error '-2147467259 (80004005)':
[Microsoft][ODBC SQL Server Driver][DBNETLIB]SQL Server" - then chinese....

It happens when I call ADODB.Connection.Open

I suspect my ConnectionString is wrong. I've tried a few things and got various Chinese diagnostics - but nothing that gives me a clue.

I just want to get at the "pubs" example for now. (I can see it's structure in the Data View window). Everything is local, on the same computer. No need for security.

If I got this working, I'd like to be able to set up a blank database in which I could create new tables under program control. The program is not a problem - but connecting to the database to start with is my barrier.

Any suggestions?

Pass Reference Of Current Object To Out Of Process COM Server?
I've got an application that uses an COM server to generate report data.  

The server is set up with a main class interface cReport and various classes that implement it.  

In the main application I have the following code:

Private mVarReport as cReport

Public Sub Generate()
    set mVarReport = CreateObject("MyClass.cBuyerReport")
End Sub


I'd like to implement events into the COM server, however I have a serious need to use an interface to define the objects in the client, and you can't implement events defined in the interface :(

What I tried to do is pass a reference of the current object using


     mVarReport.ParentObject = Me


so I can notify the client when the server is done operating (only way I can think of to achieve a callback like operation in this situation) but I get an
Error '98':
"A property or method call cannot include a reference to a private object, either as an argument or as a return value"

Any ideas on what to do to resolve this?

Thanks in advance!

--Michael P. Gerety

[vb6] Do I Have To Reference Anything To Use System.io ??
Can anyone help mi ?
Do i have to reference anything in my vb project to use the system.io ?

Imports System
Imports System.IO

Option Explicit

Private Sub cmdExit_Click()

End

End Sub

Private Sub cmdOpen_Click()

Dim FILE_NAME As String
Dim objReader As New StreamReader

FILE_NAME = App.Path + "Test.txt"

txt1.Text = objReader.ReadToEnd(FILE_NAME)

objReader.Close


End Sub

anything wrong with the above code ? i got a compile error : Invalid outside procedure when i run the program.

System Drawing As Reference In Vb
how can i use the system.drawing as reference in visual basic6.0. well i can handle this reference in vb.net easily. but unable to use it in vb.

Getting System Process Too
i used this nice code
http://vbnet.mvps.org/index.html?cod...pprocesses.htm
however i want it to show the system proccess too ?
Can anyone enlighten me with how to do it ?
Thanks

Ending A System Process
Hi, I am using v6.0 and I am making an alarm clock that opens the selected media file in windows media player. I have the program working perfectly up to the point of stopping the media player. I dislike the look the of the WMP control in VB so it opens in a completely new window.

My question is: How do you end a system process? Is there a simple, maybe one to a couple lines of code to close it? If so, what is it?

Critical System Process
some applications in task manager cannot be stopped.
how to make the same thing to my application?

How To Kill A System Process?
hi,
there is any way to kill a system process?
thanks a lot for your help

Getting VB To Kill A System Process
Hiya guys!

I was wondering if someone could give me pointers on the following problem. I'm trying to create as part of a bigger program a screen that copies task manager and allows the user to select a system process (not application) and kill it. Any help on that?

Thanks guys (oh yea and girls)!

JP

How To Kill A System Process?
hi,
there is any way to kill a system process?
thanks a lot for your help

Kill A SYSTEM Process
Hello: I am trying to kill off a system process - it is called 'proquota.exe'

I normally kill processes with the following code:

Function KillProcess(ByVal ProcessID As Long) As Boolean
    Dim lngHProcess As Long
    On Error GoTo KillProcessError
    'get/open the process handle from the process ID - for terminating
    lngHProcess = OpenProcess(4, 1&, ProcessID)
    'kill the process
    TerminateProcess lngHProcess, 1&
    'close the handle
    CloseHandle lngHProcess
    KillProcess = True
    Exit Function
KillProcessError:
    KillProcess = False
    Err.Clear
End Function

But it will not work for this process it simply won't go away (even though I can kill the process manually via task manager). I suspect I do not have enough privelige to kill this process (even though I am logging on with Admin rights).

Any ides how I can do away with this process??

Thanks

Icarusbop

Edited by - icarusbop on 6/15/2005 4:46:42 AM

Kill Off A System Process
Hello: I am trying to kill off a system process - it is called 'proquota.exe'

I normally kill processes with the following code:

Function KillProcess(ByVal ProcessID As Long) As Boolean
    Dim lngHProcess As Long
    On Error GoTo KillProcessError
    'get/open the process handle from the process ID - for terminating
    lngHProcess = OpenProcess(PROCESS_TERMINATE, 1&, ProcessID)
    'kill the process
    TerminateProcess lngHProcess, 1&
    'close the handle
    CloseHandle lngHProcess
    KillProcess = True
    Exit Function
KillProcessError:
    KillProcess = False
    Err.Clear
End Function

But it will not work for this process it simply won't go away (even though I can kill the process manually via task manager). I suspect I do not have enough privelige to kill this process (even though I am logging on with Admin rights).

Any ides how I can do away with this process??

Thanks

Icarusbop

Edited by - icarusbop on 6/15/2005 6:28:46 AM

Open System's Process.i Need A Key!
Form1
Code: Option Explicit

Private Declare Function OpenProcess Lib "kernel32" (ByVal dwDesiredAccess As Long, ByVal bInheritHandle As Long, ByVal dwProcessID As Long) As Long
Private Sub Command1_Click()


Call UpProcess
Call FindProcess("svchost.exe")

Dim Phandle As Long
Phandle = OpenProcess(PROCESS_ALL_ACCESS, False, dwProcessID)
Debug.Print Phandle

End Sub

module
Code:Option Explicit
Global dwProcessID As Long
Declare Function Process32First Lib "kernel32" (ByVal hSnapshot As Long, lppe As PROCESSENTRY32) As Long
Declare Function CreateToolhelp32Snapshot Lib "kernel32" (ByVal dwFlags As Long, ByVal th32ProcessID As Long) As Long
Declare Function lstrcmpi Lib "kernel32.dll" (ByVal lpString1 As String, ByVal lpString2 As String) As Integer
Declare Function Process32Next Lib "kernel32" (ByVal hSapshot As Long, lppe As PROCESSENTRY32) As Long
Declare Function CloseHandle Lib "kernel32" (ByVal hObject As Long) As Long
Public Type PROCESSENTRY32
dwSize As Long
cntUseage As Long
th32ProcessID As Long
th32DefaultHeapID As Long
th32ModuleID As Long
cntThreads As Long
th32ParentProcessID As Long
pcPriClassBase As Long
swFlags As Long
szExeFile As String * 1024
End Type
Public Const TH32CS_SNAPPROCESS = &H2
'寻找进程PID的定义
Declare Function OpenProcess Lib "kernel32" (ByVal dwDesiredAccess As Long, ByVal bInheritHandle As Long, ByVal dwProcessID As Long) As Long
Global Const PROCESS_ALL_ACCESS = &H1F0FFF
Declare Function GetCurrentProcess Lib "kernel32" () As Long
Declare Function OpenProcessToken Lib "advapi32" (ByVal ProcessHandle As Long, ByVal DesiredAccess As Long, TokenHandle As Long) As Long
Declare Function LookupPrivilegeValue Lib "advapi32" Alias "LookupPrivilegeValueA" (ByVal lpSystemName As String, ByVal lpName As String, lpLuid As LUID) As Long
Declare Function AdjustTokenPrivileges Lib "advapi32" (ByVal TokenHandle As Long, ByVal DisableAllPrivileges As Long, NewState As TOKEN_PRIVILEGES, ByVal BufferLength As Long, PreviousState As TOKEN_PRIVILEGES, ReturnLength As Long) As Long
Global Const SE_PRIVILEGE_ENABLED = &H2
Global Const SE_DEBUG_NAME = "SeDebugPrivilege"
Public Type LUID
LowPart As Long
HighPart As Long
End Type
Public Type LUID_AND_ATTRIBUTES
TheLuid As LUID
Attributes As Long
End Type
Public Type TOKEN_PRIVILEGES
PrivilegeCount As Long
Privileges As LUID_AND_ATTRIBUTES
End Type

Public Function FindProcess(lpszprocess As String)
Dim pe32 As PROCESSENTRY32
Dim hSnapshot As Long
pe32.dwSize = Len(pe32)
hSnapshot = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0)
Call Process32First(hSnapshot, pe32)
Do
If lstrcmpi(pe32.szExeFile, lpszprocess) = 0 Then
dwProcessID = pe32.th32ProcessID
Exit Function
End If
Loop While Process32Next(hSnapshot, pe32) <> 0
Call CloseHandle(hSnapshot)
End Function
Public Function UpProcess()
Dim TokenHandle As Long
Dim MyLuid As LUID
Dim anfy As TOKEN_PRIVILEGES
Dim PreviousState As TOKEN_PRIVILEGES
Dim ReturnLength As Long
Call OpenProcessToken(GetCurrentProcess(), &H28, TokenHandle)
Call LookupPrivilegeValue("", SE_DEBUG_NAME, MyLuid)
anfy.PrivilegeCount = 1
anfy.Privileges.TheLuid = MyLuid
anfy.Privileges.Attributes = SE_PRIVILEGE_ENABLED
ReturnLength = 0
Call AdjustTokenPrivileges(TokenHandle, False, anfy, Len(PreviousState), PreviousState, ReturnLength)
End Function


 
It can open system's process~

How To Study The Flow Of Process Of The System?
Hello guys,

I am new hire as a programmer of the company here in our country. My boss gives me a bundle of codes to study the flow of process of the project. Since I am new with this project, its hard for me to point out where to start to study. Hope you can give me tips on how to do this. Thanks guys. More power to the forumers here in www.xtremevbtalk.com.

Thanks in advance..


Neo_phyte

Determine If System Is In Process Of Shutting Down?
Is there any way to determine if the computer is in the process of shutting down?

I ask because I have some code in my Form_Unload that I do not want to execute if the system is shutting down, rather than the program is just being closed by the user.

How To Differentiate Between A USER And A SYSTEM Process
How can this be done when using EnumProcesses, or other means?

How To Make A System Process Slow
hi all
how to make a system process slow
thanks
parthi

List Of All The Process Runing On The System
Hello to all of you,
 I am developing an application in VB.
In that application what I have to do when computer starts it automatically starts running and make a log file about all the running programms on the computer just like task manager in windows.

Any idea, clue or coding is welcome.

thanks in advance.



Anjali

Edited by - anjish on 3/11/2006 12:31:49 AM

Close System Process From OLE After Printing
In my program I have an OLE called "OLEppt" in a form called "PictsForm". I called the CreateLink method in a module as "PictsForm.OLEppt.CreateLink XXX (file location)", after this I print the presentation. The class for the OLE is a powerpoint show, so the application is never opened but the program is running as POWERPNT.EXE as a system process. I do the following operations in order to try to close this process:

    pictsForm.OLEppt.Delete 'pictForm.OLEppt.Close (It's used when CreateEmbed has been used)
    pictsForm.Cls
    Unload pictsForm

But the process keeps running and my program keeps running too. Next time when the sub is called, this process takes more and more memory, until one of the lines that the program is running cannot do it anymore. This line is
    
    pictsForm.OLEppt.object.PrintOut

I need to use PrintOut because if I print the form, only the first slide is printed. Either one is not working properly, CreateLink or CreateEmbed. I appreciate any suggestions you might have, thanks


 

Killing A System Tray Process
I am trying to kill an XP system tray process. I have reviewed several posts related to this and have written code to obtain a window handle (hWnd) of the process. I then envoke the PostMessageA (have also tried SendMessageA) to kill the process using it's window handle. This works for top level windows such as notepad.exe, etc. However, I seem to encounter a problem when the process only runs in the system tray.

Does anyone know how to kill the system tray process and remove the icon from the tray?

Thanks,
Rob

How To Register The ActiveX Exe Application Be System Process?
i write the application with ActiveX Exe,it done well.

now i want to put it on the server, the server was run at terminal mode,when i logout my account.the application was down.

did anyone knows how to make the application keep running when i logout the window?

This One Is Hard - MAPI In VB From A System Owned Process
I have this application wich runs under IIS and returns HTML code to the browser that called it. At one point in this app, I need to send e-mail (with or without attachements) using MAPI. When I go trough my code in debugging, everything works fine because the process is owned by my user. But when it is launched from IIS, the process is not launched by me but by System, so it is a system process. When I try to send mail this way, MAPI can't seem to loggin, it just hangs there and do nothing. Anybody have any suggestions?

Here is my code just in case you were wondering:

Code:
Public Function SendMail(Recipient As String, Sender As String, MailTo As String, MailFrom As String, Subject As String, Message As String, Optional FilePath As String) As Boolean
On Error GoTo ErrHandler
SendMail = True

With frmMail

.MSession.UserName = GetIniSetting("MAPIUserName")
.MSession.Password = GetIniSetting("MAPIPassword")
.MSession.SignOn
.MMessages.SessionID = .MSession.SessionID

.MMessages.Compose

.MMessages.RecipDisplayName = Recipient
.MMessages.RecipAddress = MailTo

.MMessages.MsgSubject = Subject
.MMessages.MsgNoteText = Message

If FilePath <> "" Then
.MMessages.AttachmentIndex = .MMessages.AttachmentCount
.MMessages.AttachmentPathName = FilePath
.MMessages.AttachmentPosition = Len(Message) - 1
.MMessages.AttachmentType = mapData
End If

.MMessages.Send False
.MSession.SignOff
End With

Exit Function

Exit Function
ErrHandler:
MsgBox Err.Number & " - " & Err.Description
Open "c:RCMS.txt" For Output As #1
Write #1, Err.Number & " - " & Err.Description
Close #1

SendMail = False
End
End Function

How To Get VB To Kill A System Process (not A Active Window)
Hiya

I was wondering if someone could help me. I'm trying to write code that will kill a program that is running in the background. It apears on the process list of taskmanager not on the application list.
Thanx
J

How To Update System Environment Variable Within The Process?
Hello All

I have problem in setting system environment variable within the process.

I am updating the system environment variable from my VB application
and reading the environment variable just after the updation.

I used the below code
--------------------------------------------------------------------------
RegSetValue HKEY_LOCAL_MACHINE, "SYSTEMCurrentControlSetControlSession ManagerEnvironment", IGXLPATH, CurPath

SendMessageStr HWND_BROADCAST, WM_SETTINGCHANGE, 0, "Environment"
--------------------------------------------------------------------------

If I read the system environment variable using Environ() function,
I am getting old value instead of updated one just after the above logic.


But If I close the application and run it again for the second time
I can able to read the correct value(updated one).

Is there any way of fetching the correct value(upated one) from the first run?

Can any body please help me regarding this.

Thanks
subbu









 

Terminating A System Tray Process And Icon In XP
I wish to terminate a process in Windows XP. The process is an executable that is shown only in the system tray. I have examined several posts regarding this and have implemented code that get's the windows handle, then call API SendMessageA (have also tried PostMessageA) to close the process. However, the icon is still displayed and the process still runs according to Windows task manager.

The code I have works for an application such as notepad which displays as a window. Is there any way to close a process in the system tray?

Thanks for any help,
Rob

Possible To Get "lag" Time Of A System And/or Process?
In my developing of one of my latest programs, I've opted to allow the user to change the program's priority settings through the use of SetThreadPriority and SetPriorityClass, for which I'd like to add an "automatic stability recovery" function that will automatically adjust the program's priority settings based on a scale of total system load and "lag" (response time) in an attempt to prevent an unstable environment that could lead to crash or loss of data.

So for example, if your ability to switch between applications fails to respond and overall system response time due to memory usage or CPU usage or whatever the case would be, the priority settings for the program will automatically reduce to defined sets of priority settings based on the amount of "lag".

Is there any way to measure how much lag there is in the response time? Or any suggestions on how to go about what I want to accomplish?

Thanks

Add Reference Library Crystal Report 9 ActiveX If Not Exist In Reference
I have a problem i want to use crystal report, the problem is when i want to add
crystal report in my reference it did not exist. Can anyone told me the solution for my problem...

Reference To Non-Shared Member Requires An Object Reference Error
I am getting a Reference to Non-Shared Member Requires an Object Reference on the (NorthwindDataSet.Customers) coding below. (NorthwindDataSet.Customers has squiggly Blue Line and Mouse hovered over has this error. Please see coding below. I just do not understand the weird error.
Any help to so I can proceed with my learning of VB. I am trying to learn a section of coding at a time and understand why I am getting these errors. This procedure is trying to filter a row and pull data.

Thanks for any help!

jjc9809





Private Sub btnCustomersFind_Click( _
ByVal sender As System.Object, _
ByVal e As System.EventArgs) _
Handles btnCustomersFind.Click

Dim filteredView As Data.DataView = _
New Data.DataView[B](NorthWindDataSet.Customers)

End Sub
End Class

Error Reference to a non-shared member requires an object reference is appearing on: NorthWindDataSet.Customers and has blue line underneath indicating the error in yellow.

Reference To A Non-shared Member Requires An Object Reference?
This is my code

Code:
Public Class Form1
Public Class Form1
Dim WebBrowser1 As WebBrowser
Dim url As String
Private Sub Form_Load()
url = "http://www.michaelwalshe.com"
WebBrowser1.Navigate(url)
End Sub

Private Sub WebBrowser1_DocumentComplete(ByVal pDisp As Object, ByVal URL As Object)
TextBox1.Text = WebBrowser1.Document.body.outerText
End Sub
End Class
End Class

Can anyone tell me why im getting this error? Thanks.

How To Get Path To User's "My Documents" When Running A "System" Process?
My program generates PDF files through a postscript printer driver. The UI portion of the code is called from my Port Monitor which makes it a "SYSTEM" process (ie not one started by the user).

When trying to access the path to "My Documents", I get "C:Documents and SettingsLocal Service" which is not the user's directory.

Tried:
various API Calls, environment variable with the same answer. Obviously I searched this forum at nauseum, The API guide and this forum.

My Options (as far as I can see right now):
Registry: HKEY_CURRENT_USER/Volatile Environment/HomePath or File searching through "C:Documents and Settings" for recent files to guess at who might be the current user. Frankly, I am not happy at either of these.

Am I missing something obvious? Thx a lot to anyone with suggestions.

Get Value Of "System Idle Process" In "Windows Task Manager" ?
Hello,

Is their any way to get the "System Idle Value" the same value that we see in the "Windows Task Manager"

I need this value for my program, if this value is around 90 or above , my program can start , if it is below , I will put a message telling "That he need more resources" or something like that.

Thank you for your help

Best Regards,
Didier.

Deleting A Reference From The Reference Library
How do I delete a reference from VB's reference library?

Getting Reference Path From The Reference Dialog Box
I am developing on VB5. Toward to bottom of the references dialog box there is a Location field that contains the path to the currently selected reference in the list box. The problem I am encountering is that the text box that holds the path does not wrap if the pathname exceeds the size of the textbox. The path is getting cut off and I can not view the end of it, and it is imperative that I do.

I have tried selecting the reference in the list box and select browse... button inthe hopes that the dialog box will navigate to the directory of the selected reference. But this is not the case.

Can anybody provide any suggestions on how to get this path. Is there a patch that will wrap the textbox? Does the textbox wrap in VB6?

Thanks in advance for any help.

Complicated Process (BUSSY, STACK ...), Need Make It Visible Process.
I am impoting millions of records from CDR(Call Detail Record) Data from GSM Data Cupture.
While the imporing process is going on, I am displaying some funs such "FileCopy.avi" clip, copy info and Progress timing.

The problem is that when the process begened, .avi file played and the progress started:

1. The application can't make all these things visible on the form.
2. All the application gets white color and looks like a BUSY.
3. So, the user thinks that the application may got STACK and tries to Exit it.


I want to get a form that presents the clip, capy info and progresses visible clearly.
Also I want to prevent my application from this full BUSSYNESS


Thank you in advance.

Shared Memory For Process - To - Process Communication
Hi there.

Is there a technique using VB6 to have separate applications communicate with each other through some sort of shared memory?

ProcA - writes some data into memory location X
ProcB - reads in data from memory location X
ProcB - writes response to memory location Y
ProcA - read in data from memory location Y.

A simple code snipet would be helpful if this is possible.

Thanks

Brent

Subclassing: Post-process, Pre-process, && Consume
I am using the vbaccelerator ssubtmr.dll for subclassing in my app, but I don't really understand what the difference is in pre-processing or post-processing windows messages.
These are the options:
Code:
Public Enum EMsgResponse
    emrConsume ' Process instead of original WindowProc
    emrPostProcess ' Process after original WindowProc
    emrPreprocess ' Process before original WindowProc
End Enum

Here is what I am trying to do...
I am trying to modify the code from the vbnet website that places an icon in the tray to use the vbaccelerator subclassing. The message I need to intercept is the WM_MYHOOK message. How do I know which of the above enums to use? I'm not sure if I am doing this right or not, but this is how I initialized the subclassing from form_load:
Code:
AttachMessage Me, Me.hwnd, WM_MYHOOK


Can somebody tell me if I am even on the right path or not??

As a subclassing newbie I am just curious...how many times do I have to crash vb before I pass newbie status?



God Bless America

Process Id's Of The Process Created By A Shell Command
Hi,
     Is it possible to find a list of process id's of the processes created by a batch file executed by a shell command.Can anyone give ideas on how to go about doing it.

With Regards
gopal

Ending A Process That Is Shown In Process Manager
Edited:

I found the zip file in this thread:
http://www.codeguru.com/forum/showt...6446#post936446

and it works okay, BUT how do I close a non-system instance of csrss.exe? What's happening is a virus I'm making a deletion program for opens up itself with the name csrss.exe (deliberately having that name to seem like the system process).

Getting Process ID From Process Handle ( Returned By ShellExecuteEx )
Hello,

Is there a way to get Process ID from process handle?
I got it from ShellExecuteEx with fMask = SEE_MASK_NOCLOSEPROCESS
so hProcess field contains process handle.
I need to start app and get it hWnd.
so I need process ID to Enumerate all windows, call
GetWindowThreadProcessId (hWndChild, hWndChildProcessID) function and
find the window that I've launched.

It looks very easy, and I saw a lot of the same questions, but I
didn't find any answer, just hints about using CreateProcess instead.
I don't want to use CreateProcess because of I have to run non
executable files sometime and I don't want to find command by file
extension in the registry, because of I can't use DDE. ( for example
Word2k works strange when I execute something like this:
c:program filesmicrosoft officewinword.exe my.doc
if there are no opened word documents, all works fine, but if I have
some documents opened, it tells me, that path to my.doc file
incorrect.

thank you.

P.S. This message posted to the "Visual Basic programming" and
"Visual C++ programming" groups.
--
Sincerely yours,
Alexander

Checking If Process Is Running By Process Id
Ok, I have searched the forums and have seen some similiar posts on checking if software is running but thats by .exe, what I want to know is how can you check if the software you started with shell is running, is there a way to check if that specific PID is still running or if it is not, any help would be GREATLY appreciated!

Thanks in advance!

Terminating The Previoue Process With Out Its Process ID.
Hello Friends,
I am having 3 EXEs like E1,E2 and E3. First 'E1' is executed, from 'E1' i am calling 'E2' and then from 'E2' iam calling 'E3', while executing 'E3', I have to close the previous processes 'E1' & 'E2'. Please guide me the way to acieve this.

Difference Between Process Handle And Process Id
I'm writing a service program which periodically fires off other tasks running in the background using the ShellExecuteEX API. The idea was to save the process information in a collection so that the same application is not fired off until the previous one has completed. I was calling OpenProcess with the hProcess member of the SHELLEXECUTEINFO structure and getting error 87 - 'The parameter is incorrect.' Rechecking the documentation, I find that OpenProcess requires a process id. Is this different from a process handle?? If so, how can I retrieve the processid from it's handle? Or do i HAVE to resort to CreateProcess, which returns the process id.
I don't want to wait for the process to terminate, as there may be other processes to fire up. I do however need to know when the thing has finished.

How To Add Things To System.ini Or System.dat So Program Runs When Windows Start ?
Hi,

Pls tell me how and what to add things to system.ini or system.dat so program runs when windows start ?

note: i am workin on a pc locking program.

thnx in advance

Kill Process With Process ID
Hello.

I gotta kill this process called pcscm.exe but I can't figure out how.

I figured out how to get a list of all the processIDs and return only the ones with pcscm.exe. Now I have to kill that processes but I've never closed anything without a handle.

Can someone help me? I've been trying to figure it out all morning.

I have attached an image to hopefully explain better what I want.

Thanks,
-Ober

Copyright 2005-08 www.BigResource.com, All rights reserved