Solved

GetClassName function

Posted on 1998-07-28
1
1,446 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 20 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
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…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

739 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