Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9039061
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T09:38:43+00:00 2026-06-16T09:38:43+00:00

How to get ClassName of active form (may be from another application) on Delphi?

  • 0

How to get ClassName of active form (may be from another application) on Delphi?

It seems Application.ActiveFormHandle returns active form of Application only.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T09:38:45+00:00Added an answer on June 16, 2026 at 9:38 am

    The window handle that you are looking for is, I believe, returned by GetForegroundWindow.

    To get the class name, pass that window handle to the Windows API function GetClassName. Here’s a Delphi wrapper to that API function:

    function GetWindowClassName(Window: HWND): string;
    const
      MaxClassNameLength = 257;//256 plus null terminator
    var
      Buffer: array [0..MaxClassNameLength-1] of Char;
      len: Integer;
    begin
      len := GetClassName(Window, Buffer, Length(Buffer));
      if len=0 then
        RaiseLastOSError;
      SetString(Result, Buffer, len);
    end;
    

    I used a buffer of length 256 because window class names are not allowed to be longer than that.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How can I get the classname at runtime, but only the actual classname and
I can get the unique id like className@2345 of my object by calling its
I am trying to get rid of this: document.body.className = someclass; I want to
We can get class Class object by 3 methods: MyClass.class obj.getClass Class.forName(className) I don't
Get class from div inside an li and add to the same li. The
//Get width and resize another element $(document).ready(function() { function ResizeSearch(GridID, SearchID) { var eleWidth
I am using Delphi 2010, and when I created a console application that prints
So I know you can say Kernel.const_get(ClassName) and you'll get back the class to
if a have a declaration like def inside_classroom(request,classname): theclass = Classroom.objects.get(classname = classname) members
The following code snippet: template = \ function routes(app, model){\ app.get('/preNew{className}', function(req, res){\ res.render('{className}'.ejs,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.