Visit Gigasoft's Web Site
 ProEssentials v10 Help

PEcreate

HWND PEcreate (nObjectType, dwStyle, lpRect, hParent, nID)

 

This function allocates memory for the object, creates a window if hParent is non-null, and registers the windows handle with ProEssentials DLL.

 

UINT 

nObjectType

Specifies the type of object to create:

PECONTROL_GRAPH

PECONTROL_SGRAPH

PECONTROL_3D

PECONTROL_PIE

PECONTROL_PGRAPH

DWORD 

dwStyle

Specifies window styles:

WS_TABSTOP

WS_DISABLED

WS_GROUP

Usually you can assign zero to this argument, or combine the above Windows defined styles with the bitwise-or operator. The function automatically adds the WS_VISIBLE, WS_CHILD, WS_VSCROLL, and WS_HSCROLL styles, then passes this value to the Windows CreateWindow function. If you want to hide this control, use the ShowWindow Windows function with SW_HIDE immediately after calling PEcreate.

RECT*

lpRect

Location and size of object passed to the Windows CreateWindow function.

HWND 

hParent

Parent window to place control  passed to the Windows CreateWindow function.

UINT

nID

Child window identifier passed to the Windows CreateWindow function.  This ID can be any value and is only used to help recognize which child window sent a notification message.

 

Returns

This function returns the handle which was assigned by the Windows operating system. If the function could not allocate memory, or CreateWindow fails, the function returns zero.

 

Comments

The return value from this function is used in both Windows API and ProEssentials API calls. This return value must not be lost as long as the object remains in memory. Storing the return value in a global variable is required.

 

Note, if you are doing background image construction, you can supply zero as the hParent parent handle. When hParent is zero, the object has no Windows functionality such as message handling. Later in your code, you can call PEcreate a second time. Supply the current handle as the nObjectType and provide the non-zero parent handle in hParent. This will attach the previously constructed memory object to a newly constructed child window of the parent.

 

PEdestroy must be used to destroy the window and free its memory and resources.

 

Visual Basic and Delphi developers will not have to call this function. The visual interfaces call this function for you and place the resulting HWND handle into a special property called hObject. You can use this hObject property as the first argument in ProEssentials DLL calls like PEvset.