Show/Hide window from process handle on Mono
I am writing an application in VB.Net to be run on Mono.
I can close a window from a process like so:
Code:
Dim procs = System.Diagnostics.Process.GetProcessesByName("Firefox")
procs(0).CloseMainWindow()
However I want to be able to show/hide this window as well, but I have to do so in a way that is compatible with Mono running on linux, so the common way I have seen of doing so through P/Invoke will not work
Is there a way to do this? Thanks.
Re: Show/Hide window from process handle on Mono
Hi, I don't know much about Mono, but do you want this to work on both Windows and Linux? I think that showing and hiding windows would depend on how the GUI works.
Re: Show/Hide window from process handle on Mono
It is running only on linux, but is being developed in Visual Studio. I am using a Virtual Machine running Ubuntu to test it.
Re: Show/Hide window from process handle on Mono
You do this in Windows by using the Windows API, which provides functions for manipulating windows that belong to other processes.
Obviously, Linux doesn't have the Windows API. To manipulate other applications' windows in Linux, you will have to figure out what the equivalent API is and use that.
Then, you need to write the code to use the Windows API when on Windows, and whatever Linux API on Linux. Finally, you should cover that up with an abstraction layer so the rest of your program doesn't care if it's on Windows or Linux.
I can discuss abstraction, but I've got no clue what the Linux equivalent of Windows API's methods are.