Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

window.open can't open a web browser

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
My VC++ application will launch the javascript application to allow users to send file to a server. When I run my application as a regular Windows application, everything works great. However, when I run my application as a Windows service, the javascript can't launch the web browser. It hangs at window.open(....) in the javacript. When a user clicks on the URL, it hangs. It seems like the javascript isn't able to launch the web browser. I am guess it is a security or permission issues problem. I have been looking at this problem for days, just can't seem to fix it. I appreciate any input and idea.

Thanks for your help
 
Here is the piece of code

if (document.all)
var xMax = screen.width, yMax = screen.height;
else
if (document.layers)
var xMax = window.outerWidth, yMax = window.outerHeight;
else
var xMax = 640, yMax=480;

var xOffset = (xMax - 500)/2, yOffset = (yMax - 120)/2;

theFeats = 'height=120,width=500,screenX='+xOffset+',screenY='+yOffset+',top='+yOffset+',left='+xOffset+'';
theUniqueID = (new Date()).getTime() % 1000000000;
window_handle = window.open(" + theUniqueID, theUniqueID, theFeats);

When the application runs as a service, it hangs on the window.open(...)

Thanks.
 
When you setup the Windows service, did you check the "interact with desktop" box?
 
When the code reaches to the line window.open(....), a "Server Busy" dialog appears saying, "This action cannot be completed because the other program is busy. Choose 'Switch To'to activate the busy program and correct the problem.". I don't know why this message dialog pops up.

Thanks for any suggestion or idea.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top