Home | Forums | Contact | Search | Syndication  
 
 [login] [create account]   Wednesday, August 27, 2025 
 
slxdeveloper.com Community Forums  
   
The Forums on slxdeveloper.com are now retired. The forum archive will remain available for the time being. Thank you for your participation on slxdeveloper.com!
 Architect Forums - SalesLogix Scripting & Customization
Forum to discuss writing script in Architect plugins for SalesLogix & general SalesLogix customization topics (for Windows client only). View the code of conduct for posting guidelines.
Forums RSS Feed


 Back to Forum List | Back to SalesLogix Scripting & Customization | New ThreadView:  Search:  
 Author  Thread: Specify window size when launching Web browser?
Dan Carvin
Posts: 227
 
Specify window size when launching Web browser?Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 06 Nov 08 5:16 PM
Is it possible to launch a web broswser from a SLX LAN script and pass to the browser a window size & position?

The customer wants to open a website and easily move back & forth between the website and a SLX input view. The web browser should not cover the portion of the screen where the input fields are, so we want to control the size & position.
[Reply][Quote]
John H. Hedges
Posts: 62
 
Re: Specify window size when launching Web browser?Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 07 Nov 08 1:58 AM
If you know that JavaScript is enabled, you could just code the URL as a series of JS commands, like this:

javascript:resizeTo(950,400);moveTo(5,5);document.location.href='http://www.saleslogix.com';

That should work with the WebOpen() API, but I haven't tried it in a while.

Figuring out where to put the window is another story. In the more recent versions of SLX, you can get the main SLX window's size and position from the Application object, but you might not be able to determine things like how many toolbars are being displayed, and whether or not the NavBar is sitting on the left side of the window where it usually is... but you could probably come fairly close, though. Just remember, I have complete confidence in you!
[Reply][Quote]
Ryan Farley
Posts: 2265
slxdeveloper.com Site Administrator
Top 10 forum poster: 2265 posts
 
Re: Specify window size when launching Web browser?Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 07 Nov 08 9:44 AM
Quote:
Originally posted by John H. Hedges

If you know that JavaScript is enabled, you could just code the URL as a series of JS commands, like this:

javascript:resizeTo(950,400);moveTo(5,5);document.location.href='http://www.saleslogix.com';


Very clever
[Reply][Quote]
Ryan Farley
Posts: 2265
slxdeveloper.com Site Administrator
Top 10 forum poster: 2265 posts
 
Re: Specify window size when launching Web browser?Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 07 Nov 08 9:55 AM
If you're OK with making this an IE only solution (and John's clever idea doesn't work), then this can definitely be done using IE automation.

Something like this (not tested code):

Dim ie

Set ie = CreateObject("InternetExplorer.Application")
ie.Toolbar = False
ie.AddressBar = False
ie.Height = 300
ie.Width = 300
ie.Navigate "http://www.slxdeveloper.com/"
'or get the doc to write to it directly via ie.Document
'etc
[Reply][Quote]
Dan Carvin
Posts: 227
 
Re: Specify window size when launching Web browser?Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 07 Nov 08 11:57 AM
Since the input fields are on the left side of a large (legacy) custom input form, if I can make the brower appear on the right side of the screen and save the user the hassle of moving & resizing the browser, that would be sufficient

So, assuming a typical user screen is 1024 pixels wide, can I do a moveTo(512,5) or ie.Left = 512 ?


[Reply][Quote]
John H. Hedges
Posts: 62
 
Re: Specify window size when launching Web browser?Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 07 Nov 08 1:49 PM
Sure, that should work. If you wanted to get really fancy with it, I think the Screen object is available in both JavaScript and VBscript... so in VBScript you could do something like Int(Screen.Width/2), so you wouldn't have to assume anything about the monitor size/resolution.

Just don't make the browser window jump around the screen every few milliseconds at random - people hate that!
[Reply][Quote]
Dan Carvin
Posts: 227
 
Re: Specify window size when launching Web browser?Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 13 Nov 08 12:48 PM
It works!

One more line is required though:

ie.Visible = 1

One more question: Do I need a

set ie = Nothing ?

Or are the resources released when the users close their browser?


[Reply][Quote]
Dan Carvin
Posts: 227
 
Re: Specify window size when launching Web browser?Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 13 Nov 08 12:58 PM
John,

I'm having trouble using Int(Screen.Width/2).

Do I need to create a objScreen object or something? How do I do that?
[Reply][Quote]
Ryan Farley
Posts: 2265
slxdeveloper.com Site Administrator
Top 10 forum poster: 2265 posts
 
Re: Specify window size when launching Web browser?Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 13 Nov 08 1:04 PM
Quote:
Originally posted by Dan Carvin

One more question: Do I need a

set ie = Nothing ?

Or are the resources released when the users close their browser?



You should set your reference to nothing so you're no longer holding it, so yes, set it to nothing.
[Reply][Quote]
John H. Hedges
Posts: 62
 
Re: Specify window size when launching Web browser?Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 13 Nov 08 2:48 PM
Sorry, I shouldn't post things without trying them myself first... If you're doing this from a SalesLogix VBScript, you'd use this:

Application.Environment.DesktopWidth

You should see all the properties for Application.Environment via Intellisense when you type it in - you can get the SLX Client window's position/size too, and also the PixelsPerInch/ThemesEnabled properties, which are sometimes useful for precise positioning of controls.
[Reply][Quote]
Dan Carvin
Posts: 227
 
Re: Specify window size when launching Web browser?Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 14 Nov 08 9:54 AM
One more complication with this...

This customer typically runs SLX from a Citrx server where the citrix Window runs SLX only. My dev & testing environment for this customer is through Citrix, but I have access to the whole desktop. The customization we're discussing here works in my test environment, and for a user who runs SLX on his local desktop. But for another user in an SLX-only Citrix window, we get a general error referring to the line:

Set ie = CreateObject("InternetExplorer.Application")

However, clicking a URL on the web field on the account detail, the site opens. Also if I use

Set objShell = CreateObject("Shell.Application")
objShell.ShellExecute strUrl

in my customization that works also, although I don't know how to control the window size & position. The difference is that the latter two open IE in the local desktop, not inside the Citrix session. It looks like Citrix runs in the One-Ap mode, it won't allow a CreateObject for another application.

So is there a way around this? Can a SLX script in a Citrix session open IE on the local desktop AND set the window size & position?
[Reply][Quote]
 Page 1 of 1 
  You can subscribe to receive a daily forum digest in your user profile. View the site code of conduct for posting guidelines.

   Forum RSS Feed - Subscribe to the forum RSS feed to keep on top of the latest forum activity!
 

 
 slxdeveloper.com is brought to you courtesy of Ryan Farley & Customer FX Corporation.
 This site, and all contents herein, are Copyright © 2025 Customer FX Corporation. The information and opinions expressed here are not endorsed by Sage Software.

code of conduct | Subscribe to the slxdeveloper.com Latest Article RSS feed
   
 
page cache (param): 8/27/2025 10:12:55 AM