Hi,
If you need a VS windows app to retrieve a value of an open GP window, or even an open data set, you can use Visual Studio Tools for Dynamics GP.
However, VSTools is licensed separately the Dynamics GP Developer's Toolkit, so you would have to have purchased the Developer's Toolkit license to use this method.
Let me know if you have the toolkit license and I can help you with the code to do what you need.
Thanks,
Steve Endow
Dynamics GP Certified Trainer
Dynamics GP Certified Professional