Opening applications on specific screens progmatically

Posted on 2011-10-11
Last Modified: 2012-05-12
I am trying to open an application on a specific screen. I need to be able to open an application NOT on my primary screen. I have a VB6 application but the VB6 APIs don't work properly. VB.Net API seem to work sort of. I can size the window using the SetWindowPos API but I need to be able to send the window to
x1 =  -1280
y1 =  -1024
x2 = 0
y2 = 0
yeah that left hand screen is my 2nd screen and therefore the x,y values fall into the negative.

all I care about is being able to place a window on a specific screen. For that I need the relevant Window Handle (which is possible to get from New Process.mainwindowhandle) and something to set the window's postion in the virtual desktop. Anybody know how?
Question by:Evolution-Recruitment
    LVL 40

    Expert Comment

    by:Jacques Bourgeois (James Burger)
    If the application is .NET, the following shouls work. I am not sure if it would work with a COM application however:
    Dim frm As Form = CType(Control.FromHandle(process.MainWindowHandle), Form)
    frm.Location = New Point(-1280, -1024)

    Open in new window


    Author Comment

    One of the applications is Internet Explorer. I'll give it a shot anyway.

    Author Comment

    It didn't work. I thouight I would take the chance. Thanks anyway Burger.
    LVL 83

    Expert Comment


    Accepted Solution

    Ended up using UltraMon for this,.

    Author Closing Comment


    Featured Post

    Why You Should Analyze Threat Actor TTPs

    After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

    Join & Write a Comment

    Suggested Solutions

    Well, all of us have seen the multiple EXCEL.EXE's in task manager that won't die even if you call the .close, .dispose methods. Try this method to kill any excels in memory. You can copy the kill function to create a check function and replace the …
    A while ago, I was working on a Windows Forms application and I needed a special label control with reflection (glass) effect to show some titles in a stylish way. I've always enjoyed working with graphics, but it's never too clever to re-invent …
    To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…
    In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor ( If you're interested in additional methods for monitoring bandwidt…

    754 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    16 Experts available now in Live!

    Get 1:1 Help Now