I’m using Visual Basic 2008
for example i have running notepad.exe, can i hide notepad window, and then if i need it to show it again?
thanks.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Process.GetProcessesByName()passing"notepad".MainWindowHandlefrom the returned process.ShowWindow()passingSW_HIDEorSW_SHOWto hide/show the window.The P/Invoke signature is:
The
ShowWindow()topic lists the numeric values for theSW_*flags.Thanks to @Alex K for suggesting as a comment the use of
ShowWindowAsync()rather thanShowWindow().From the documentation: