1

I'm debugging a Windows application with IDA Pro and I see that at one point it calls FindWindowA and successfully locates a window with the given class name.

However when I use Spy++ to locate the windows with the given class name, it just doesn't seem to exist anywhere and I can't find it.

I wonder how could I find this same window that application internally somehow finds when it calls FindWindowA? I wonder why my external application can't find the same window...

user1354557
  • 2,413
  • 19
  • 29
bodacydo
  • 75,521
  • 93
  • 229
  • 319

2 Answers2

3

Typically, a window cannot hide from Spy++ (unless a program intentionally hooks Spy++ to hide the window). Spy++ (and other similar programs) are designed to show all windows that are known to the OS.

In any case, using IDA, you can see the actual parameter values that are being passed to FindWindowA(), so just copy those same values into your own code. If that other app can find the window, so can your app using the same parameter values.

Remy Lebeau
  • 555,201
  • 31
  • 458
  • 770
  • You can hide a window from Spy++ just fine if you hook into the Spy++ process ;) – user1354557 Jul 07 '16 at 18:01
  • @user1354557: OK, but realistically how many programs would actually do that? And besides, Spy++ is not the only spy program available. Do you expect programs to hook every spy program in existence? – Remy Lebeau Jul 07 '16 at 18:03
  • No I don't; I can think of no useful application for this. But it only takes one counterexample to make the first sentence untrue – user1354557 Jul 07 '16 at 18:06
  • Wouldn't you just hook ALL the programs? – SamB Sep 26 '16 at 00:05
2

In my case, I could not find the window I was searching for because I was using the 32 bit version instead of the 64 bit version (the software I was searching for is 64 bit). So I had to use spyxx_amd64.exe instead of spyxx.exe under "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\Tools".