Solved

Browser to cover part of screen

Posted on 2013-05-16
2
374 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 25

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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Delphi 10 Seattle Dataset Actions 5 71
Convert Jpg /PNG To GIF 5 102
find a node in VST 2 47
QRReport  TQrmemo vertical stretching 1 37
The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
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…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

706 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

13 Experts available now in Live!

Get 1:1 Help Now