Top.Mail.Ru
Мастера DELPHI, Delphi programming community Титульная страница Поиск, карта сайта Написать письмо 
| Новости | Поиск | FAQ | Статьи | Книги | Новости VCL |
| Форумы ЧАТ | Орешник | KOL и MCK |
Форумы -» Основная («Начинающим»)/ Базы / WinAPI / Компоненты / Сети / Media / Игры / Corba и COM / KOL / FreePascal / .Net / Прочее / RSDN.ORG

« предыдущая ветвь | форум | следующая ветвь »

семитировать ввод в поле с клавиатуры


Страницы:   1 2

Петр ©   (2007-12-08 14:16:00) 

здравствуйте, подскажите пожалуйста как семитировать ввод в поле с клавиатуры.....


Петр   (2007-12-08 14:56:00) [21]

как узнать хендл поля ввода? спасибо....


Петр   (2007-12-08 14:55:00) [22]

форма не моя....


{RASkov}   (2007-12-08 14:54:00) [23]

> [12] Петр   (08.12.07 14:50)
> если только одно окно

Чьё оно???

> можно в 1 параметре HWND_BROADCAST?

Нет.
В первом параметре должен быть хендл поля ввода...


Петр   (2007-12-08 14:50:00) [24]

необходимо заполнит анкету и наглядно продемонстрировать как это происходит тоесть напечатать текст за пользователя...если только одно окно то можно в 1 параметре HWND_BROADCAST?


Dib@zol   (2007-12-08 14:44:00) [25]

> [7] Петр   (08.12.07 14:38)

Первым параметром нужно проставить не WM_CHAR (в отличие от второго) а хендл того окна, кому ты собсна посылаешь этот WM_CHAR. Определить хендл можно многими способами, однако я рекомендую FindWindowEx.

FindWindowEx [Quick info] [Overwiew] [Group]

The FindWindowEx function retrieves the handle to a window whose class name and window name match the specified strings. The function searches child windows, beginning with the one following the given child window.

HWND FindWindowEx(

   HWND hwndParent, // handle to parent window
   HWND hwndChildAfter, // handle to a child window
   LPCTSTR lpszClass, // pointer to class name
   LPCTSTR lpszWindow // pointer to window name
  );


Parameters

hwndParent

Identifies the parent window whose child windows are to be searched.
If hwndParent is NULL, the function uses the desktop window as the parent window. The function searches among windows that are child windows of the desktop.

hwndChildAfter

Identifies a child window. The search begins with the next child window in the Z order. hwndChildAfter must be a direct child window of hwndParent, not just a descendant window.
If hwndChildAfter is NULL, the search begins with the first child window of hwndParent.
Note that if both hwndParent and hwndChildAfter are NULL, the function searches all top-level windows.

lpszClass

Points to a null-terminated string that specifies the class name or is an atom that identifies the class-name string. If this parameter is an atom, it must be a global atom created by a previous call to the GlobalAddAtom function. The atom, a 16-bit value, must be placed in the low-order word of lpszClass; the high-order word must be zero.

lpszWindow

Points to a null-terminated string that specifies the window name (the window's title). If this parameter is NULL, all window names match.



Return Values

If the function succeeds, the return value is the handle to the window that has the specified class and window names.
If the function fails, the return value is NULL. To get extended error information, call GetLastError.


{RASkov}   (2007-12-08 14:44:00) [26]

> [7] Петр   (08.12.07 14:38)

поле ввода чье? твое? если да то в одном приложении или из одного приложения хочешь послать в другое(но оба твои)?
Или поле "чужое"? Давай подробнее вопрос.... И, самое главное, для чего тебе это нужно???

> [8] Петр   (08.12.07 14:39)

:)
Кто? дядя Вася?
Вообще по этой функции(она АПИ) есть онлайн хелп и независит от ОС :)


{RASkov}   (2007-12-08 14:44:00) [27]

.... может и решение проще найдется)


Петр   (2007-12-08 14:39:00) [28]

и он говорит что справка не поддерживается в windows vista


Петр   (2007-12-08 14:38:00) [29]

1 спасибо а как получить handle of destination window для окна?
2 что писать в message to send
3 первый параметр напиать WM_CHAR?
4 второй тоже WM_CHAR?
зарание большое спасибо!


{RASkov}   (2007-12-08 14:35:00) [30]

> [4] Петр   (08.12.07 14:30)
> у меня к сожалению не работает справка...

В делфи в меню есть пункт Help в нем есть пункт Windows SDK "вылезет" окошко хелпа, там есть закладка "Предметный Указатель" вводишь туда SendMessage

нажатие F1 - он не всегда почему-то работает по АПИ функциям, по крайней мере у меня так....(


{RASkov}   (2007-12-08 14:31:00) [31]

> [4] Петр   (08.12.07 14:30)
> параметры в SendMessage();

LRESULT SendMessage(

   HWND hWnd, // handle of destination window
   UINT Msg, // message to send
   WPARAM wParam, // first message parameter
   LPARAM lParam  // second message parameter
  );


Parameters

hWnd

Identifies the window whose window procedure will receive the message. If this parameter is HWND_BROADCAST, the message is sent to all top-level windows in the system, including disabled or invisible unowned windows, overlapped windows, and pop-up windows; but the message is not sent to child windows.

Msg

Specifies the message to be sent.

wParam

Specifies additional message-specific information.

lParam

Specifies additional message-specific information.


Петр   (2007-12-08 14:30:00) [32]

у меня к сожалению не работает справка... подскажите какие параметры в SendMessage();


{RASkov}   (2007-12-08 14:24:00) [33]

> [2] Петр   (08.12.07 14:20)
> можно пожалуйста поподробнее

Послать сообщение(WM_CHAR)второй параметр) окну(!)(первый параметр)
WM_CHAR  
chCharCode = (TCHAR) wParam;    // character code
lKeyData = lParam;              // key data
Еще подробнее в Ф1.


Петр   (2007-12-08 14:20:00) [34]

спасибо а можно пожалуйста поподробнее


Dib@zol   (2007-12-08 14:19:00) [35]

Что сделать? Может, сЫмитировать? Увожайте рускей изыг, таваищи!
А по теме - SendMessage + WM_CHAR + (WM_KEYDOWN+WM_KEYUP)


Страницы:   1 2

Наверх

Титульная страница Поиск, карта сайта Написать письмо