Главная страница
Top.Mail.Ru    Яндекс.Метрика
Текущий архив: 2006.04.23;
Скачать: CL | DM;

Вниз

Подскажите о методе нажатия кнопку в другом приложении   Найти похожие ветки 

 
hgd   (2006-02-03 11:56) [0]

Как дальше воспользоваться данными процедурами?

function EnumChildProc(Wnd: hWnd; SL: TStrings): BOOL; stdcall;
var
 szFull: array[0..MAX_PATH] of Char; //Buffer for window caption
begin
 Result := Wnd <> 0;
 if Result then
 begin
   GetWindowText(Wnd, szFull, SizeOf(szFull)); // put window text in buffer
   if (Pos(SL[0], StrPas(szFull)) > 0) // Test for text
     and (SL.IndexOfObject(TObject(Wnd)) < 0) // Test for duplicate handles
     then SL.AddObject(StrPas(szFull), TObject(Wnd)); // Add item to list
   EnumChildWindows(Wnd, @EnumChildProc, Longint(SL)); //Recurse into child windows
 end;
end;

function ClickButton(ParentWindow: Hwnd; ButtonCaption: string): Boolean;
var
 SL: TStringList;
 H:  hWnd;
begin
 SL := TStringList.Create;
 try
   SL.AddObject(ButtonCaption, nil); // First item in list is text to find
   EnumChildWindows(ParentWindow, @EnumChildProc, Longint(SL));
   H := 0;
   case SL.Count of
     1: ShowMessage("Window text not found.");
     2: H := hWnd(SL.Objects[1]);
     else
       ShowMessage("Ambiguous text detected.");
   end;
 finally
   SL.Free;
 end;
 Result := H <> 0;
 if Result then PostMessage(H, BM_CLICK, 0, 0);
end;

// Rememeber the ampresand for underlined characters
// if the "c" is underlined, then the text is "&click"


 
Гошик Кувшинов   (2006-02-03 12:42) [1]

сюда ходи http://www.delphikingdom.com/asp/itemq.asp?Mode=1&ItemID=463



Страницы: 1 вся ветка

Текущий архив: 2006.04.23;
Скачать: CL | DM;

Наверх




Память: 0.46 MB
Время: 0.043 c
1-1142857647
StriderMan
2006-03-20 15:27
2006.04.23
Как реализовать SPA (безопасная проверка пароля)


15-1143905550
unknown
2006-04-01 19:32
2006.04.23
Эльбрус 6к


15-1141567010
psa247
2006-03-05 16:56
2006.04.23
Парсинг пути к файлу


15-1144042354
Ega23
2006-04-03 09:32
2006.04.23
С Днём рождения! 1 апреля


15-1144160567
Volf_555
2006-04-04 18:22
2006.04.23
Как подлкючить человека? Живёт от меня на расстоянии ~130 м