42Gears Speaks Driving Enterprise Mobility

11Oct/090

Simulating key presses in your program with keybd_event function

Out of need or curiosity you might want to know how to send key presses from your native application. The core of the solution involves calling keybd_event() function which has the following prototype.

VOID keybd_event(BYTE bVk, BYTE bScan, DWORD dwFlags, DWORD dwExtraInfo);

bVk is the virtual-key code of the character. bScan is the hardware scan code. dwFlags is an important field. If KEYEVENTF_KEYUP is specified in dwFlags field, the key is being released. If not specified, the key is being pressed.

Here is a function which simulates pressing of alphanumeric characters. See winuser.h for all available virtual key codes.

void SendStringKeys(char* pszChars)
{
while (*pszChars != NULL)
{
if ( (*pszChars >= 'A') && (*pszChars <= 'Z') )
keybd_event(VK_SHIFT, 0, KEYEVENTF_SILENT, 0);

keybd_event(toupper(*pszChars), 0, KEYEVENTF_SILENT, 0);
keybd_event(toupper(*pszChars), 0, KEYEVENTF_KEYUP|KEYEVENTF_SILENT, 0);

if ( (*pszChars >= 'A') && (*pszChars <= 'Z') )
keybd_event(VK_SHIFT, 0, KEYEVENTF_KEYUP|KEYEVENTF_SILENT, 0);

pszChars++;
}
}

And here is an example of how to call SendStringKeys function.

int _tmain(int argc, _TCHAR* argv[])
{
SendStringKeys("Hello World.");
return 0;
}

Go to Home


5Oct/090

Determining IP Address of a Windows Mobile device

Code to determine IP addresses of adapters on a Windows Mobile device, using IPHelper APIs.

Add Iphlpapi.lib to linker settings.

#include "Iphlpapi.h"

PIP_ADAPTER_INFO pinfo = NULL;
ULONG OutBufLen = 0;
DWORD dwRet = GetAdaptersInfo(NULL, &OutBufLen);
if (dwRet == ERROR_BUFFER_OVERFLOW)
{
pinfo = (PIP_ADAPTER_INFO)malloc(OutBufLen);
dwRet = GetAdaptersInfo(pinfo,&OutBufLen);
while (pinfo != NULL)
{
if (dwRet==ERROR_SUCCESS)
{
PIP_ADDR_STRING pAddressList = &(pinfo->IpAddressList);
do
{
printf(pAddressList->IpAddress.String);
pAddressList = pAddressList->Next;
} while (pAddressList != NULL);
}
pinfo = pinfo->Next;
}
free(pinfo);
}

Go to Home


5Oct/090

SureLock Studio : New Release (2009.10.4)

We are pleased to announce the release of SureLock Studio v2009.10.4. This release has some nice feature additions:

  • Select "Approved" program from Standard Programs List. No more typing of long paths.
  • Merge multiple cabs into a single cab to make deployment easier
  • Selectively enable hardware keys
  • Option to change border color of the Kiosk Main Screen
  • Access Remote Manager from a new toolbar button

Go to Home


Tagged as: No Comments
3Oct/090

[Article Posted] Businesses! Are your mobile devices working for you?

Read the full article here.

Go to Home


3Oct/090

SureLock Studio supports WM 6.5 devices

We have done extensive testing of SureLock on WM 6.5 environment and the software has behaved perfectly well. That puts WM 6.5 on the supported list of platforms. Here is the latest list:

Supported Platforms:

* Windows Mobile 6.5 (Classic & Professional)
* Windows Mobile 6.1 (Classic & Professional)
* Windows Mobile 6.0 (Classic & Professional)
* Windows Mobile 5.0 (Pocket PC and Pocket PC Phone Edition)

If you have any questions or feedback about SureLock Studio, please let us know.

Go to Home