Solved

Browser to cover part of screen

Posted on 2013-05-16
2
397 Views
Last Modified: 2013-05-19
I am using the following code to open a browser window full size:
ShellExecute(0,'Open', PChar'http://google.com'), nil, nil, SW_SHOWNORMAL);

I only want to have the browser cover half (or part) of the screen.  What code can I use to do this?

I am using Delphi 6.  Your help greatly appreciated.  Thanks.
0
Comment
Question by:rincewind666
2 Comments
 
LVL 27

Accepted Solution

by:
Sinisa Vuk earned 500 total points
ID: 39171452
Find browsers window handle with FindWindow
http://www.delphipages.com/forum/showthread.php?t=137431
....and set size/position with SetWindowPos:
http://msdn.microsoft.com/en-us/library/windows/desktop/ms633545%28v=vs.85%29.aspx
SetWindowPos(WBhandle,HWND_BOTTOM,Left,Top,Width,Height,SWP_SHOWWINDOW);

Open in new window

But, because it is hard to find right window I suggest to use approach used here:
http://stackoverflow.com/questions/13796063/how-to-get-handle-of-a-console-window-launched-from-my-gui-application
... a goal is to run browser different way, get process id and find main window from that proc. id.
0
 

Author Closing Comment

by:rincewind666
ID: 39178212
Many thanks for your help sinisav.  Greatly appreciated.
0

Featured Post

Industry Leaders: 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

Suggested Solutions

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
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 antispam), the admini…

679 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