Can't prevent new window opening!
-
Hi there, can anyone tell me how to stop a link opening in a new window and just use the existing window?? For example: I've got a little explorer app(MFC) with 2 windows. The left side displays the C:/drive and the right side displays a FTP address. The left window navigates fine, but the right side insists on opening a new explorer window when I click on a link, instead of changing inside its own window. When the ne window opens... that navigates fine... just the way I want the right side widow to. Its probably something stupid, knowing me... definately something stupid:) But I've tried a bunch of stuff for the last 24 hours now and nothing stops it opening in a new window! Help! Henry F
-
Hi there, can anyone tell me how to stop a link opening in a new window and just use the existing window?? For example: I've got a little explorer app(MFC) with 2 windows. The left side displays the C:/drive and the right side displays a FTP address. The left window navigates fine, but the right side insists on opening a new explorer window when I click on a link, instead of changing inside its own window. When the ne window opens... that navigates fine... just the way I want the right side widow to. Its probably something stupid, knowing me... definately something stupid:) But I've tried a bunch of stuff for the last 24 hours now and nothing stops it opening in a new window! Help! Henry F
If I understand you correctly, the right pane is actually an HtmlView displaying a web page. In any case, to redirect a link to a specific window you have to use the "target" property. For example: // somewhere in an HTML file Click here "target" accepts any of the following: _blank, which opens the link in a new window _self, which opens the link in the current window _parent, which opens the link in the parent window _top, which opens the link in the top most window Hope this helps.
-
If I understand you correctly, the right pane is actually an HtmlView displaying a web page. In any case, to redirect a link to a specific window you have to use the "target" property. For example: // somewhere in an HTML file Click here "target" accepts any of the following: _blank, which opens the link in a new window _self, which opens the link in the current window _parent, which opens the link in the parent window _top, which opens the link in the top most window Hope this helps.
Thanks for the reply man, but(as usual) its not the HTML I need to change. Basically its an Explorer Window displaying content on a server via FTP: Naviagte2(_T(ftp://whatever.com),NULL,NULL) It displays fine but when I want to open a folder - it launches a new explorer window outside the application and displays the info in that window. Is there some way of controlling this so that all clicked links open inside the application only? thanks :-)
-
Hi there, can anyone tell me how to stop a link opening in a new window and just use the existing window?? For example: I've got a little explorer app(MFC) with 2 windows. The left side displays the C:/drive and the right side displays a FTP address. The left window navigates fine, but the right side insists on opening a new explorer window when I click on a link, instead of changing inside its own window. When the ne window opens... that navigates fine... just the way I want the right side widow to. Its probably something stupid, knowing me... definately something stupid:) But I've tried a bunch of stuff for the last 24 hours now and nothing stops it opening in a new window! Help! Henry F
handle OnBeforeNavigate2, cancel the navigation if it's to another window, and navigate to the url just cancelled... something like that.
-
handle OnBeforeNavigate2, cancel the navigation if it's to another window, and navigate to the url just cancelled... something like that.
Clever idea! Any chance you could scribble the code down? I'll buy u a cup of tea :-)