I am writting an application which must know when a window is resized or moved. I had a look on notifications but it seems it does not do what I expected.
Do you have any idea how I can achieve this?
I am writting an application which must know when a window is resized or moved. I had a look on notifications but it seems it does not do what I expected.
Do you have any idea how I can achieve this?
Give your window a delegate. The NSWindowDelegate protocol has windowWillResize:toSize:
and windowWillMove:
methods.
Given your response to Carl's answer, I'd suggest the Accessibility API, which can give you access (and I believe frame change notifications) for all windows, not just your app's.
If you want window size/ordering then take a look at CGWindow.h. CGWindowListCreateDescriptionFromArray() is probably what you want.
NSWindowList() is also useful for a list of windows.