Windows uses handles of type HWND to refer to most GUI objects. Since handles are 32-bit pointers that are unique to each window, it would be tempting to use them as PHP variables to refer to controls. However, this approach is not ideal for the following reasons:
Therefore the WinBinder Object (WBOBJ) structure is defined. All WinBinder windows and controls are of type WBOBJ. The structure contains the window handle (HWND) and more. Below is a copy of the WBOBJ definition in WB.H:
|
The WinBinder functions wb_create_control() and wb_create_window() effectively return a pointer to the window's WBOBJ structure as a long integer. This pointer is also stored (with Window API function SetWindowLong() and GWL_USERDATA) in every window. Therefore it always possible to obtain the HWND from a WBOBJ and vice-versa, for any given window or control.
The first LPARAM type field, lparam, carries the value of the param argument that is passed in functions wb_create_control() and wb_create_window(). The array of LPARAMs, lparams, is reserved for internal use and can be used to carry additional user information or additional 32-bit pointers. The latter are accessible only via the wb_peek() function.
|
wb_create_control
wb_create_window