HPC.ru lite - Все форумы
Форум: Программирование для КПК
Тема: Отловить показ клавиатуры

[Ответить]
Muchano1979 [09.10.2006 14:32] Отловить показ клавиатуры:
Добрый день.

Будьте добры, подскажите - как отловить показ/скрытие экранной клавиатуры?
DE_NISKA [10.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 [14.10.2006 22:25] :
При показе или скрытии виртуальной клавиатуры генерируется сообщение WM_SIZE.
DE_NISKA [15.10.2006 20:02] :
просто при использовании SHSipInfo можно узнать не только показана клавиатура или нет, но и сколько места она занимает на экране.
[Ответить]