I've never in 5+ years of vim usage and writing all kinds of custom plugins been able to properly figure out how to use the
gvim -P windowname command line option.
According to vim's own documentation, it's used to pop a gvim window into an MDI environment. Perhaps the main problem is that MDI sort of died with the introduction of things like Silverlight, WPF (Windows Presentation Foundation) and later HTML5. So there are very few programs still even using MDI. For example, Eclipse uses a tabbed environment (although there is a fantastic Vim pop-in solution for that called Eclim).
Every time I've tried to use it, it's failed, even with programs that have an MDI environment. MDI meaning multiple document interface - almost like a remote desktop session - where you can move windows around, resize them, collapse and tile, etc.
Whenever I try it, it just dies as if I didn't do anything, spitting out an error about an invalid window name. I've been totally unable to figure out how to use it, or what the correct "window name" is that it's looking for. I've tried the name of the program, the window title, and even the raw process name.
Does anyone know how to correctly use the -P command line parameter for gvim?