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

Вниз

Получение текста из адресной строки explorera   Найти похожие ветки 

 
balamutik ©   (2005-05-04 14:13) [0]

Помогите кто-нить с этой проблемой.
Спасибо заранее!!!


 
easy ©   (2005-05-04 15:18) [1]

function PrintEnumProc(Wnd: HWND; LParam: LPARAM): BOOL; stdcall;
const
 MaxTextSize = 1024;
var
 PrText: array[0..MaxTextSize] of char;
begin
 Result := True;  { continue enumerating }
 windows.GetClassName(Wnd,PrText,MaxTextSize);
 if PrText="Edit" then begin
    SendMessage(Wnd, WM_GETTEXT, MaxTextSize, longint(@PrText));
    TMemo(Pointer(LParam)^).Lines.Add(PrText);
    Result:=false;
 end;
end;

procedure TForm1.Button1Click(Sender: TObject);
var
 W: HWND;
begin
 Memo1.Clear;
 W := FindWindow("ExploreWClass", nil);
 if W = 0 then
   raise Exception.Create("Explorer window not found");
 EnumChildWindows(W, @PrintEnumProc, LPARAM(@memo1));
end;


 
Dextor ©   (2005-05-04 15:41) [2]

function GetText(WindowHandle: hwnd): string;
var
 txtLength: integer;
 buffer: string;
begin
 TxtLength := SendMessage(WindowHandle, WM_GETTEXTLENGTH, 0, 0);
 txtlength := txtlength + 1;
 setlength(buffer, txtlength);
 sendmessage(WindowHandle, wm_gettext, txtlength, longint(@buffer[1]));
 result := buffer;
end;

 
function GetURL: string;
var
 ie, toolbar, combo,
   comboboxex, edit,
   worker, toolbarwindow: hwnd;
begin
 ie := FindWindow(pchar("IEFrame"), nil);
 worker := FindWindowEx(ie, 0, "WorkerA", nil);
 toolbar := FindWindowEx(worker, 0, "rebarwindow32", nil);
 comboboxex := FindWindowEx(toolbar, 0, "comboboxex32", nil);
 combo := FindWindowEx(comboboxex, 0, "ComboBox", nil);
 edit := FindWindowEx(combo, 0, "Edit", nil);
 toolbarwindow := FindWindowEx(comboboxex, 0, "toolbarwindow32", nil);

 result := GetText(edit);

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


МОЖНО ЕЩЕ ТАК:

uses windows, ddeman, ......

function Get_URL(Servicio: string): String;
uses windows, ddeman, ......

function Get_URL(Servicio: string): String;
var
 Cliente_DDE: TDDEClientConv;
 temp:PChar;    
begin
  Result := "";
  Cliente_DDE:= TDDEClientConv.Create( nil );
   with Cliente_DDE do
      begin
         SetLink( Servicio,"WWW_GetWindowInfo");
         temp := RequestData("0xFFFFFFFF");
         Result := StrPas(temp);
         StrDispose(temp);  //<<-Предотвращаем утечку памяти
         CloseLink;
      end;
    Cliente_DDE.Free;
end;

procedure TForm1.Button1Click(Sender);
begin
 showmessage(Get_URL("Netscape"));
    или
 showmessage(Get_URL("IExplore"));
end;


 
Dextor ©   (2005-05-04 15:42) [3]

function GetText(WindowHandle: hwnd): string;
var
 txtLength: integer;
 buffer: string;
begin
 TxtLength := SendMessage(WindowHandle, WM_GETTEXTLENGTH, 0, 0);
 txtlength := txtlength + 1;
 setlength(buffer, txtlength);
 sendmessage(WindowHandle, wm_gettext, txtlength, longint(@buffer[1]));
 result := buffer;
end;

 
function GetURL: string;
var
 ie, toolbar, combo,
   comboboxex, edit,
   worker, toolbarwindow: hwnd;
begin
 ie := FindWindow(pchar("IEFrame"), nil);
 worker := FindWindowEx(ie, 0, "WorkerA", nil);
 toolbar := FindWindowEx(worker, 0, "rebarwindow32", nil);
 comboboxex := FindWindowEx(toolbar, 0, "comboboxex32", nil);
 combo := FindWindowEx(comboboxex, 0, "ComboBox", nil);
 edit := FindWindowEx(combo, 0, "Edit", nil);
 toolbarwindow := FindWindowEx(comboboxex, 0, "toolbarwindow32", nil);

 result := GetText(edit);

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


 
Dextor ©   (2005-05-04 15:43) [4]

СОРРИ, глюкануло


 
balamutik ©   (2005-05-04 19:15) [5]

спасибо большое
всем!!!



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

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

Наверх




Память: 0.48 MB
Время: 0.028 c
1-1118068564
WondeRu
2005-06-06 18:36
2005.06.29
Ошибка при очистке дерева объектов!


14-1117439308
Kolan
2005-05-30 11:48
2005.06.29
что такое xmas


14-1117465281
HBreaker
2005-05-30 19:01
2005.06.29
Как вывести строчку на принтер использую assembler и прерывания


1-1117865358
Brain Force
2005-06-04 10:09
2005.06.29
Динамическое изменение обработчика кнопки


6-1112164956
dtm
2005-03-30 10:42
2005.06.29
Подключение IdHTTP через прокси и получение результата в строку