https://stackoverflow.com/questions/350526/how-do-i-count-th...
I recommend using the desktop feature also mentioned there.
Now, if I can only get emacs daemon mode to maintain state so if I abruptly disconnect and reconnect with emacsclient over X11 I get the state restored exactly where I left off, so that even the screen is painted exactly where I left off, down to the cursor position. Running something like VNC is a non-starter on my locked-down WinPC, unfortunately.