![]() |
|
|
Регистрация | << Правила форума >> | FAQ | Пользователи | Календарь | Поиск | Сообщения за сегодня | Все разделы прочитаны |
![]() |
|
Опции темы | Поиск в этой теме | Опции просмотра |
|
#1
|
||||
|
||||
![]() Как узнать имя объекта в чужом окне... например(TEdit)?
Если известен только текст? Тока нинадо меня посылать в гугл я там был ![]() |
#2
|
||||
|
||||
![]() Имя не как не узнаешь. Можешь узнать хендл.
Некоторые программисты настолько ленивы, что сразу пишут рабочий код. Если вас наказали ни за что - радуйтесь: вы ни в чем не виноваты. |
#3
|
||||
|
||||
![]() ...
вобщем у меня такая проблема я ищу едит в чужом окне... но их там много я незнаю как именно обратиться в нужный едит... Код:
var s:PChar; h:HWnd; begin s:='text'; h:=FindWindow(nil, 'Program'); h:=FindWindowEx(h, 0, 'TEdit', nil); SendMessage(h, WM_SEtTEXT, 0, integer(s)) end; можно ли узнать: Код:
h:=FindWindowEx(h, 0, 'TEdit', 'как можно узнать это?'); ![]() |
#4
|
||||
|
||||
![]() HWND WINAPI CreateWindow(
__in_opt LPCTSTR lpClassName, __in_opt LPCTSTR lpWindowName, __in DWORD dwStyle, __in int x, __in int y, __in int nWidth, __in int nHeight, __in_opt HWND hWndParent, __in_opt HMENU hMenu, __in_opt HINSTANCE hInstance, __in_opt LPVOID lpParam ); Parameters lpClassName [in, optional] LPCTSTR A null-terminated string or a class atom created by a previous call to the RegisterClass or RegisterClassEx function. The atom must be in the low-order word of lpClassName; the high-order word must be zero. If lpClassName is a string, it specifies the window class name. The class name can be any name registered with RegisterClass or RegisterClassEx, provided that the module that registers the class is also the module that creates the window. The class name can also be any of the predefined system class names. For a list of system class names, see the Remarks section. lpWindowName [in, optional] LPCTSTR The window name. If the window style specifies a title bar, the window title pointed to by lpWindowName is displayed in the title bar. When using CreateWindow to create controls, such as buttons, check boxes, and static controls, use lpWindowName to specify the text of the control. When creating a static control with the SS_ICON style, use lpWindowName to specify the icon name or identifier. To specify an identifier, use the syntax "#num". Пишу программы за еду. __________________ |
#5
|
||||
|
||||
![]() Код:
unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls; type TForm1 = class(TForm) Edit1: TEdit; Button1: TButton; procedure FormCreate(Sender: TObject); procedure Button1Click(Sender: TObject); private { Private declarations } public { Public declarations } end; var Form1: TForm1; h: THandle; implementation {$R *.dfm} procedure TForm1.FormCreate(Sender: TObject); begin h:=CreateWindow('EDIT', 'bla', WS_CHILD, 10, 10, 100, 20, Handle, 0, HInstance, nil); // lpWindowName: PChar = bla ShowWindow(h, SW_SHOW); end; procedure TForm1.Button1Click(Sender: TObject); var buf: array [0..$ff] of Char; l: Integer; begin l:=GetWindowText(h, buf, $100); Edit1.Text:=Copy(buf, 1, l); // = bla end; end. Пишу программы за еду. __________________ |
#6
|
||||
|
||||
![]() что то я нифига не понял
![]() |