I've read the edited version of the question, and if I understand you correctly, you want to run a program from SSH without showing you the GUI... you just want to run the program and it depends on X Windows, so you need it to connect somehow to X Windows on the server itself.
There are two things you need to do. You need to allow connections from outside of X Windows, and then you need to tell the shell (in SSH) which X server to bind to.
First, allow incoming connections to the X server. Open up a terminal window in X Windows on the server machine. (You must have access to that, otherwise you cannot do this.)
Issue the following command:
xhost +
It should tell you "connections allowed from all hosts" or something to that effect.
Then, while still remaining in X Windows, issue:
echo $DISPLAY
This will tell you the display ID. Write it down or remember it. Typically it will be ":0" or ":0.0" but don't worry if it's different.
That's all you need to do from within X Windows itself.
Now SSH into the server from wherever you want. Issue the command:
export DISPLAY=[what-the-echo-command-gave-you]
And that should be it! Now you should be able to run any X windows from that SSH shell, and it will pop up on the local X Windows server.
Hope it helps!
Best Answer
The proper method seems to have some issue:
http://cygwin.1069669.n5.nabble.com/Windows-GUI-programs-e-g-notepad-start-but-are-invisible-after-ssh-login-td56256.html
http://cygwin.com/ml/cygwin/2007-10/msg00334.html
So I try some hack. I create a cygwin_screen.cmd and put it in the Windows Startup folder.
start_screen.sh is simple and it will make sure that we have the screen to attach to.
Now I can remote login to Windows from ssh client and attach to that screen when I want to run the Windows GUI application.