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.

149 lines
3.4 KiB

  1. /*++
  2. Copyright (c) 1999-2002 Microsoft Corporation
  3. Module Name:
  4. util.h
  5. --*/
  6. /****************************************************************************
  7. PROTOTYPES DECLARATION FOR UTIL MODULE
  8. ****************************************************************************/
  9. #define InternalError(Code, Location) \
  10. InformationBox(ERR_Internal_Error, FormatStatusCode(Code), \
  11. Location, FormatStatus(Code))
  12. //Current Help Id for Open, Merge, Save and Open project dialog box
  13. extern WORD g_CurHelpId;
  14. // Number of dialog/message boxes currently open
  15. extern int g_nBoxCount;
  16. // Opens a standard error Dialog Box (Parent is hwnd)
  17. BOOL ErrorBox(HWND hwnd, UINT type, int wErrorFormat, ...);
  18. void InformationBox(WORD wDescript, ...);
  19. // Opens a message box with the QCWin title
  20. int MsgBox(HWND hwndParent, PTSTR szText, UINT wType);
  21. // Loads and execute dialog box 'rcDlgNb' with 'dlgProc' function
  22. int StartDialog(int rcDlgNb, DLGPROC dlgProc, LPARAM);
  23. // Loads a resource string from resource file
  24. void LoadResourceString(
  25. WORD wStrId,
  26. PTSTR lpszStrBuffer);
  27. //Opens a standard question box containing combination
  28. //of : Yes, No, Cancel
  29. int CDECL QuestionBox(
  30. WORD wMsgFormat,
  31. UINT wType,
  32. ...);
  33. //Opens a standard question box containing combination
  34. //of : Yes, No, Cancel
  35. int CDECL QuestionBox2(HWND hwnd, WORD wMsgFormat, UINT wType, ...);
  36. // Drain the thread message queue.
  37. void ProcessPendingMessages(void);
  38. //Initialize files filters for dialog boxes using commonfile DLL
  39. void InitFilterString(WORD id, PTSTR filter, int maxLen);
  40. //Check if keyboard hit is NUMLOCK, CAPSLOCK or INSERT
  41. LRESULT KeyboardHook( int iCode, WPARAM wParam, LPARAM lParam );
  42. //Opens a Dialog box with a title and accepting a printf style for text
  43. int InfoBox(
  44. PTSTR text,
  45. ...);
  46. UINT_PTR
  47. APIENTRY
  48. DlgFile(
  49. HWND hDlg,
  50. UINT uMsg,
  51. WPARAM wParam,
  52. LPARAM lParam
  53. );
  54. BOOL StartFileDlg(HWND hwnd, int titleId, int defExtId,
  55. int helpId, int templateId,
  56. PTSTR InitialDir, PTSTR fileName,
  57. DWORD *pFlags, LPOFNHOOKPROC lpfnHook);
  58. void DECLSPEC_NORETURN ExitDebugger(PDEBUG_CLIENT Client, ULONG Code);
  59. void DECLSPEC_NORETURN ErrorExit(PDEBUG_CLIENT Client, PCSTR Format, ...);
  60. HWND
  61. MDIGetActive(
  62. HWND hwndParent,
  63. BOOL *lpbMaximized
  64. );
  65. LPSTR
  66. FormatAddr64(
  67. ULONG64 addr
  68. );
  69. int matchExt (PTSTR pTargExt, PTSTR pSrcList);
  70. void ReorderChildren(
  71. HWND hwndPrev,
  72. HWND hwndCur,
  73. HWND hwndNew,
  74. BOOL bUserActivated);
  75. void ActivateMDIChild(
  76. HWND hwndNew,
  77. BOOL bUserActivated);
  78. void SetProgramArguments(
  79. PTSTR lpszTmp);
  80. void
  81. AppendTextToAnEditControl(
  82. HWND hwnd,
  83. PTSTR pszNewText);
  84. VOID
  85. CopyToClipboard(
  86. PSTR str,
  87. BOOL ExpandLf);
  88. void SetAllocString(PSTR* Str, PSTR New);
  89. BOOL DupAllocString(PSTR* Str, PSTR New);
  90. BOOL PrintAllocString(PSTR* Str, int Len, PCSTR Format, ...);
  91. HMENU CreateContextMenuFromToolbarButtons(ULONG NumButtons,
  92. TBBUTTON* Buttons,
  93. ULONG IdBias);
  94. HWND AddButtonBand(HWND Bar, PTSTR Text, PTSTR SizingText, UINT Id);
  95. enum KNOWN_EXT
  96. {
  97. EXT_DUMP,
  98. EXT_EXE,
  99. KNOWN_EXT_COUNT
  100. };
  101. KNOWN_EXT RecognizeExtension(PTSTR Path);