Click here to Skip to main content
15,895,667 members
Please Sign up or sign in to vote.
2.00/5 (2 votes)
See more:
Note: You have run a hidden form, if passed, Process.GetCurrentProcessID is not eligible for the currently active form of ID, but get to the hidden form of ID, because the currently active form may be a WORD program, may also be a SQL program.
Please help !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Posted

1 solution

It is not clear from your question exactly what you are trying to do, but I will take a stab at it.
If you are the one starting the hidden form you can get its process ID.
For example if you start a program from your code called "MyProgram" using the Process.Start method it returns a variable of type Process from which you can get the ID.

Process myProc = Process.Start("C:\\MyProgram.exe");
int processId = myProc .Id;
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900