Jump to content
  • Advertisement
Sign in to follow this  

Help Finding window handle

This topic is 5219 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi. I know it seems easy but I need to get the handle of any window that is currently on the desktop when my program is run. I could use enumwindow() I guess but I'm new to programming and I need help with this function. Oh, I'm using C++ win32 and its a console program. The window that I'm wanting to move wasn't created by me. The title of this window changes all the time so I need something besides just FindWindow. I'm using Findwindow right now and it is annoying to keep using Spy++ and then compile my program everytime. I got the classname using the GetClassName function and so I tried it with Findwindow but it didn't work for some reason. It was like this: HWND hwnd; hwnd=FindWindow("#32770",NULL); but it didn't work. ??? Is it the NULL that is the problem? That is definitely the correct class name ?

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!