TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Daniel van Pletzen
NA
25
0
Hiding and showing process
Sep 19 2007 3:01 PM
hey, i got difficulty hiding and showing lots of instances of console app made in c++, im able to hide them but once hidden i cant show them here is code
when i try hide the programs i am able to get a process.mainwindowhandle, but once hidden mainwindowhandle becomes 0. there a way to get hwnd from pid maybe ?
im using showwindow api call from user32.dll
[DllImport("user32.dll")]
private static extern bool ShowWindow(IntPtr hWnd, int nCmdShow);
Process[] lines;
Process a;
lines = Process.GetProcesses();
foreach (Process p in lines)
{
if (p.ProcessName.ToLower() == "prog")
{
ShowWindow(p.MainWindowHandle, 5);
MessageBox.Show(p.MainWindowHandle.ToString());
}
}
Reply
Answers (
2
)
Generating executables programmatically
regExpr