Easy Win 32

 

Edit Control Class – cEasyEditControl

 

cEasyEditControl Public Members:

                        HWND editcontrol;

                       

cEasyEditControl Functions:

 

            Functions to modify and/or setup the Edit Control (HWND editcontrol):

 

            int ChangeEditControlInstance(HINSTANCE)

            int ChangeEditControlParent(HWND)

            int ChangeEditControlMenu(HMENU)

            int ChangeEditControlPos(int x, int y, int width, int height)

            int ChangeEditControlStyles(DWORD dwstyle,DWORD dwexstyle)

            int ChangeEditControlName(LPCTSTR)

             

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

 

            After created functions (They help to handle the Edit Control):

 

            INT GetLimitText()

                        Returns the Limit Number of Characters for the Edit Control.

            int SetLimitText(int limit)

                        Sets the Limit Number of Bytes for the Edit Control.

            INT GetPasswordChar()

                        Returns the actual Password Char. Defualt is ‘*’.

            int SetPasswordChar(UINT password_char)

            INT GetLine(int line,LPCTSTR destiny)

                        Copies the line line, into the destiny string. It returns the Number of Chars copied.

 

As a general rule, the functions with Set (Example: SetLimitText(…)), return 1 on success, 0 on error.

 

            Other Functions:

 

            void InitEditControl()

 

            Initializes the Edit Control Class with these values:

             

                        lpWindowName="EditControl";

                        dwStyle=0;

                        x=10; 

                        y=10; 

                        nWidth=300;

                        nHeight=300;           

                        hWndParent=NULL;

                        hMenu=NULL;

                        hInst1=programInstance;    

                        _editcreated_=FALSE;

             

            HWND Create_EditControl(HWND AuxiliarWindow)

              

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

            On error it return NULL.

 

            int Destroy_EditControl()

                       

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

 

LONG GetEditControlId()

HWND GetEditControlParent()

DWORD GetEditControlExStyle()

DWORD GetEditControlStyle()

            HINSTANCE GetEditControlInstance()

 

                        Returns an Edit Control Property according to the name of the Function.

 

            BOOL Is_Enabled()

            void Disable_EditControl()

void Enable_EditControl() 

 

cEasyEditControl Private Members:

           

                        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 _editcreated_;