Results 1 to 4 of 4

Thread: Show/Hide window from process handle on Mono

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Dec 2012
    Posts
    70

    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.

  2. #2
    Frenzied Member
    Join Date
    Feb 2003
    Posts
    1,945

    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.

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Dec 2012
    Posts
    70

    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.

  4. #4
    You don't want to know.
    Join Date
    Aug 2010
    Posts
    4,578

    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.
    This answer is wrong. You should be using TableAdapter and Dictionaries instead.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width