home *** CD-ROM | disk | FTP | other *** search
/ Programming Languages Suite / ProgLangD.iso / C++-7 / DISK3 / MFC / SAMPLES / RESTOOL / DLGRES.H$ / dlgres
Encoding:
Text File  |  1992-01-17  |  1.7 KB  |  71 lines

  1. // dlgres.h : Structures, constants and inline helpers for REStoH.
  2. //
  3. // This is a part of the Microsoft Foundation Classes C++ library.
  4. // Copyright (C) 1992 Microsoft Corporation
  5. // All rights reserved.
  6. //
  7. // This source code is only intended as a supplement to the
  8. // Microsoft Foundation Classes Reference and Microsoft
  9. // QuickHelp documentation provided with the library.
  10. // See these sources for detailed information regarding the
  11. // Microsoft Foundation Classes product.
  12.  
  13. #ifndef __DLGRES_H__
  14. #define __DLGRES_H__
  15.  
  16. /////////////////////////////////////////////////////////////////////////////
  17.  
  18. typedef struct {
  19.     long style;
  20.     BYTE cdit;
  21.     int x, y;
  22.     int cx, cy;
  23. } DLGTEMPLATE;
  24.  
  25. typedef struct {
  26.     int x, y;
  27.     int cx, cy;
  28.     int id;
  29.     long style;
  30.     // next comes a zero-terminated string,
  31.     // then comes a length byte, followed by some data
  32. } DLGITEMTEMPLATE;
  33.  
  34. #define CODEBIT       0x80
  35. #define BUTTONCODE    0x80
  36. #define EDITCODE      0x81
  37. #define STATICCODE    0x82
  38. #define LISTBOXCODE   0x83
  39. #define SCROLLBARCODE 0x84
  40. #define COMBOBOXCODE  0x85
  41.  
  42. // CheckReadValue:
  43. // Returns TRUE iff n isn't either 0 or -1.
  44. //
  45. inline BOOL CheckReadValue(int n)
  46. {
  47.     return (n != 0) && (n != -1);
  48. }
  49.  
  50. // SkipString:
  51. // Advances the given BYTE* past the string.  Also handles 0xFF/WORD ordinal
  52. // string references.
  53. //
  54. inline BYTE* SkipString(BYTE* pb)
  55. {
  56.     // Special case for "ordinal" strings: if the first char is
  57.     // 0xFF, then the next two chars are really an int.  Skip past it.
  58.     if (*pb == 0xFF)
  59.         return pb + 3;
  60.  
  61.     while (*pb++)
  62.         ;
  63.  
  64.     return pb;
  65. };
  66.  
  67. /////////////////////////////////////////////////////////////////////////////
  68.  
  69. #endif // __DLGRES_H__
  70.  
  71.