Solved

Browser to cover part of screen

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

Problems using Powershell and Active Directory?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

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

Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

825 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