Complicated indeed, but if you get this done, you'll get at least an enormous ego-boost
About the control/element ID or name thingy, you'll have to loop through the existing items.
For the window IDs, you'll have to prompt immediately
if the window is pasted in the same file..