0
CFTypeRef focusedWindow;
AXUIElementCopyAttributeValue(
        frontMostApp, kAXFocusedWindowAttribute, (CFTypeRef *)&focusedWindow
);

in this case, How do I get window number from focusedWindow?

Window number is like [[NSApp mainWindow] windowNumber]

Hwansoo Kim
  • 286
  • 2
  • 11
  • A CFTypeRef is just a generic CF object; it's the counterpart to Foundation's NSObject. You cannot expect just any CFType to have a window number, because that doesn't make sense for most objects. An AXWindow or AXUIElement might, but, well, Chuck already said it. – Peter Hosey Jan 20 '11 at 15:34

1 Answers1

1

It's an AXUIElement, and unfortunately, you can't get its window number AFAIK.

Community
  • 1
  • 1
Chuck
  • 234,037
  • 30
  • 302
  • 389