Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Opening applications on specific screens progmatically

Posted on 2011-10-11
6
Medium Priority
?
195 Views
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 rights...my 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?
0
Comment
Question by:Evolution-Recruitment
  • 4
6 Comments
 
LVL 40
ID: 36948660
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

0
 

Author Comment

by:Evolution-Recruitment
ID: 36950030
One of the applications is Internet Explorer. I'll give it a shot anyway.
0
 

Author Comment

by:Evolution-Recruitment
ID: 36950331
It didn't work. I thouight I would take the chance. Thanks anyway Burger.
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 83

Expert Comment

by:CodeCruiser
ID: 36951546
0
 

Accepted Solution

by:
Evolution-Recruitment earned 0 total points
ID: 37050523
Ended up using UltraMon for this,.
0
 

Author Closing Comment

by:Evolution-Recruitment
ID: 37074939
ok
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction When many people think of the WebBrowser (http://msdn.microsoft.com/en-us/library/2te2y1x6%28v=VS.85%29.aspx) control, they immediately think of a control which allows the viewing and navigation of web pages. While this is true, it's a…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an anti-spam), the admin…
Enter Foreign and Special Characters Enter characters you can't find on a keyboard using its ASCII code ... and learn how to make a handy reference for yourself using Excel ~ Use these codes in any Windows application! ... whether it is a Micr…
Suggested Courses

571 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