-4

I have window Rules of Survival title: "Rules of Survival 1.120471.124472".

HWND window = FindWindow(NULL, "Rules of Survival 1.120471.124472");

how to find title name in rulesofsurvival.exe

pleas give me example

P.S. sorry for my bad English

pCoder
  • 11
  • Can you clarify your question? Don't you set the title in your application? – Nico Haase Jan 14 '18 at 17:42
  • Why do you assume, that the window title were stored verbatim in the executable image? It could just as well be constructed at runtime. Since it apparently contains a version number, this is likely, too. – IInspectable Jan 14 '18 at 19:05

1 Answers1

1

The easiest way would be to figure out what the window class of the target window is (using a tool like spy++) then use FindWindow/FindWindowEx with that class name.

Harder would be to enumerate all top level windows using GetDesktopWindow/GetWindow then use GetWindowThreadProcessId to get the thread and process ID that owns the window.

SoronelHaetir
  • 11,346
  • 1
  • 8
  • 18