Easy Win 32

 

Button Class – cEasyButton

 

cEasyButton Public Members:

                        HWND button;

 

cEasyButton Functions:

           

            Functions to modify and/or setup the Button (HWND button):

 

            int ChangeButtonInstance(HINSTANCE)

            int ChangeButtonParent(HWND)

            int ChangeButtonMenu(HMENU)

            int ChangeButtonPos(int x, int y, int Width, int Height)

            int ChangeButtonStyles(DWORD dwstyle,DWORD dwexstyle)

            int ChangeButtonName(LPCTSTR)

 

            As a general rule this functions return 1 on success, 0 on error.

 

            Other Functions:

 

            void InitButton()

 

                        Initializes the Button Class with this values:

             

                        lpWindowName="Button";

                        dwStyle=0;

                        x=10; 

                        y=10; 

                        nWidth=300;

                        nHeight=300;           

                        hWndParent=NULL;

                        hMenu=NULL;

                        hInst1=programInstance;    

                        _buttoncreated_=FALSE;

             

            HWND Create_Button(HWND AuxiliarWindow)

           

                        On success it returns the handle of the button (you don’t have to store it, it is already stored in the public class member “button”).

                        On error it returns NULL.

 

            int Destroy_Button()

                       

                        Destroys the Button. On error returns 0, else non-zero.

 

            LONG GetButtonId()

            HWND GetButtonParent()

            DWORD GetButtonExStyle()

            DWORD GetButtonStyle()

            HINSTANCE GetButtonInstance()

 

                        This functions return a Button Property according to the name of the function.

 

            BOOL Is_Enabled()

 

                        If the Button is Enabled, returns TRUE, else FALSE.

 

            void Disable_Button()

void Enable_Button() 

 

            Disable or Enable the Button.

 

 

cEasyButton Private Members:

           

            Variables for the Button Handle:

                        DWORD dwExStyle;                       // extended window style

                        LPCTSTR lpWindowName;           // pointer to window name

                        DWORD dwStyle;    // window style

                        int x;    // horizontal position of window

                        int y;    // vertical position of window

                        int nWidth;      // window width

                        int nHeight;    // window height

                        HWND hWndParent;           // handle to parent or owner window

                        HMENU hMenu;        // handle to menu or child-window identifier

                        HANDLE hInst1;       // handle to application instance

                        BOOL _buttoncreated_;