Source code of Windows XP (NT5)
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.

42 lines
1.6 KiB

  1. #ifndef MACROS_H
  2. #define MACROS_H
  3. #define bzero(dest,size) memset(dest,0,size)
  4. #define bcopy(src,dest,size) memcpy(dest,src,size)
  5. #define strcasecmp(s1,s2) _stricmp(s1,s2)
  6. #define strncasecmp(s1,s2) _strnicmp(s1,s2)
  7. #define index(s,c) strchr(s,c)
  8. #define BEGINstring(d,s) strncpy(d->acDummy1,s " BEGIN\n", 16)
  9. #define ENDstring(d,s) strncpy(d->acDummy2,s " END\n", 16)
  10. #define CB_DlgAddString(hDlg, iControl, text) \
  11. SendDlgItemMessage(hDlg, iControl, CB_ADDSTRING, 0, (LPARAM) text)
  12. #define CB_DlgSetSelect(hDlg, iControl, iIndex) \
  13. SendDlgItemMessage(hDlg, iControl, CB_SETCURSEL, iIndex, 0)
  14. #define CB_DlgGetSelect(hDlg, iControl) \
  15. SendDlgItemMessage(hDlg, iControl, CB_GETCURSEL, 0, 0)
  16. #define CB_DlgSetRedraw(hDlg, iControl, bDraw) \
  17. SendDlgItemMessage(hDlg, iControl, WM_SETREDRAW, bDraw, 0)
  18. #define CB_DlgResetContent(hDlg, iControl) \
  19. SendDlgItemMessage(hDlg, iControl, CB_RESETCONTENT, 0, 0)
  20. #define UD_DlgGetPos(hDlg, iControl) \
  21. SendDlgItemMessage(hDlg, iControl, UDM_GETPOS, 0, 0L)
  22. #define UD_DlgGetRange(hDlg, iControl) \
  23. SendDlgItemMessage(hDlg, iControl, UDM_GETRANGE, 0, 0L)
  24. #define UD_DlgSetPos(hDlg, iControl, nPos) \
  25. SendDlgItemMessage(hDlg, iControl, UDM_SETPOS, 0, (LPARAM) MAKELONG((short) nPos, 0))
  26. #define UD_DlgSetRange(hDlg, iControl, nUpper, nLower) \
  27. SendDlgItemMessage(hDlg, iControl, UDM_SETRANGE, 0, (LPARAM) MAKELONG((short) nUpper, (short) nLower))
  28. #define GL_EnableOrDisable(b, val) if (b) glEnable(val); else glDisable(val)
  29. #endif // MACROS_H