Solved

TWebExplorer - queryCommandEnabled

Posted on 1998-08-05
2
228 Views
Last Modified: 2010-05-19
I am using
WebBrowser.OleObject.Document.queryCommandEnabled('Copy') to
enable/disable the copy button on my web browser.  The problem is that this does not work with pages with frames.

It was explained to me that because the
WebBrowser.OleObject.Document is the HTML page that contains the FRAMES,
each frame contains an HTML page. So I need  to query those pages.  Possibly with something similar to

WebBrowser.OleObject.Document.Frames(i).Document.queryCommandEnabled('Copy')

where i is the frame that has focus.

The above line of code is not the exact syntax so my question is what is the
right syntax to point to the frame document for the frame that has the
focus.

Thank you.
0
Comment
Question by:alexandram
2 Comments
 
LVL 2

Accepted Solution

by:
freter earned 240 total points
ID: 1359946
Ok. Here is the code:
>>>>>>>>>>>>>>>
procedure TMainForm.ToolButton2Click(Sender: TObject);
var i: integer;
begin
  for i := 0 to (Viewer.OleObject.Document.frames.Length - 1) do
    if Viewer.OleObject.Document.frames.item(i).document.queryCommandEnabled('Copy') then showmessage('yes');
end;
<<<<<<<<<<<<<<<<<<<

BTW, have you tried using the DHTMLEd OCX yet? I am constantly receiving Access violations when placing it on a form. Do you experience the same?

Regards,
Freter

0
 

Author Comment

by:alexandram
ID: 1359947
Thank you, it is exacly what I was looking for.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.

911 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

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now