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.

87 lines
2.9 KiB

  1. /*****************************************************************************
  2. * *
  3. * SBUTTON.C *
  4. * *
  5. * Program Description: Implements "3-D" buttons *
  6. * *
  7. ******************************************************************************
  8. * *
  9. * Revision History: Created by Todd Laney, Munged 3/27/89 by Robert Bunney *
  10. * 7/26/89 - revised by Todd Laney to handle multi-res *
  11. * bitmaps. transparent color bitmaps *
  12. * windows 3 support *
  13. * *
  14. *****************************************************************************/
  15. /*
  16. * WINDOW CLASS "sbutton"
  17. *
  18. * Button ControlInit() registers a button class called "sbutton".
  19. * a "sbutton" behaves exactly like a normal windows push button, with the
  20. * following enhancments:
  21. *
  22. * 3D-PUSH effect.
  23. *
  24. * COLORS:
  25. *
  26. * The folowing colors will be read from WIN.INI to be used as the
  27. * button colors. (under Win3 the approp. SYS colors will be used.)
  28. *
  29. * [colors]
  30. * ButtonText
  31. * ButtonFace
  32. * ButtonShadow
  33. * ButtonFocus
  34. *
  35. *
  36. * BITMAPS:
  37. * if the window text of the button begins with a '#' and the string
  38. * following names a bitmap resource, the bitmap will be displayed as
  39. * the button.
  40. *
  41. * bitmap can have color res specific versions in the resource file.
  42. *
  43. * if the button name is "#%foo" bitmap resources will be searched
  44. * for in the following order:
  45. *
  46. * fooWxHxC
  47. * fooWxH
  48. * foo
  49. *
  50. * W is the width in pixels of the current display
  51. * H is the height in pixels of the current display
  52. * C is the number of colors of the current display
  53. *
  54. * for example a EGA specific resource would be named "foo640x350x8"
  55. *
  56. * The first pixel of color bitmap's will be used as the "transparent"
  57. * color. All pixels that match the transparent color will be set
  58. * equal to the button face color
  59. *
  60. * BUTTON STYLES:
  61. * BS_STRETCH - stretch bitmaps to fit button
  62. * BS_NOFOCUS - dont steal focus on mouse messages
  63. *
  64. */
  65. #define BS_STRETCH 0x8000L
  66. #define BS_NOFOCUS 0x4000L
  67. //
  68. // Init routine, will register class "sbutton" and "stext"
  69. //
  70. BOOL
  71. ButtonControlInit(
  72. HANDLE hInst
  73. );
  74. VOID
  75. ButtonControlTerm(
  76. VOID
  77. );
  78. //
  79. // Window proc for buttons, THIS FUNCTION MUST BE EXPORTED
  80. //
  81. LRESULT APIENTRY fnButton (HWND, UINT, WPARAM, LPARAM);