Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Error 47 Permission Denied in IE6

Posted on 2005-03-08
5
Medium Priority
?
162 Views
Last Modified: 2010-04-04
Hi

Using Delphi 2005 Pro /  Intraweb 7.2 / IE version 6.0.2900.2180 / XP Home SP2

I need to have a button on an Intraweb form that simply brings up the browser search window (i.e. emulates the CTRL-F keystrokes).  The following code brings the window up fine but when I try to execute the search I get "Error 47 Permission Denied".  I don't get the error when I just hit CTRL-F.  I presume this is some IE automation security protection but is there a work around?

  keybd_event(VK_CONTROL, 0, 0, 0);
  keybd_event(70, 0, 0, 0);
  keybd_event(70, 0, KEYEVENTF_KEYUP, 0);
  keybd_event(VK_CONTROL, 0, KEYEVENTF_KEYUP, 0);

Many Thanks

0
Comment
Question by:AndyBarrow
  • 3
  • 2
5 Comments
 
LVL 13

Accepted Solution

by:
BlackTigerX earned 250 total points
ID: 13490328
...you have to remember that the code behind executes on the server, not on the client

try searching some javascript to accomplish this task on the client side (browser)
0
 

Author Comment

by:AndyBarrow
ID: 13563612
Yup makes sense.  Don't think Javascript will allow key emulation though for security reasons.
0
 

Author Comment

by:AndyBarrow
ID: 13726889
Hi

Apologies for delay.  Haven't managed to find any JS to do this because of the obvious security implications of key emulation but find it hard to beleive that a browsers search function cannot be invoked somehow!?  I will award points 'cos strictly speaking you answered my question (even though with hindsight it was a bit of a dumb one  : )

regards
Andy.
0
 
LVL 13

Expert Comment

by:BlackTigerX
ID: 13733195
you can use something like this:

http://www.javascripter.net/faq/searchin.htm

<form name="f1" action=""
onSubmit="if(this.t1.value!=null && this.t1.value!='')
findString(this.t1.value);return false"
>
<input type="text" name=t1 value="" size=20>
<input type="submit" name=b1 value="Find">
</form>

<script language="JavaScript">
<!--
var TRange=null

function findString (str) {
 if (parseInt(navigator.appVersion)<4) return;
 var strFound;
 if (navigator.appName=="Netscape") {

  // NAVIGATOR-SPECIFIC CODE

  strFound=self.find(str);
  if (!strFound) {
   strFound=self.find(str,0,1)
   while (self.find(str,0,1)) continue
  }
 }
 if (navigator.appName.indexOf("Microsoft")!=-1) {

  // EXPLORER-SPECIFIC CODE

  if (TRange!=null) {
   TRange.collapse(false)
   strFound=TRange.findText(str)
   if (strFound) TRange.select()
  }
  if (TRange==null || strFound==0) {
   TRange=self.document.body.createTextRange()
   strFound=TRange.findText(str)
   if (strFound) TRange.select()
  }
 }
 if (!strFound) alert ("String '"+str+"' not found!")
}
//-->
</script>
0
 

Author Comment

by:AndyBarrow
ID: 13734199
Many thanks for that.  I'll give that a go asap.
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

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…
this video summaries big data hadoop online training demo (http://onlineitguru.com/big-data-hadoop-online-training-placement.html) , and covers basics in big data hadoop .
Loops Section Overview

572 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