Skip to main content
GameDev.net gamedev.net
๐Ÿ”’ Locked

Why I can't hide certain apps?

Started by noatom May 3, 2013 at 1:17 PM 4 replies 1.5k views
Original Post
noatom
noatom

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?

SiCrane
SiCrane
Did you check the return value for FindWindow() to make sure that it succeeded?
noatom
noatom

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

Dave Hunt
Dave Hunt

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...

noatom
noatom

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

Vortez
Vortez

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

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.