Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

GetClassName function

Posted on 1998-07-28
1
Medium Priority
?
1,462 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
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

Ask an Anonymous Question!

Don't feel intimidated by what you don't know. Ask your question anonymously. It's easy! Learn more and upgrade.

Question has a verified solution.

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

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…
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 Micro Tutorial will teach you how to add a cinematic look to any film or video out there. There are very few simple steps that you will follow to do so. This will be demonstrated using Adobe Premiere Pro CS6.
Whether it be Exchange Server Crash Issues, Dirty Shutdown Errors or Failed to mount error, Stellar Phoenix Mailbox Exchange Recovery has always got your back. With the help of its easy to understand user interface and 3 simple steps recovery proced…
Suggested Courses

879 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