Solved

TWebExplorer - queryCommandEnabled

Posted on 1998-08-05
2
227 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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

757 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

21 Experts available now in Live!

Get 1:1 Help Now