Thread: can't get HWND of C# application window

  1. #1
    Registered User Dinh Quoc Dat's Avatar
    Join Date
    Sep 2011
    Location
    hanoi
    Posts
    2

    Exclamation can't get HWND of C# application window

    Hi guys,

    I'm creating an application switcher like the functionality of Alt-Tab, however, facing a big problem.

    Coding with C++, i use 'EnumWindows' to find the windows, but can't find those windows which are C# application.

    Seems to be a problem with WPF?

  2. #2
    Unregistered User Yarin's Avatar
    Join Date
    Jul 2007
    Posts
    2,158
    Your doing something wrong. Outside of the exceptional, all windows can be with EnumWindows().
    *) Are you really enumerating all of them? If you enumerate using HWND_DESKTOP as the parent, only top-level windows will be found, often, windows that look like they're top-level, really aren't.
    *) What ever this window is, are sure it's actually a "window" window? For example, in I.E., input buttons and edit boxes look like genuine windows, but in fact they are not.
    I advise learning of this window using WinSpy++. If it fails to capture it, then my 2nd point is probably true.

  3. #3
    Registered User Dinh Quoc Dat's Avatar
    Join Date
    Sep 2011
    Location
    hanoi
    Posts
    2
    sorry guys, i made a filter function to filter out which windows don't have title, and accidentally the C# window that i need to find doesn't have title; that's the funny bug.

    yarin, tks for reply

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. find hwnd of certian controls on a window.
    By guitarist809 in forum Windows Programming
    Replies: 6
    Last Post: 05-13-2008, 12:08 AM
  2. Get a Window HWND by only knowing the ID.
    By Joelito in forum Windows Programming
    Replies: 4
    Last Post: 10-31-2006, 07:22 PM
  3. Basic Window application Help
    By The Brain in forum Windows Programming
    Replies: 2
    Last Post: 02-11-2005, 04:02 PM
  4. get handle of window of another application
    By meb4u in forum Windows Programming
    Replies: 2
    Last Post: 11-13-2002, 09:29 PM
  5. what ties the window class to the parent HWND?
    By Shadow12345 in forum Windows Programming
    Replies: 7
    Last Post: 10-25-2002, 02:26 PM

Tags for this Thread