Sign in to follow this  
Followers 0
noatom

Why I can't hide certain apps?

5 posts in this topic

HWND h;
h = FindWindow(NULL,"firefox");
ShowWindow(h,FALSE);

 

 

The above code should make the window for mozilla firefox get hidden,but nothing happens.Can anybody give me an ideea why?

0

Share this post


Link to post
Share on other sites
Did you check the return value for FindWindow() to make sure that it succeeded?
0

Share this post


Link to post
Share on other sites

yes,it doesn't find firefox.I tried firefox.exe,Firefox all possible names,but it doesn't find it.Why? 

0

Share this post


Link to post
Share on other sites

FindWindow uses GetWindowText to get the window name for comparison. It is unlikely that your firefox window only has the word "firefox" in it's title...

1

Share this post


Link to post
Share on other sites

damn.I always check msdn for functions,but this time I didn't,and it bit my... Thanks a lot!

0

Share this post


Link to post
Share on other sites

It's better to give the class name rather than windows caption. Just use spy++ or a similar tool to get it.

1

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0