-
Oct 15th, 2008, 05:37 AM
#1
Thread Starter
Lively Member
how to set size for popup window
Hi everyone, I use
Code:
lngOpenPage = ShellExecute(Frm1.hwnd, "Open", lblurl.Caption, 0&, 0&, 0&)
to open a new window. I saw only a "SW_SHOWNORMAL" parameter before. I have two questions:
1, How can I set the size for the window?
2, Is it possible to hide some parts of the URL in the browser (only show a part of it)?
Thanks for any help.
-
Oct 15th, 2008, 06:15 AM
#2
Re: how to set size for popup window
Originally Posted by VBKit
I saw only a "SW_SHOWNORMAL" parameter before.
Actually, there are a number of parameters that can be used.
Here is description of the API and all of its possible parameters.
-
Oct 15th, 2008, 12:30 PM
#3
Re: how to set size for popup window
1. You wouldnt use ShellExecute to set the size of a window. You would need to use SetWindowPlacement after the ShellExecute call for that.
If you wanted to set the size to maximized then use the SW_SHOWMAXIMIZED parameter. If you want it to set the size of the form to some specific normal size then you need to do as I stated with the SetWindowplacement API.
See my code in this thread for positioning the window.
http://www.vbforums.com/showpost.php...0&postcount=18
2. Where does a browser come into the picture here?
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum.
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it!
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6
-
Oct 15th, 2008, 05:44 PM
#4
Thread Starter
Lively Member
Re: how to set size for popup window
Thanks for your replies. I am opening up a browser based on a URL generated by VB, eg. http://www.productmates.com/index.ph...1&txtSTORE=151.
The image return will be always the same size (600x600px) in the new popup IE window. I am thinkinf it will be good if I can fix the window size; and I don't want to show the user the full product ID and STORE detail in the URL, possible to hide that part of info in the URL?
-
Oct 19th, 2008, 07:57 PM
#5
Thread Starter
Lively Member
Re: how to set size for popup window
I manage to set the browser’s size in the Javascript when the php is called by VB. But this cause a problem of double windows opening (one from VB another one from Javescript).
My question now is: how to get VB to only call the php but not opening a new IE window??
Thanks for yor help.
-
Oct 20th, 2008, 11:49 AM
#6
Re: how to set size for popup window
Are you using a browser control on a form or just launching a default browser?
Whats this with php? Can you explain more of what you are doing so we can get the entire picture?
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum.
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it!
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6
-
Oct 20th, 2008, 05:24 PM
#7
Thread Starter
Lively Member
Re: how to set size for popup window
Ok.
The only way I know to open a webbrowser, beside webbrowse.navigate, is the API, so I use
Code:
lngOpenPage = ShellExecute(Frm1.hwnd, "Open", lblurl.Caption, 0&, 0&, 0&)
to open a default browser to the "lblurl.caption". That URL is written in PHP and Javacript and open a fixed size image all the time. My VB code opens a window. Because I could not figure out a way how to fix the window's size, which I can do in the php behind that. Since I am going to open the window when the php is loaded, I don't need the window to be opened from VB.
However, if I can set the browser size from VB I don't have to worry about much... just load the normal php is fine.
-
Oct 21st, 2008, 10:13 AM
#8
Re: how to set size for popup window
But that is what I posted, my code on resizing a window just as you need.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum.
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it!
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6
-
Oct 23rd, 2008, 04:42 AM
#9
Thread Starter
Lively Member
Re: how to set size for popup window
Rob, I have done as you suggested:
Originally Posted by RobDog888
You would need to use SetWindowPlacement after the ShellExecute call for that.
You said
Originally Posted by RobDog888
If you want it to set the size of the form to some specific normal size then you need to do as I stated with the SetWindowplacement API.
Not seem working, it still opens a new tab under the opened window (firefox).
Last edited by VBKit; Oct 23rd, 2008 at 04:56 AM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|