[Gtk-sharp-list] Presenting window of - or calling - another running instance

Daniel Borgmann spark-mailinglists@web.de
Fri, 02 Jan 2004 16:51:36 +0100


Hello,

my problem is the following: I would like to have only one window open
at any time for a document (similar to spatial Nautilus in GNOME 2.5). I
thought that the best way to do this might be to check if another
instance of my program is already running and then let this instance
handle the situation.
Unfortunately, the only information I could find about this involves
certain Win32 DLLs, like at this tutorial:
http://www.codeproject.com/csharp/oneProcessOnly.asp

So I'm wondering, can I do anything useful with the MainWindowHandle in
Gtk#? I tried using
gtk_window_present(Process.GetCurrentProcess().MainWindowHandle), but
that led to "assertion `GTK_IS_WINDOW (window)' failed".

Or is there another/better way to solve the problem I mentioned above? 
Thanks in advance for any pointers!

Daniel