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.

86 lines
2.3 KiB

  1. /*****************************************************************************
  2. *
  3. * ftppf.cpp - Progress Feedback
  4. *
  5. *****************************************************************************/
  6. #include "priv.h"
  7. /*****************************************************************************
  8. *
  9. * HPF - Handle to progress feedback
  10. *
  11. * Shhh... Don't tell anyone, but it's just a window handle.
  12. *
  13. * It's the handle of the status bar window to use. We use the
  14. * second part (part number one, since they start at zero) to display
  15. * connection feedback.
  16. *
  17. * We don't use SIMPLE mode, because DefView uses SIMPLE mode to display
  18. * menu feedback.
  19. *
  20. *****************************************************************************/
  21. #define hwndNil
  22. /*****************************************************************************
  23. *
  24. * FtpPf_Begin
  25. *
  26. *****************************************************************************/
  27. HPF FtpPf_Begin(HWND hwndOwner)
  28. {
  29. HWND hwnd;
  30. ASSERTNONCRITICAL;
  31. hwnd = Misc_FindStatusBar(hwndOwner);
  32. if (hwnd)
  33. {
  34. SendMessage(hwnd, SB_SETTEXT, 1 | SBT_NOBORDERS, 0);
  35. }
  36. return (HPF)hwnd;
  37. }
  38. /*****************************************************************************
  39. *
  40. * FtpPf_Status
  41. *
  42. * ids = string to display in status bar
  43. * ptsz = optional insert
  44. *
  45. *****************************************************************************/
  46. void FtpPf_Status(HPF hpf, UINT ids, LPCTSTR pszParameters)
  47. {
  48. HWND hwnd = (HWND)hpf;
  49. ASSERTNONCRITICAL;
  50. if (EVAL(hwnd))
  51. {
  52. TCHAR szMsgTemplate[256];
  53. TCHAR szMessage[1024];
  54. LoadString(g_hinst, ids, szMsgTemplate, ARRAYSIZE(szMsgTemplate));
  55. wnsprintf(szMessage, ARRAYSIZE(szMessage), szMsgTemplate, pszParameters);
  56. SendMessage(hwnd, SB_SETTEXT, 1 | SBT_NOBORDERS, (LPARAM)szMessage);
  57. UpdateWindow(hwnd);
  58. }
  59. }
  60. /*****************************************************************************
  61. *
  62. * FtpPf_End
  63. *
  64. *****************************************************************************/
  65. void FtpPf_End(HPF hpf)
  66. {
  67. HWND hwnd;
  68. ASSERTNONCRITICAL;
  69. hwnd = (HWND)hpf;
  70. if (hwnd)
  71. {
  72. SendMessage(hwnd, SB_SETTEXT, 1 | SBT_NOBORDERS, 0);
  73. }
  74. }