CreateControl

PowerBuilder Native Interface

IPBX_VisualObject interface:

CreateControl method

Description

Syntax

CreateControl(DWORD dwExStyle, LPCTSTR lpWindowName, DWORD dwStyle,   int x,  int y, int nWidth,  int nHeight,  HWND hWndParent,   HINSTANCE hInstance)

Return Values

Examples

LPCTSTR CVisualExt::GetWindowClassName()
{
   return s_className;
}

HWND CVisualExt::CreateControl
(
   DWORD dwExStyle, // extended window style
   LPCTSTR lpWindowName, // 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
   HINSTANCE hInstance // handle to application instance
)
{
   d_hwnd = CreateWindowEx(dwExStyle, s_className,
      lpWindowName, dwStyle, x, y, nWidth, nHeight,
      hWndParent, NULL, hInstance, NULL);

   ::SetWindowLong(d_hwnd, GWL_USERDATA, (LONG)this);

   return d_hwnd;
}

Usage

See Also