Solved

Browser to cover part of screen

Posted on 2013-05-16
2
382 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 26

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

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…
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…

910 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

22 Experts available now in Live!

Get 1:1 Help Now