Gmail Calendar Documents Reader Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
Find Ex
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  6 messages - Expand all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Pedram  
View profile  
 More options Sep 13 2004, 2:55 pm
Newsgroups: borland.public.cppbuilder.nativeapi
From: "Pedram" <no...@hever.sever>
Date: Mon, 13 Sep 2004 23:25:19 +0430
Local: Mon, Sep 13 2004 2:55 pm
Subject: Find Ex
Assume a TForm named B_Form with a TMainMenu
There is Choice1 and Chioce2 in TMainMenu Items
Also there is a TEdit , TMemo and TButton...
This Project is Compiled , executed and Launched !

I need to know how can I write a Code to Select B_Form from My Current
application by FindWindow() and FindWindowEx()

:-) Thx , please guide me
I realy approciate @};-


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Discussion subject changed to "FindWindow and FindWindowEx" by Pedram
Pedram  
View profile  
 More options Sep 14 2004, 9:45 am
Newsgroups: borland.public.cppbuilder.nativeapi
From: "Pedram" <no...@hever.sever>
Date: Tue, 14 Sep 2004 18:15:57 +0430
Local: Tues, Sep 14 2004 9:45 am
Subject: FindWindow and FindWindowEx


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
JD  
View profile  
 More options Sep 14 2004, 3:17 pm
Newsgroups: borland.public.cppbuilder.nativeapi
From: "JD" <nos...@nospam.com>
Date: 14 Sep 2004 12:17:52 -0700
Local: Tues, Sep 14 2004 3:17 pm
Subject: Re: FindWindow and FindWindowEx

"Pedram" <no...@hever.sever> wrote:

>Pedram wrote in message <4145f...@newsgroups.borland.com>...
>>Assume a TForm named B_Form with a TMainMenu
>>There is Choice1 and Chioce2 in TMainMenu Items
>>Also there is a TEdit , TMemo and TButton...
>>This Project is Compiled , executed and Launched !

>>I need to know how can I write a Code to Select B_Form from My Current
>>application by FindWindow() and FindWindowEx()

To reliably be able to locate the window, you need to name the
main form class something unique, like TCompanyNameProgramName
instead of TForm1 (or B_Form).

Or, you need to make sure that the Application::Title is
unique. However, if it's an MDI application, the Application
Title will change if there is an open MDIChild form so I never
use this method unless I have no choice.

Once you find a HANDLE to the application, you need to
enumerate the child windows to get HANDLE(s) to the other
controls in the window (form) to interact with them.

HANDLE hTheHandleOfTheAppYouWant = NULL;
// define other HANDLE(s) that you want.
//-------------------------------------------------------------
BOOL CALLBACK EnumWindowsCallBack( HWND hWnd, LPARAM lParam )
{
    char WindowClassName[256] = {0};
    if( ::GetClassName(hWnd, WindowClassName, 255) )
      {
          if( stricmp(WindowClassName, (char*)lParam) == 0)
            {
                hTheHandleOfTheAppYouWant = hWnd;
                // stop enuming
                return FALSE;
            }
      }
    return TRUE;

}

//-------------------------------------------------------------
BOOL CALLBACK EnumChildCallBack( HWND hWnd, LPARAM lParam )
{
    // we're looking for the second instance of "Static"
    char WindowClassName[256] = {0};
    if( ::GetClassName(hWnd, WindowClassName, 255) )
      {
          if( stricmp(WindowClassName, (char*)lParam) == 0 )
            {
                ++DlgCtrlCounter;
                if( DlgCtrlCounter == 2 )
                  {
                      DlgCtrlHWND = hWnd;
                      // stop Enuming
                      return FALSE;
                  }
            }
      }
    return TRUE;
}

//-------------------------------------------------------------

AnsiString WindowClassName = "TCompanyNameProgramName";
::EnumWindows( (WNDENUMPROC)EnumWindowsCallBack, (LPARAM)WindowClassName.c_str() );
if( hTheHandleOfTheAppYouWant )
  {
      WindowClassName = "Static";
      ::EnumChildWindows( hWnd, (WNDENUMPROC)EnumChildCallBack, (LPARAM)WindowClassName.c_str() );
  }

Now that you have the handles to the controls, what are you
going to do with them? If it's your application, I would
suggest that you just use custom messages that can be sent to
the Application Handle and let it do the work.

~ JD


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Pedram  
View profile  
 More options Sep 14 2004, 3:14 pm
Newsgroups: borland.public.cppbuilder.nativeapi
From: "Pedram" <no...@hever.sever>
Date: Tue, 14 Sep 2004 23:44:11 +0430
Local: Tues, Sep 14 2004 3:14 pm
Subject: Re: FindWindow and FindWindowEx
Thx alot !! I'll check it out and talk about it if there will something
important :-) thx again

    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Pedram  
View profile  
 More options Sep 21 2004, 2:47 pm
Newsgroups: borland.public.cppbuilder.nativeapi
From: "Pedram" <Ped...@Internet.Network>
Date: Tue, 21 Sep 2004 23:17:43 +0430
Local: Tues, Sep 21 2004 2:47 pm
Subject: Re: FindWindow and FindWindowEx
Hi
I was talking about learning how could I use FindWindowEx !
Although I learn myself about FindWindow()
Please take a look at Zip file in borland.public.attachments to download the
Binary and source file.
You will see the project with comments.
Please take care of me :-D thx

    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Pedram  
View profile  
 More options Sep 24 2004, 10:25 am
Newsgroups: borland.public.cppbuilder.nativeapi
From: "Pedram" <Ped...@Internet.Network>
Date: Fri, 24 Sep 2004 18:55:21 +0430
Local: Fri, Sep 24 2004 10:25 am
Subject: Re: FindWindow and FindWindowEx
Please Someone help

Assume a TForm named B_Form with a TMainMenu
There is Choice1 and Chioce2 in TMainMenu Items
Also there is a TEdit , TMemo and TButton...
This Project is Compiled , executed and Launched !

I need to know how can I write a Code to Select B_Form from My Current
application by FindWindow() and FindWindowEx()

:-) Thx , please guide me
I realy approciate @};-

there is also a post in attachments with the same subject name , my C++
project that I need help in.


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google