Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

51 lines
1.3 KiB

  1. #ifndef __SETMODE_H__
  2. #define __SETMODE_H__
  3. #include "imm.h"
  4. #include "msime.h"
  5. #ifdef __cplusplus
  6. extern "C" { /* Assume C declarations for C++ */
  7. #endif /* __cplusplus */
  8. #ifndef RC_INVOKED
  9. #pragma pack(1) /* Assume byte packing throughout */
  10. #endif /* !RC_INVOKED */
  11. #define SZ_IMM32 TEXT("imm32.dll")
  12. // Additional modebias bits definition
  13. #ifndef MODEBIASMODE_DIGIT
  14. #define MODEBIASMODE_DIGIT 0x00000004 // ANSI-Digit Recommended Mode
  15. #endif
  16. #ifndef MODEBIASMODE_URLHISTORY
  17. #define MODEBIASMODE_URLHISTORY 0x00010000 // URL history
  18. #endif
  19. inline void SetModeBias(DWORD dwMode)
  20. {
  21. typedef HWND (WINAPI *FNIMMGETDEFAULTIMEWND)(HWND);
  22. HMODULE hmod = GetModuleHandle(SZ_IMM32);
  23. if (hmod)
  24. {
  25. FNIMMGETDEFAULTIMEWND lpfn = (FNIMMGETDEFAULTIMEWND)GetProcAddress(hmod, "ImmGetDefaultIMEWnd");
  26. UINT uiMsg= RegisterWindowMessage( RWM_MODEBIAS );
  27. if (uiMsg > 0 && lpfn)
  28. {
  29. HWND hwnd = (lpfn)(NULL);
  30. SendMessage(hwnd, uiMsg, MODEBIAS_SETVALUE, dwMode);
  31. }
  32. }
  33. }
  34. #ifndef RC_INVOKED
  35. #pragma pack()
  36. #endif /* !RC_INVOKED */
  37. #ifdef __cplusplus
  38. } /* end of 'extern "C" {' */
  39. #endif // __cplusplus
  40. #endif