|
-
May 6th, 2009, 09:57 AM
#1
How to hide/show running process.
I have a situation where I launch several processes from a program using CreateProcess() function.
At one time, I have to access all these processes, one by one and tell them to hide/show (minimize/maximize). Is there a way to do it? I'm looking something like what I use to terminate the processes.
Like this:
Code:
int numHandlers = this->vProcessInformations.size();
for (int c=0;c<numHandlers ;c++)
{
PROCESS_INFORMATION *pInfo = NULL;
pInfo = this->vProcessInformations[c];
HANDLE handle = pInfo->hProcess;
DWORD exitCode = NULL;
bool bRet = false;
DWORD lastError;
bRet = GetExitCodeProcess(handle,&exitCode);
lastError = GetLastError();
TerminateProcess(handle,(UINT)exitCode);
CloseHandle(handle);
delete pInfo;
}
I currently use IPC using mail slots to send command messages to other processes where each process creates mail slot handle unique to it from start parameters so I can access them all.
But this has many flaws in it since I iterate through processes very fast, not all processes get the message sent.
I basically need fast and reliable technique that will iterate through processes (created by myself) and send them commands to execute.
Any recommendations on this topic?
Thanks.
You just divided by zero, didn't you?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|