- UID
- 112996
- 积分
- 215
- 精华
- 贡献
-
- 威望
-
- 活跃度
-
- D豆
-
- 在线时间
- 小时
- 注册时间
- 2004-3-13
- 最后登录
- 1970-1-1
|
发表于 2004-6-7 20:38:06
|
显示全部楼层
Ref. below, please:
- [COLOR=Blue]SetClassLong [/COLOR]
- The SetClassLong function replaces the specified 32-bit (long) value at
- the specified offset into the extra class memory or the WNDCLASS
- structure for the class to which the specified window belongs.
- DWORD SetClassLong( HWND hWnd,
- // handle of window
-
- int nIndex,
- // index of value to change
-
- LONG dwNewLong
- // new value
-
- );
-
- Parameters
- hWnd
- Identifies the window and, indirectly, the class to which the window belongs.
- nIndex
- Specifies the 32-bit value to replace. To set a 32-bit value in the extra
- class memory, specify the positive, zero-based byte offset of the value to
- be set. Valid values are in the range zero through the number of bytes of
- extra class memory, minus four; for example, if you specified 12 or more
- bytes of extra class memory, a value of 8 would be an index to the third
- 32-bit integer. To set any other value from the WNDCLASS structure,
- specify one of the following values: Value
- Action
-
- GCL_CBCLSEXTRA
- Sets the size, in bytes, of the extra memory associated with the class.
- Setting this value does not change the number of extra bytes already allocated.
-
- GCL_CBWNDEXTRA
- Sets the size, in bytes, of the extra window memory associated with each
- window in the class. Setting this value does not change the number of
- extra bytes already allocated. For information on how to access this
- memory, see SetWindowLong and SetWindowWord.
- [COLOR=Red]
- GCL_HBRBACKGROUND
- Replaces the handle of the background brush associated with the class. //use it!
- [/COLOR]
- GCL_HCURSOR
- Replaces the handle of the cursor associated with the class.
-
- GCL_HICON
- Replaces the handle of the icon associated with the class.
-
- GCL_HMODULE
- Replaces the handle of the module that registered the class.
-
- GCL_MENUNAME
- Replaces the address of the menu name string. The string identifies the
- menu resource associated with the class.
-
- GCL_STYLE
- Replaces the window-class style bits.
-
- GCL_WNDPROC
- Replaces the address of the window procedure associated with the class.
-
- dwNewLong
- Specifies the replacement value.
- Return Values
- If the function succeeds, the return value is the previous value of the specified 32-bit integer.
- If the function fails, the return value is zero. To get extended error information, call GetLastError.
- Remarks
- If you use the SetClassLong function and the GCL_WNDPROC index to
- replace the window procedure, the window procedure must conform to
- the guidelines specified in the description of the WindowProc callback function.
- Calling SetClassLong with the GCL_WNDPROC index creates a subclass
- of the window class that affects all windows subsequently created with
- the class. An application should not subclass a window created by another process.
- Reserve extra class memory by specifying a nonzero value in the
- cbClsExtra member of the WNDCLASS structure used with the
- RegisterClass function.
- Use the SetClassLong function with care. For example, it is possible to
- change the background color for a class by using SetClassLong, but this
- change does not immediately repaint all windows belonging to the class.
- [COLOR=Blue]CreateSolidBrush [/COLOR]
- The CreateSolidBrush function creates a logical brush that has the specified solid color.
- HBRUSH CreateSolidBrush( COLORREF crColor
- // brush color value
-
- );
-
- Parameters
- crColor
- Specifies the color of the brush.
- Return Values
- If the function succeeds, the return value identifies a logical brush.
- If the function fails, the return value is NULL.
- Remarks
- A solid brush is a bitmap that Windows uses to paint the interiors of filled shapes.
- After an application creates a brush by calling CreateSolidBrush, it can
- select that brush into any device context by calling the SelectObject function.
复制代码 |
|