Post the code we will show you where you went wrong.
To answer your question:
Store the window handle in a variable and when clicking the button use the
IsWindow API to check if it returns true; if it does use the
SetForegroundWindow API to bring it forward if not open it.