This example closes a keyboard handle.

#include <stdio.h>
#include <unikbd.h>

int main(void) {

   KHAND      kbdhandle;
   KBDNAME   *kbd_name;
   ULONG      mode     = 0;
   APIRET     rc;

   /***************************************************/
   /* Create a keyboard handle for US keyboard layout */
   /***************************************************/

   kbd_name = (UniChar*)L"us";

   rc = UniCreateKeyboard( &kbdhandle, kbd_name, mode );

   if ( rc != ULS_SUCCESS ) {
      printf("UniCreateKeyboard error: return code = %u\n", rc );
      return 1;
   }

   rc = UniDestroyKeyboard( kbdhandle );

   if ( rc != ULS_SUCCESS ) {
      printf("UniDestroyKeyboard error: return code = %u\n", rc );
      return 1;
   }

   return ULS_SUCCESS;
}


[Back: UniDestroyKeyboard - Remarks]
[Next: UniDestroyKeyboard - Topics]