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.

87 lines
3.2 KiB

  1. #if defined INCL_KEY_MACROS
  2. #if !defined KEY_UTIL_H
  3. #define KEY_UTIL_H
  4. #pragma once
  5. //******************************************************************************
  6. // File: \wacker\tdll\keyutilhc Created: 6/4/98 By: Dwayne M. Newsome
  7. //
  8. // Copyright 1998 by Hilgraeve Inc. --- Monroe, MI
  9. // All rights reserved
  10. //
  11. // Description:
  12. // This file contains utility functions to handle keyboard macros and macro
  13. // GUI display.
  14. //
  15. // $Revision: 1 $
  16. // $Date: 10/05/98 12:37p $
  17. // $Id: keyutil.h 1.1 1998/06/11 12:02:30 dmn Exp $
  18. //
  19. //******************************************************************************
  20. #define KEYS_MAX_KEYS 100 // Max keydefs per macro
  21. #define KEYS_MAX_MACROS 100 // Max macros for session
  22. #define KEYS_EDIT_MODE_EDIT 0
  23. #define KEYS_EDIT_MODE_INSERT 1
  24. //
  25. // keyMacro structure used in key dialogs and terminal key lookups
  26. //
  27. struct stKeyMacro
  28. {
  29. KEYDEF keyName; // Assigned key
  30. KEYDEF keyMacro[KEYS_MAX_KEYS]; // Array to hold the macro KEYDEFs
  31. int macroLen; // # of hKeys in the macro
  32. int editMode; // 0 = modify mode; 1 = insert mode
  33. int altKeyValue; // used to handle alt key sequences
  34. int altKeyCount; // "
  35. int keyCount; // max keys allowed in edit control
  36. int insertMode; // flag for insert mode (special chars)
  37. HSESSION hSession; // Session handle
  38. WNDPROC lpWndProc; // old window procedure before key edit subclass
  39. };
  40. typedef struct stKeyMacro keyMacro;
  41. //
  42. // these functions are declared external as they are used to interface
  43. // to C++ classes. These functions are declared extern "C" in the keyextrn file
  44. // this has to be done in a CPP file.
  45. //
  46. extern int keysAddMacro( const keyMacro * pMarco );
  47. extern int keysGetKeyCount( void );
  48. extern int keysGetMacro( int aIndex, keyMacro * pMarco );
  49. extern int keysFindMacro( const keyMacro * pMarco );
  50. extern int keysLoadMacroList( HSESSION hSession );
  51. extern int keysLoadSummaryList( HWND listBox );
  52. extern int keysRemoveMacro( keyMacro * pMarco );
  53. extern int keysSaveMacroList( HSESSION hSession );
  54. extern int keysUpdateMacro( int aIndex, const keyMacro * pMarco );
  55. //
  56. // dialog and window procedure definitions for key macro dialogs and edit control
  57. //
  58. BOOL CALLBACK KeySummaryDlg(HWND hDlg, UINT wMsg, WPARAM wPar, LPARAM lPar);
  59. BOOL CALLBACK KeyDlg(HWND hDlg, UINT wMsg, WPARAM wPar, LPARAM lPar);
  60. LRESULT CALLBACK keyEditWindowProc( HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam );
  61. //
  62. // utility functions that do not need to access the C++ keymacro classes
  63. //
  64. keyMacro * keysCreateKeyMacro( void );
  65. keyMacro * keysCloneKeyMacro( const keyMacro * aKeyMacro );
  66. void keysResetKeyMacro( keyMacro * aKeyMacro );
  67. int keysGetDisplayString( KEYDEF * pKeydef, int aNumKeys, LPTSTR aString,
  68. unsigned int aMaxLen );
  69. int keysLookupKeyASCII( KEYDEF aKey, LPTSTR aKeyName, int aNameSize );
  70. int keysLookupKeyHVK( KEYDEF aKey, LPTSTR aKeyName, int aNameSize );
  71. int keysIsKeyHVK( KEYDEF aKey );
  72. #endif
  73. #endif