30 Dec 2008

Serial port IRDA mode

Pour utiliser un port série en mode IR sous WINCE ou Windows Mobile

  1. Appeler la fonction EscapeCommFunction avec le paramètre dwFunc à SETIR.
  2. Utiliser les fonctions standards de communications série pour transmettre et recevoir des données.
  3. Appeler la fonction EscapeCommFunction avec le paramètre dwFunc à CLRIR pour remettre le port série en mode série classique.


 

To use a serial port in IR mode with WINCE or Windows Mobile

  1. Use the EscapeCommFunction function with the dwFunc parameter set to SETIR.
  2. Use the standard serial communications functions to transmit and receive data.
  3. Call the EscapeCommFunction with the dwFunc parameter set to CLRIR to set the port back to normal serial mode.


 

Audio Update registry

Quand vous faites des modifications en base de registre qui concernent le son, vous avez souvent besoin de reseter le device pour prendre en compte les modifications. Une autre solution est d'appeler la fonction non documentés suivante : AudioUpdateFromRegistry.

Pour l'importer en C# :

[DllImport("coredll")]

public
static
extern
void AudioUpdateFromRegistry();


 


 

When you make modifications concerning sounds in registry, sometimes you need to reboot your device to consider the modifications. Another solution is to call the undocumented function AudioUpdateFromRegistry.

Here is the C# import:

[DllImport("coredll")]

public
static
extern
void AudioUpdateFromRegistry();

26 Nov 2008

PInvoke DllIImport

When you are connecting managed code to native, it is often a pain to figure out how to write the “DllImport” properly. It allows you to search on a function name and see user contributed definitions for the DLL Import…

Pour l'import de fonctions natives dans votre code managée, voici une bonne adresse pour récupérer tous les DLLimports dont vous avez besoin. Cela vous permet de chercher à partir d'un nom de fonction et de récupérer la définition pour le "DLLimport".

http://www.pinvoke.net/

OpenNetCF SDF 2.3

The Smart Device Framework is our award-winning framework that provides hundreds of classes and thousands of properties and methods to extend the behavior of the .NET Compact Framework. SDF 2.3 is finally available

Le framework de développement pour Smart device qui propose des 100 de classes et de propriétés pour étendre les fonctionnalités du Compact Framework est maintenant disponible en version 2.3.

  • Visual Studio 2008 Designer Support (CF 2.0 projects only)
  • Full Library Source Code
  • Visual Studio 2008 Sample Applications, including source code
  • Visual Studio 2008 Help Integration



  • 18 Nov 2008

    Change the keyboard layout

    Un petit article sur comment changer le layout du clavier sous Windows CE, premièrement vous pouvez utiliser la fonction suivante pour récupérer la liste de tout les layouts pré-chargés.
    A small post on how to change the keyboard layout, first of all, you can use the following function to get the list of all the pre-downloaded layouts:

    UINT GetKeyboardLayoutList(int nBuff, HKL* lpList);
    http://msdn.microsoft.com/en-us/library/ms646297(VS.85).aspx

    Ensuite pour activer le layout désiré, appeler la fonction suivante :
    Then to activate the chosen layout, call the following function:

    HKL ActivateKeyboardLayout(HKL hkl, UINT Flags);
    http://msdn.microsoft.com/en-us/library/ms646289(VS.85).aspx

    Autrement vous devez pouvoir simuler un appui sur ALT+SHIFT en remontant le message suivant :
    Then, you can also simulate a press on ALT+SHIFT and get back the following message:

    WM_INPUTLANGCHANGEREQUEST
    http://msdn.microsoft.com/en-us/library/ms632630(VS.85).aspx

    Thanks to Otter for this tip.