No, I mean track positions and sizes of windows of any applications, include not created by Lazarus.
before anything, I don't have a cross platform solution.
In Windows, it's not hard to do but, it could potentially be a CPU hog. The solution is to enumerate the windows every "n" milliseconds and for every top level window get its window rectangle (not the client's.) Compare that value (which is the current) with a value that was previously saved. Anytime the window rectangle is different it means that either the position, the size or both changed.
The amount of CPU used will depend on how often you decide to enumerate the windows. if you enumerate no more often than every 20ms, the CPU usage should likely be acceptable.
HTH.