?
Solved

GetClassName function

Posted on 1998-07-28
1
Medium Priority
?
1,456 Views
Last Modified: 2009-12-16
I am trying to use a piece of code that was given  to me but I am having problems with the getclassname function.
The number of parameters seems to have changed. Could you please help me figure them out. In TWebExplorer the TAB key does not tab to the net field and that fixes that.

In Windows.pas:

{$EXTERNALSYM GetClassName}
function GetClassName(hWnd: HWND; lpClassName: PChar; nMaxCount: Integer): Integer; stdcall;


The code I was given:

procedure TFormWebBrowser.MessageLoop(var Msg: TMsg; var Handled: Boolean);
const
  DialogKeys: set of Byte = [VK_TAB, VK_RETURN, VK_DELETE, VK_EXECUTE, VK_ESCAPE, VK_CANCEL, VK_F10];
  MSJVMClassName = 'MSAWT_Comp_Class';                            // for Java Applets
var
  iOIPAO: IOleInPlaceActiveObject;
  Dispatch: IDispatch;
  buf: array[0..50] of Char;
begin
  if (WebBrowser <> nil) and
     ((Msg.Message = WM_KEYDOWN) or (Msg.Message = WM_KEYUP)) and
     (Msg.wParam in DialogKeys) then
  begin
    Handled := IsDialogMessage(Webbrowser.Handle, msg) = True;
    if (Msg.wParam = VK_DELETE) and (GetClassName(Msg.hwnd) = MSJVMClassName) then
    else
      if Handled then
        if FOleInPlaceActiveObject <> nil then
          FOleInPlaceActiveObject.TranslateAccelerator(Msg)
        else
        begin
          Dispatch := Webbrowser.Application_;
          if Dispatch <> nil then
          begin
            Dispatch.QueryInterface(IOleInPlaceActiveObject, iOIPAO);
            if iOIPAO <> nil then
              FOleInPlaceActiveObject := iOIPAO;
          end;
        end;
  end
  else
    Handled := False;
end;

0
Comment
Question by:moonrise
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 8

Accepted Solution

by:
ZifNab earned 80 total points
ID: 1358781
Hi moonrise,

what about this :

var  lpBuffer : PChar;

 if (Msg.wParam = VK_DELETE) and (GetClassName(Msg.hwnd, lpBuffer, 255) = MSJVMClassName)

don't suppose you need the other.
Zif.
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

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…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Suggested Courses
Course of the Month15 days, 16 hours left to enroll

741 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