Отловить показ клавиатуры

Средства разработки, технические вопросы, отвечает (по мере сил) Отдел Разработок
Закрыто
Muchano1979
Новенький (0 lvl)
Сообщения: 2
Зарегистрирован: Вт сен 12, 2006 12:46

Отловить показ клавиатуры

Сообщение Muchano1979 » Пн окт 09, 2006 14:32

Добрый день.

Будьте добры, подскажите - как отловить показ/скрытие экранной клавиатуры?

DE_NISKA
Аспирант (2 lvl)
Сообщения: 85
Зарегистрирован: Пт май 26, 2006 19:21

Сообщение DE_NISKA » Вт окт 10, 2006 20:42

SIPINFO si;

// Query the sip state and size our window appropriately.
memset (&si, 0, sizeof (si));
si.cbSize = sizeof (si);
SHSipInfo(SPI_GETSIPINFO, 0, (PVOID)&si, FALSE);

Дальше нужно смотреть значения:
typedef struct {
DWORD cbSize;
DWORD fdwFlags;
RECT rcVisibleDesktop;
RECT rcSipRect;
DWORD dwImDataSize;
VOID *pvImData;
} SIPINFO;

cbSize
Size, in bytes, of the SIPINFO structure. This member must be filled in by the application with the size of operator. Because the system can check the size of the structure to determine the operating system version number, this member allows for future enhancements to the SIPINFO structure while maintaining backward compatibility.
fdwFlags
Specifies flags representing state information of the input panel. It is any combination of the following bit flags:
Value Description
SIPF_DOCKED The input panel is docked, or not floating.
SIPF_LOCKED The input panel is locked, meaning that the user cannot change its visible status.
SIPF_OFF The input panel is off, or not visible.
SIPF_ON The input panel is on, or visible.
rcVisibleDesktop
Rectangle, in screen coordinates, that represents the area of the desktop not obscured by the input panel. If the input panel is floating, this rectangle is equivalent to the working area. Full-screen applications that respond to input panel size changes can set their window rectangle to this rectangle. If the input panel is docked but does not occupy an entire edge, then this rectangle represents the largest rectangle not obscured by the input panel. If an application wants to use the screen space around the input panel, it needs to reference rcSipRect.
rcSipRect
Rectangle, in screen coordinates of the window rectangle and not the client area, the represents the size and location of the input panel. An application does not generally use this information unless it needs to wrap around a floating or a docked input panel that does not occupy an entire edge.
dwImDataSize
Specifies the size of the data pointed to by the pvImData member.
pvImData
Void pointer to input method (IM)-defined data. The IM calls the IInputMethod::GetImData and IInputMethod::SetImData methods to send and receive information from this structure.

mkol
Академик (6 lvl)
Сообщения: 1189
Зарегистрирован: Вс апр 11, 2004 12:14

Сообщение mkol » Сб окт 14, 2006 22:25

При показе или скрытии виртуальной клавиатуры генерируется сообщение WM_SIZE.

DE_NISKA
Аспирант (2 lvl)
Сообщения: 85
Зарегистрирован: Пт май 26, 2006 19:21

Сообщение DE_NISKA » Вс окт 15, 2006 20:02

просто при использовании SHSipInfo можно узнать не только показана клавиатура или нет, но и сколько места она занимает на экране.

Закрыто

Вернуться в «Программирование для КПК»