Reputation: 159
On MS Windows one can obtain a window handle by using:
WindowHandleToPlatform(winhandle).wnd
How does one obtain a MacOS Window "id":
for example a function that accepts a window id:
CGWindowListCreateImage(
CGRect screenBounds,
CGWindowListOption listOption,
CGWindowID windowID, // <------------------ here
CGWindowImageOption imageOption);
Upvotes: 3
Views: 246
Reputation: 596352
On Windows, WindowHandleToPlatform()
retrieves a TWinWindowHandle
for a given TFmxHandle
. TWinWindowHandle
contains (amongst other things) the window's HWND
.
On OSX, WindowHandleToPlatform()
retrieves a TMacWindowHandle
, which contains the window's NSWindow
, NSView
, NSTrackingArea
, and NSOpenGLView
objects. You can get a CGWindowID
from the NSWindow.windowNumber
field, eg:
WindowHandleToPlatform(winhandle).Wnd.windowNumber
Upvotes: 4