Solved

Is there any way to discover the name of a component of a application?

Posted on 2006-11-23
68
209 Views
Last Modified: 2010-04-05
After sending a message to another application, there is a button that I need to press, but this button I don't have a shortcut, is there any way to get its name or to simulate a mouse click on it?

Something that I could active it.

Thanks

0
Comment
Question by:hidrau
  • 35
  • 27
  • 2
  • +3
68 Comments
 
LVL 28

Expert Comment

by:ciuly
ID: 18004151
well, you could iterate through all childwindows (FindWindow and enumwindows) to find teh button with the correct caption then use sendmessage(the handle, WM_KEYDOWN, VK_RETURN, 0);
(just an idea, not tested)
0
 
LVL 28

Expert Comment

by:TName
ID: 18004189

Or if you want to "press" a button after using the sendkeys Object from the previous thread
( http://www.experts-exchange.com/Programming/Programming_Languages/Delphi/Q_22070805.html )
what about this:
(if it's always the same window, the same text area, the same button, you could "hardcode" the solution...)

Just tab through the window from your text area until you find the button and simulate "enter":
{...}
Keys := 'Some string[Tab][Enter]';       // as many  [Tab] as it takes...
Execute();
{...}
0
 
LVL 28

Expert Comment

by:TName
ID: 18004197
And hope it's not a SpeedButton ;)
0
 
LVL 1

Author Comment

by:hidrau
ID: 18004206
to get the handle of the button I could use winsight?
0
 
LVL 26

Expert Comment

by:EddieShipman
ID: 18004306
Getting the handle in Winsight won't do much good because it changes each time you run the app.
What you have to do is use EnumWindows and EnumChildWindows to get the handle and send it a
WM_LBUTTONDOWN AND WM_LBUTTONUP message like this:
{The EnumWindows code is courtesy an old Borland NG post by Ralph Friedman}

unit Unit1;

interface

uses
 Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
 StdCtrls;

type
  TForm1 = class(TForm)
   Button1: TButton;
   procedure Button1Click(Sender: TObject);
  private
   { Private declarations }
  public
   { Public declarations }
   procedure FindBtnHandle;
  end;

var
  Form1: TForm1;
  BtnHandle: THandle;
  sAppName: String;
  sBtnCaption: String;

implementation

{$R *.DFM}

function EnumChildProc(AHandle: hWnd; AnObject: TObject): BOOL; stdcall;
var
  tmpS : string;
  theClassName : string;
  theWinText : string;
begin
  Result := True;
  SetLength(theClassName, 256);
  GetClassName(AHandle, PChar(theClassName), 255);
  SetLength(theWinText, 256);
  GetWindowText(AHandle, PChar(theWinText), 255);
  tmpS := StrPas(PChar(theClassName));
  if theWinText <> EmptyStr then
   tmpS := tmpS + ' "'
           + StrPas(PChar(theWinText)) + '"'
  else
   tmpS := tmpS + '""';
  if Pos(sBtnCaption, tmpS) > 0 then
  begin
   BtnHandle := AHandle;
  end;
end;

function WindowEnumProc(AHandle: hWnd; AnObject: TObject): BOOL; stdcall;
// callback for EnumWindows.
var
  theClassName: string;
  theWinText: string;
  tmpS: string;
begin
  Result := True;
  SetLength(theClassName, 256);
  GetClassName(AHandle, PChar(theClassName), 255);
  SetLength(theWinText, 256);
  GetWindowText(AHandle, PChar(theWinText), 255);
  tmpS := StrPas(PChar(theClassName));
  if theWinText <> EmptyStr then
   tmpS := tmpS + ' "'
           + StrPas(PChar(theWinText)) + '"'
  else
   tmpS := tmpS + '""';
  if Pos(sAppName, tmpS) > 0 then
  begin
   EnumChildWindows(AHandle, @EnumChildProc, longInt(0));
  end;
end;

procedure TForm1.FindBtnHandle;
begin
  BtnHandle := 0;
  // set this to the caption of the button you want to push.
  sBtnCaption := 'Connect';
  // se this to the caption of the window that has the button.
  sAppName := 'WS_FTP Pro: Connect to Remote Host';
  Screen.Cursor := crHourGlass;
  try
    EnumWindows(@WindowEnumProc, LongInt(0));
  finally
   Screen.Cursor := crDefault;
  end;
end;

procedure TForm1.Button1Click(Sender: TObject);
var
  i: Integer;
begin
  FindBtnHandle;
  if BtnHandle <> 0 then
  begin
    // Send the button the message, the MakeLParam(5, 5)
    // portion of the message simulates clicking at coords
    // 5, 5 of the button.
    SendMessage(BtnHandle, WM_LBUTTONDOWN, 0, MakeLParam(5, 5));
    SendMessage(BtnHandle, WM_LBUTTONUP, 0, MakeLParam(5, 5));
  end;
end;

end.
0
 
LVL 26

Expert Comment

by:EddieShipman
ID: 18004310
The above code presses the Connect button of WS_FTP Pro 7.5
0
 
LVL 1

Author Comment

by:hidrau
ID: 18004336
I had an error in this line     EnumWindows(@WindowEnumProc, LongInt(0));

undeclared identifier
0
 
LVL 1

Author Comment

by:hidrau
ID: 18004339
ah , it must be because of the last post WS_FTP
 :)
0
 
LVL 1

Author Comment

by:hidrau
ID: 18004341
WS_FTP is a component from what pallet?
0
 
LVL 1

Author Comment

by:hidrau
ID: 18004368
Is there a way to list all component from a application?

I get the handle of my application, now I need to list all component .
0
 
LVL 1

Author Comment

by:hidrau
ID: 18004523
Ok, I discovery the error, it was the way I had copied the code.

:((

But for what I am trying to do I didn't get it.

Let me explain and maybe it become more clear for someone help me.

I have a babylon installed in some computers, I send it a text to be search, this will interact with my application,
when the user get the result of the search, my program must activate the button save it, that is a confirguration
to save what you search in babylon.

This way I will have a list of consulting.

If someone have the babylon dictionary installed will be more easy the test it.

0
 
LVL 26

Expert Comment

by:EddieShipman
ID: 18005345
[quote]
undeclared identifier
[/quote]

Well, I just tested it. You have something worng with your code.

[quote]
WS_FTP is a component from what pallet?
[/quote]

It is NOT a component, it is an application that has a dialog with buttons. That
is what you wanted to do, right? Click on a button in another applciation?

[quote]
Is there a way to list all component from a application?
I get the handle of my application, now I need to list all component .
[/quote]

Yes, but it won't be component's like you think in Delphi sense.
You will get Static type for "labels" Edit for TEdits, Button for TButton, etc.
The variable named 'theClassName' in EnumChildProc has the control's type.
It currently loops through all the window's child controls.
0
 
LVL 1

Author Comment

by:hidrau
ID: 18006964
EddieShipman ,

I need to do this with babylon , could you make a test for me?

I didn't have any success :(

0
 
LVL 26

Expert Comment

by:EddieShipman
ID: 18007389
I don't have Babylon. You can use Winsight to test the captions of the window and controls, however.
Make sure they are the correct ones.
0
 
LVL 1

Author Comment

by:hidrau
ID: 18007581
My winsight is only displaying number now, why?

Do you know this application?
0
 
LVL 1

Author Comment

by:hidrau
ID: 18007701
I download a program very very good, better than winsight.

I got the handle of button,

00050E56

How should I go on?

  BtnHandle := '00050E56';
  // set this to the caption of the button you want to push.
  sBtnCaption := 'Connect';
  // se this to the caption of the window that has the button.
  sAppName := 'Babylon';
  Screen.Cursor := crHourGlass;
  try
    EnumWindows(@WindowEnumProc, LongInt(0));
  finally
   Screen.Cursor := crDefault;
  end;

0
 
LVL 1

Author Comment

by:hidrau
ID: 18008038
wonderful :))))

I got it :)))

EddieShipman ,

0
 
LVL 1

Author Comment

by:hidrau
ID: 18008248
EddieShipman ,

Sometimes, when I do the seach appears more than 1 buttom, is there any way to press all buttons? I noticed that the buttons have the same name text.

thanks
0
 
LVL 26

Expert Comment

by:EddieShipman
ID: 18008818
Like I said, though, thehandle is going to change each time you run the application so using the handle from any application
like winsight will not be reliable.

Where do I download Babylon so I can test it for you?
0
 
LVL 1

Author Comment

by:hidrau
ID: 18008869
www.babylon.com

you can download the trial version

I get another application better than winsigth

you can get it here http://www.greatis.com/delphicb/windowse/

0
 
LVL 26

Expert Comment

by:EddieShipman
ID: 18011363
Can you tell me how to reproduce the dialog that you want to click the buttons on?
And which button to click?
0
 
LVL 16

Expert Comment

by:CodedK
ID: 18012588
You can just send the mouse pointer to the right coordinates and send a click.
Dont use the handle use findwindowEx to get the right handle of the button class.
Follow the treeview given by windowse..
Make a FindWindowEx command following that order and you'll get the handle.
0
 
LVL 1

Author Comment

by:hidrau
ID: 18012948
EddieShipman ,

There is an option in bablylon to save your search called "save-it"

When you mark this option, on the search displayed appears a pin to save your search.

it is that That I need to set up.

Thanks
0
 
LVL 1

Author Comment

by:hidrau
ID: 18018179
EddieShipman , Did you get it?
0
 
LVL 26

Expert Comment

by:EddieShipman
ID: 18018994
I didn't have time yesterday, Will try to get to it today.
0
 
LVL 1

Author Comment

by:hidrau
ID: 18019021
ok, thanks
0
 
LVL 9

Expert Comment

by:bernani
ID: 18019303

Hi,

See this demo unit. Maybe it can help you:

unit unit1;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics,
  Controls, Forms, Dialogs, StdCtrls, ExtCtrls;

type
  TForm1 = class(TForm)

    Label1: TLabel;
    Label2: TLabel;
    Label3: TLabel;
    Timer1: TTimer;

    procedure FormCreate(Sender: TObject);
    procedure Timer1Timer(Sender: TObject);
  private
    procedure ShowHwndAndClassName(CrPos: TPoint);
  public
  end;

var
  Form1: TForm1;

implementation

{$R *.DFM}

procedure TForm1.ShowHwndAndClassName(CrPos: TPoint);
var
  hWnd: THandle;
  aName,
  Text :  array [0..255] of char;
begin
  hWnd := WindowFromPoint(CrPos);
  Label1.Caption := 'Handle :  ' + IntToStr(hWnd);

  if boolean(GetClassName(hWnd, aName, 256)) then
    Label2.Caption := 'ClassName :  ' + string(aName)
  else
    Label2.Caption := 'ClassName :  not found';
  SendMessage(hWnd, WM_GETTEXT, SizeOf(Text), integer(@Text));
  Label3.Caption := 'Text :' + Text;
end;

procedure TForm1.FormCreate(Sender: TObject);
begin
  Form1.FormStyle := fsStayOnTop;
  Timer1.Interval := 50;
end;

procedure TForm1.Timer1Timer(Sender: TObject);
var
  rPos: TPoint;
begin
  if boolean(GetCursorPos(rPos))
  then ShowHwndAndClassName(rPos);
end;
end.

________________ dfm ____________

object Form1: TForm1
  Left = 243
  Top = 105
  Width = 405
  Height = 182
  Caption = 'Form1'
  Color = clBtnFace
  Font.Charset = DEFAULT_CHARSET
  Font.Color = clWindowText
  Font.Height = -11
  Font.Name = 'MS Shell Dlg 2'
  Font.Style = []
  OldCreateOrder = False
  OnCreate = FormCreate
  PixelsPerInch = 96
  TextHeight = 13
  object Label1: TLabel
    Left = 40
    Top = 48
    Width = 31
    Height = 13
    Caption = 'Label1'
  end
  object Label2: TLabel
    Left = 40
    Top = 80
    Width = 31
    Height = 13
    Caption = 'Label2'
  end
  object Label3: TLabel
    Left = 40
    Top = 120
    Width = 31
    Height = 13
    Caption = 'Label3'
  end
  object Timer1: TTimer
    OnTimer = Timer1Timer
    Left = 40
    Top = 160
  end
end

0
 
LVL 26

Expert Comment

by:EddieShipman
ID: 18024295
[quote]There is an option in bablylon to save your search called "save-it"[/quote]

Ok, in the version I have (6.0.0 Trial), there is no option for saving a result set.
There is no topic in the help file about saving, either. Must be disabled in the Trial.
0
 
LVL 26

Expert Comment

by:EddieShipman
ID: 18024298
Please give me more info.
0
 
LVL 1

Author Comment

by:hidrau
ID: 18027020
EddieShipman, yeah, you are right.

babylon version 6 is different the version that I use. Please get my version at this address

http://www.infosoftlanguages.com.br/arquivos/babylon40.exe
http://www.infosoftlanguages.com.br/arquivos/full_eng_dict50.exe

the second link is for dictionary.

uninstall the previous version installed in your computer and install this one.

after install the dictionary.

to display that option you need to call babylon - menu - configuration - find - "show save it buttons"

Thanks

0
 
LVL 26

Expert Comment

by:EddieShipman
ID: 18027238
OK, will work on it again tonight.
0
 
LVL 1

Author Comment

by:hidrau
ID: 18027331
ok, thanks
0
 
LVL 1

Author Comment

by:hidrau
ID: 18042426
Did you test it?
0
 
LVL 26

Expert Comment

by:EddieShipman
ID: 18045477
Sorry, I got real busy the last two nights putting up holiday decorations and tonight I have a Cub Scout meeting
so I won't get to it until tomorrow evening, unless I'm able to get to it when I go home for lunch today.
0
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 1

Author Comment

by:hidrau
ID: 18045534
ok, no problem eddieShipman,

I can wait for this solution :))

Thanks once again
0
 
LVL 26

Expert Comment

by:EddieShipman
ID: 18073323
Here's changes to the original post that may help you out...

function EnumChildProc(AHandle: hWnd; AnObject: TObject): BOOL; stdcall;
var
  tmpS : string;
  theClassName : string;
  theWinText : string;
begin
  Result := True;
  SetLength(theClassName, 256);
  GetClassName(AHandle, PChar(theClassName), 255);
  SetLength(theWinText, 256);
  GetWindowText(AHandle, PChar(theWinText), 255);
  tmpS := StrPas(PChar(theClassName));
  if theWinText <> EmptyStr then
   tmpS := tmpS + ' "'
           + StrPas(PChar(theWinText)) + '"'
  else
   tmpS := tmpS + '""';
  if (Pos(sBtnCaption, tmpS) > 0) and
     (Pos('BabyButton', theClassName) > 0 )then
  begin
   BtnHandle := AHandle;
  end;
end;

function WindowEnumProc(AHandle: hWnd; AnObject: TObject): BOOL; stdcall;
// callback for EnumWindows.
var
  theClassName: string;
  theWinText: string;
  tmpS: string;
begin
  Result := True;
  SetLength(theClassName, 256);
  GetClassName(AHandle, PChar(theClassName), 255);
  SetLength(theWinText, 256);
  GetWindowText(AHandle, PChar(theWinText), 255);
  tmpS := StrPas(PChar(theClassName));
  if theWinText <> EmptyStr then
   tmpS := tmpS + ' "'
           + StrPas(PChar(theWinText)) + '"'
  else
   tmpS := tmpS + '""';
  if Pos(sAppName, tmpS) > 0 then
  begin
   EnumChildWindows(AHandle, @EnumChildProc, longInt(0));
  end;
end;

procedure TForm1.FindBtnHandle;
begin
  BtnHandle := 0;
  // set this to the caption of the button you want to push.
  sBtnCaption := 'Save As';
  // se this to the caption of the window that has the button.
  sAppName := 'Babylon Save';
  Screen.Cursor := crHourGlass;
  try
    EnumWindows(@WindowEnumProc, LongInt(0));
  finally
   Screen.Cursor := crDefault;
  end;
end;
0
 
LVL 1

Author Comment

by:hidrau
ID: 18075284
Did it work for you?
0
 
LVL 26

Expert Comment

by:EddieShipman
ID: 18076727
Yes, it brought up the save-as dialog.
0
 
LVL 1

Author Comment

by:hidrau
ID: 18076907
I asked you because I ran my code and nothing happening as you can see in the picture that I posted.

http://www.infosoftlanguages.com.br/arquivos/imagem.jpg

Where is the red ring, this button must be down

http://www.infosoftlanguages.com.br/arquivos/imagem2.jpg


I got the correct name of the buttom with that program that I told you windowse, that I told you above.

as you can see in the code, this is the name sBtnCaption := 'Dict Post It';

with your code nothing happening.
 Thanks in advanced for your help,  

what I need to know if is there a way to leave all that buttons down (clicked)
because the program only finds the one button and put it down. Others, nothing.

You see?

  BtnHandle := 0;
// set this to the caption of the button you want to push.
  sBtnCaption := 'Dict Post It';
  // se this to the caption of the window that has the button.
  sAppName := 'Babylon';
  Screen.Cursor := crHourGlass;
  try
    EnumWindows(@WindowEnumProc, LongInt(0));
  finally
   Screen.Cursor := crDefault;
  end;
0
 
LVL 9

Expert Comment

by:bernani
ID: 18078242
Hi,

Maybe you can have some info reading the code source of the free-babylon project on sourceforge

http://sourceforge.net/project/showfiles.php?group_id=179027

"free-babylon is a dictionay which use the all web dictionarys as source.You need only to mark the word which you would like translate and click at you middle maus button. that'a all. You can add any web dictionary you like.".

I don't have Babylon installed, so I can't test the demo wich requires specific dll.


0
 
LVL 26

Expert Comment

by:EddieShipman
ID: 18078657
Oh, I didn't know that THOSE were the buttons you wanted pushed.
I thought you wanted the Save-It button pushed.

I will work on it tonight.
0
 
LVL 1

Author Comment

by:hidrau
ID: 18078676
Thanks very much EddieShipman.

0
 
LVL 26

Expert Comment

by:EddieShipman
ID: 18086175
forgive me, I forgot to work on it last night. I will take a look at it at lunch time today, which is about 3-4 hrs from now.
0
 
LVL 1

Author Comment

by:hidrau
ID: 18086252
EddieShipman
 No problem

Don't forget to download and install the babylon from the link that I made available.

regards
0
 
LVL 26

Expert Comment

by:EddieShipman
ID: 18088087
I did before I rewrote the routine. However, I was unable to get home
for lunch and will be able to do it tonight.
0
 
LVL 26

Expert Comment

by:EddieShipman
ID: 18089675
Well, my trial has expired and I cannot reinstall without it tellingme that it has expired.
0
 
LVL 26

Expert Comment

by:EddieShipman
ID: 18089680
if you want to send me the reg info mr_delphi_developer at yahoo dot com
0
 
LVL 1

Author Comment

by:hidrau
ID: 18091930
I've sent you an email with reg

Thanks
0
 
LVL 26

Expert Comment

by:EddieShipman
ID: 18096236
I made this change and it worked, the little stick pin looks pushed in.

procedure TForm1.FindBtnHandle;
begin
  BtnHandle := 0;
  // set this to the caption of the button you want to push.
  sBtnCaption := 'Dict Post It';
  // se this to the caption of the window that has the button.
  sAppName := 'Babylon';
  Screen.Cursor := crHourGlass;
  try
    EnumWindows(@WindowEnumProc, LongInt(0));
  finally
   Screen.Cursor := crDefault;
  end;
end;

0
 
LVL 1

Author Comment

by:hidrau
ID: 18096278
EddieShipman, yeah,

I have done this, the problem is that sometimes, depending on kind of word there is more than one stick pin. So, I would like to pushed all pin, is it possible?
0
 
LVL 26

Expert Comment

by:EddieShipman
ID: 18096660
What type of word are you looking at that would cause this?
0
 
LVL 1

Author Comment

by:hidrau
ID: 18098369
I don't remember, but as I have both dictionary installed english to portuguese and english to english, when I do the search, it brings the both translation, one for each language.

0
 
LVL 26

Accepted Solution

by:
EddieShipman earned 500 total points
ID: 18105745
Try this:

unit ubaby;

interface

uses
 Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
 StdCtrls;

type
  TForm1 = class(TForm)
   Button1: TButton;
   procedure Button1Click(Sender: TObject);
  private
   { Private declarations }
  public
   { Public declarations }
   procedure PressDictPostItBtns;
  end;

var
  Form1: TForm1;
  sAppName: String;
  sBtnCaption: String;

implementation

{$R *.DFM}

function EnumChildProc(AHandle: hWnd; AnObject: TObject): BOOL; stdcall;
var
  tmpS : string;
  theClassName : string;
  theWinText : string;
begin
  Result := True;
  SetLength(theClassName, 256);
  GetClassName(AHandle, PChar(theClassName), 255);
  SetLength(theWinText, 256);
  GetWindowText(AHandle, PChar(theWinText), 255);
  tmpS := StrPas(PChar(theClassName));
  if theWinText <> EmptyStr then
   tmpS := tmpS + ' "'
           + StrPas(PChar(theWinText)) + '"'
  else
   tmpS := tmpS + '""';
  if (Pos(sBtnCaption, tmpS) > 0) and
     (Pos('BabyButton', theClassName) > 0 )then
  begin
   SendMessage(AHandle, WM_LBUTTONDOWN, 0, MakeLParam(5, 5));
   SendMessage(AHandle, WM_LBUTTONUP, 0, MakeLParam(5, 5));
  end;
end;

function WindowEnumProc(AHandle: hWnd; AnObject: TObject): BOOL; stdcall;
// callback for EnumWindows.
var
  theClassName: string;
  theWinText: string;
  tmpS: string;
begin
  Result := True;
  SetLength(theClassName, 256);
  GetClassName(AHandle, PChar(theClassName), 255);
  SetLength(theWinText, 256);
  GetWindowText(AHandle, PChar(theWinText), 255);
  tmpS := StrPas(PChar(theClassName));
  if theWinText <> EmptyStr then
   tmpS := tmpS + ' "'
           + StrPas(PChar(theWinText)) + '"'
  else
   tmpS := tmpS + '""';
  if Pos(sAppName, tmpS) > 0 then
  begin
   EnumChildWindows(AHandle, @EnumChildProc, longInt(0));
  end;
end;

procedure TForm1.PressDictPostItBtns;
begin
  // set this to the caption of the button you want to push.
  sBtnCaption := 'Dict Post It';
  // se this to the caption of the window that has the button.
  sAppName := 'Babylon';
  Screen.Cursor := crHourGlass;
  try
    EnumWindows(@WindowEnumProc, LongInt(0));
  finally
   Screen.Cursor := crDefault;
  end;
end;


procedure TForm1.Button1Click(Sender: TObject);
begin
  PressDictPostItBtns;
end;

end.
0
 
LVL 26

Expert Comment

by:EddieShipman
ID: 18105818
BTW, I tried to get the state of the button and calling BM_GETSTATE does not work on these buttons.
What that means is, if you have one button down and you click "More Results" the next time you run this,
it will make the button that is down up and then all the other buttons down. It simply toggles the up/dn
of all the buttons regardless of their current state.
0
 
LVL 1

Author Comment

by:hidrau
ID: 18113683
there is an option that display all the information from each dictionary at once time.
You don't need click "More Results" to call other dictionaries.


0
 
LVL 26

Expert Comment

by:EddieShipman
ID: 18114269
whatever...did it work for you?
0
 
LVL 1

Author Comment

by:hidrau
ID: 18114354
When I send the word to the dictionay, it does the search and retrieves in two dictionaries, english to english and english to portuguese, but only one pin is pushed.

What exactly have you done in your code?

0
 
LVL 1

Author Comment

by:hidrau
ID: 18114421
Isn't there any way to active all 'BabyButton' 'Dict Post It'? I could notice that when there is two dictionaries more than one 'dict Post it' is called. Is there any way to get all handles from them and for each handle to set them?
0
 
LVL 26

Expert Comment

by:EddieShipman
ID: 18114785
This code in the EnumChildProc pushes ALL Dict Post It buttons:

 if (Pos(sBtnCaption, tmpS) > 0) and
     (Pos('BabyButton', theClassName) > 0 )then
  begin
   SendMessage(AHandle, WM_LBUTTONDOWN, 0, MakeLParam(5, 5));
   SendMessage(AHandle, WM_LBUTTONUP, 0, MakeLParam(5, 5));
  end;

Maybe change the MakeLParam to MakeLParam(1, 1)?
This is the coords INSIDE the button that the lbuttondown and lbuttonup are
supposed to take place.

0
 
LVL 1

Author Comment

by:hidrau
ID: 18114833
ok, I am gonna test
0
 
LVL 1

Author Comment

by:hidrau
ID: 18114868
I tested and I could see that sometimes both seems to work

EddieShipman, with your experience, do you think that it is possible to reach the result I expect? If no, I will close this thread and I will accept your help, at least I have it working anyway with one pin :)

What do you think about?
0
 
LVL 1

Author Comment

by:hidrau
ID: 18114896
With that program windowse I could see that for each pin there is a different handle.

Isn't there a way to list all Dict Post It by their handle and then call the the function
passing handle by handle? Well, I don't know if it is exactly this way that this work.

   SendMessage(AHandle, WM_LBUTTONDOWN, 0, MakeLParam(5, 5));
   SendMessage(AHandle, WM_LBUTTONUP, 0, MakeLParam(5, 5));

what do you think?

I changed the MakeLParam, and for 1,1 and only one button worked.

0
 
LVL 26

Expert Comment

by:EddieShipman
ID: 18115266
Why do you need to? I am "clicking" each button as it is found. I said that if there are any "pins"
already stuck, it will "unstick" them. These buttons do not have a "state" they act like speed buttons
without the "down" property. I tried querying their sate using the BM_GETSTATE message and they
ALWAYS returned 0, even when they were stuck.

I only have one dictionary so I cant fully test what you are seeing. I opened more results by clicking
the "More Results" button and then ran it and it "stuck" all the "pins".
0
 
LVL 1

Author Comment

by:hidrau
ID: 18115805
Ah, I see.

you can download the second dictionary to test.

http://www.infosoftlanguages.com.br/arquivos/full_spa_dict50.exe.

Yeah, you are right, there is not BM_GETSTATE message.


Thanks
0
 
LVL 26

Expert Comment

by:EddieShipman
ID: 18117315
There is a BM_GETSTATE message but sending the message to the buttons returns no result.
0
 
LVL 26

Expert Comment

by:EddieShipman
ID: 18119659
Check out this captured video (5.01 MB):
http://www.austinmetrobaseball.com/eddie/babylon.avi
0
 
LVL 1

Author Comment

by:hidrau
ID: 18121223
EddieShipman , thanks very much for your help
0
 
LVL 1

Author Comment

by:hidrau
ID: 18121284
I made some adaptation in my code. I learned a lot with your code, most of the things written are new for me.
:))

0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
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…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

743 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now