0

I'm looking for a simple code to enumerate all windows on Windows 8, in order to look for a Desktop window with a specific title (example: "Untilted - Notepad").

I used:

BOOL WINAPI EnumWindows(
  _In_  WNDENUMPROC lpEnumFunc,
  _In_  LPARAM lParam
);

But according to the MSDN, For Windows 8 and later, EnumWindows enumerates only top-level windows of desktop apps..

Any alternative for Windows 8 ?

(PS: This follows up my java question, but I feel .net people can help me more on this).

Community
  • 1
  • 1
Majid Laissi
  • 19,188
  • 19
  • 68
  • 105
  • Your specification to look *"for a window with a specific title"* is not very detailed. What type of window? Desktop application or Modern UI application? Is this a top-level window or do you want to include child windows as well? Also, this is not really a .NET question - it's a Windows API question. *".NET people"* hardly ever use the Windows API. – IInspectable Nov 16 '13 at 16:55
  • 2
    EnumWindows only ever enumerated top-level desktop windows. The Win8 note is only there to remind you that it won't enumerate Store app windows. Mostly because they are not real windows. Not exactly a problem if this is really a Java question. – Hans Passant Nov 16 '13 at 17:10
  • Say you opened a test.txt file with notepad. You'll have a window called "Notepad - test.txt". – Majid Laissi Nov 16 '13 at 19:02
  • Sorry for calling you .Net people :p – Majid Laissi Nov 16 '13 at 19:03

0 Answers0