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.

71 lines
2.7 KiB

  1. // $REVIEW(tongl) the win32 Macros does not call ::SendMessage !!!
  2. // This is a temporary solution, sent mail to BryanT, vcsig
  3. #pragma once
  4. #ifndef SNDMSG
  5. #ifdef __cplusplus
  6. #define SNDMSG ::SendMessage
  7. #else
  8. #define SNDMSG SendMessage
  9. #endif
  10. #endif // ifndef SNDMSG
  11. #ifndef POSTMSG
  12. #ifdef __cplusplus
  13. #define POSTMSG ::PostMessage
  14. #else
  15. #define POSTMSG PostMessage
  16. #endif
  17. #endif // ifndef POSTMSG
  18. // ListBox_InsertString
  19. #define Tcp_ListBox_InsertString(hwndCtl, index, lpsz) ((int)(DWORD)SNDMSG((hwndCtl), LB_INSERTSTRING, (WPARAM)(int)(index), (LPARAM)(PCWSTR)(lpsz)))
  20. // ListBox_AddString
  21. #define Tcp_ListBox_AddString(hwndCtl, lpsz) ((int)(DWORD)SNDMSG((hwndCtl), LB_ADDSTRING, 0L, (LPARAM)(PCWSTR)(lpsz)))
  22. // ListBox_DeleteString
  23. #define Tcp_ListBox_DeleteString(hwndCtl, index) ((int)(DWORD)SNDMSG((hwndCtl), LB_DELETESTRING, (WPARAM)(int)(index), 0L))
  24. // ListBox_SetCurSel
  25. #define Tcp_ListBox_SetCurSel(hwndCtl, index) ((int)(DWORD)SNDMSG((hwndCtl), LB_SETCURSEL, (WPARAM)(int)(index), 0L))
  26. // ListBox_GetCount
  27. #define Tcp_ListBox_GetCount(hwndCtl) ((int)(DWORD)SNDMSG((hwndCtl), LB_GETCOUNT, 0L, 0L))
  28. // ListBox_GetTextLen
  29. #define Tcp_ListBox_GetTextLen(hwndCtl, index) ((int)(DWORD)SNDMSG((hwndCtl), LB_GETTEXTLEN, (WPARAM)(int)(index), 0L))
  30. // ListBox_GetText
  31. #define Tcp_ListBox_GetText(hwndCtl, index, lpszBuffer) ((int)(DWORD)SNDMSG((hwndCtl), LB_GETTEXT, (WPARAM)(int)(index), (LPARAM)(PCWSTR)(lpszBuffer)))
  32. // ListBox_GetCount
  33. #define Tcp_ListBox_GetCount(hwndCtl) ((int)(DWORD)SNDMSG((hwndCtl), LB_GETCOUNT, 0L, 0L))
  34. // ListBox_DeleteString
  35. #define Tcp_ListBox_DeleteString(hwndCtl, index) ((int)(DWORD)SNDMSG((hwndCtl), LB_DELETESTRING, (WPARAM)(int)(index), 0L))
  36. // ListBox_GetCurSel
  37. #define Tcp_ListBox_GetCurSel(hwndCtl) ((int)(DWORD)SNDMSG((hwndCtl), LB_GETCURSEL, 0L, 0L))
  38. // ListBox_ResetContent
  39. #define Tcp_ListBox_ResetContent(hwndCtl) ((BOOL)(DWORD)SNDMSG((hwndCtl), LB_RESETCONTENT, 0L, 0L))
  40. // ListBox_FindStrExact
  41. #define Tcp_ListBox_FindStrExact(hwndCtl, lpszStr) ((int)(DWORD)SNDMSG((hwndCtl), LB_FINDSTRINGEXACT, -1, (LPARAM)(PCWSTR)lpszStr))
  42. // ComboBox_SetCurSel
  43. #define Tcp_ComboBox_SetCurSel(hwndCtl, index) ((int)(DWORD)SNDMSG((hwndCtl), CB_SETCURSEL, (WPARAM)(int)(index), 0L))
  44. // ComboBox_GetCurSel
  45. #define Tcp_ComboBox_GetCurSel(hwndCtl) ((int)(DWORD)SNDMSG((hwndCtl), CB_GETCURSEL, 0L, 0L))
  46. // ComboBox_GetCount
  47. #define Tcp_ComboBox_GetCount(hwndCtl) ((int)(DWORD)SNDMSG((hwndCtl), CB_GETCOUNT, 0L, 0L))
  48. // Tcp_Edit_LineLength
  49. #define Tcp_Edit_LineLength(hwndCtl, line) ((int)(DWORD)SNDMSG((hwndCtl), EM_LINELENGTH, (WPARAM)(int)(line), 0L))
  50. // PropSheet_CancelToClose (in prsht.h)
  51. #define Tcp_PropSheet_CancelToClose(hDlg) POSTMSG(hDlg, PSM_CANCELTOCLOSE, 0, 0L)