### ButtonBox Example with Icon and Text
Source: https://github.com/netease-im/nim_duilib_framework/blob/master/docs/ControlBox/Other.md
Use ButtonBox to create a button with an icon and text. This example shows a save button with a 'save.png' icon and '保存' text.
```xml
```
--------------------------------
### Start GIF Playback
Source: https://github.com/netease-im/nim_duilib_framework/blob/master/docs/Controls/Control.md
Starts playing a GIF animation. Allows specifying the frame to stop on and the number of playback cycles.
```cpp
void StartGifPlayForUI(GifStopType frame = kGifStopFirst,int playcount = -1)
```
--------------------------------
### Get Prompt Text (wstring)
Source: https://github.com/netease-im/nim_duilib_framework/blob/master/docs/Controls/RichEdit.md
Retrieves the prompt text as a wide string.
```cpp
std::wstring GetPromptText()
```
--------------------------------
### StartGifPlayForUI
Source: https://github.com/netease-im/nim_duilib_framework/blob/master/docs/Controls/Control.md
Initiates the playback of a GIF animation for the UI. Allows control over the starting frame and playback count.
```APIDOC
## StartGifPlayForUI
### Description
Plays a GIF animation.
### Method
void
### Parameters
#### Parameters
- **frame** (GifStopType) - Optional - Description: The frame to stop at after playback. Defaults to kGifStopFirst.
- **playcount** (int) - Optional - Description: The number of times to play the GIF. Defaults to -1 (infinite).
### Return Value
None
```
--------------------------------
### GetPromptText
Source: https://github.com/netease-im/nim_duilib_framework/blob/master/docs/Controls/RichEdit.md
Gets the prompt text.
```APIDOC
## GetPromptText
### Description
Gets the prompt text.
### Method
```cpp
std::wstring GetPromptText()
```
### Parameters
None
### Returns
- (std::wstring) - The prompt text content.
```
--------------------------------
### Get Background Image Path
Source: https://github.com/netease-im/nim_duilib_framework/blob/master/docs/Controls/Control.md
Retrieves the file path of the background image.
```cpp
std::wstring GetBkImage()
```
--------------------------------
### Get Initial Window Size
Source: https://github.com/netease-im/nim_duilib_framework/blob/master/docs/Controls/Window.md
Retrieves the window's size when it is first created, optionally including shadow.
```cpp
CSize GetInitSize(bool bContainShadow = false)
```
--------------------------------
### GetUTF8PromptText
Source: https://github.com/netease-im/nim_duilib_framework/blob/master/docs/Controls/RichEdit.md
Gets the prompt text in UTF8 format.
```APIDOC
## GetUTF8PromptText
### Description
Gets the prompt text in UTF8 format.
### Method
```cpp
std::string GetUTF8PromptText()
```
### Parameters
None
### Returns
- (std::string) - The prompt text content in UTF8 format.
```
--------------------------------
### Get Height Percent
Source: https://github.com/netease-im/nim_duilib_framework/blob/master/docs/Controls/Window.md
Retrieves the initial height of the window as a percentage of the screen height.
```cpp
double GetHeightPercent()
```
--------------------------------
### Get Prompt Text (string UTF8)
Source: https://github.com/netease-im/nim_duilib_framework/blob/master/docs/Controls/RichEdit.md
Retrieves the prompt text encoded as a UTF-8 string.
```cpp
std::string GetUTF8PromptText()
```
--------------------------------
### GetWinStyle
Source: https://github.com/netease-im/nim_duilib_framework/blob/master/docs/Controls/RichEdit.md
Gets the window style of the control. Returns the window style value.
```APIDOC
## GetWinStyle
### Description
Gets the window style of the control.
### Method
```cpp
LONG GetWinStyle()
```
### Parameters
None
### Returns
- LONG: Returns the window style.
```
--------------------------------
### Get Skin File Path
Source: https://github.com/netease-im/nim_duilib_framework/blob/master/docs/Utils/WindowImplBase.md
Retrieves the path to the skin XML file used by the window. This file defines the window's appearance and layout.
```cpp
virtual std::wstring GetSkinFile()
```
--------------------------------
### Get Size Box
Source: https://github.com/netease-im/nim_duilib_framework/blob/master/docs/Controls/Window.md
Retrieves the dimensions defining the resizable borders of the window.
```cpp
UiRect GetSizeBox()
```
--------------------------------
### Get Text Content
Source: https://github.com/netease-im/nim_duilib_framework/blob/master/docs/Controls/RichEdit.md
Retrieve the plain text content of the RichEdit control.
```cpp
std::wstring GetText()
```
--------------------------------
### Create and Display a Basic Window
Source: https://github.com/netease-im/nim_duilib_framework/blob/master/docs/GETTING-STARTED.md
Initializes the framework, creates a new window instance, and displays it centered on the screen. Ensure the window header file is included before creating the window.
```cpp
void MainThread::Init()
{
nbase::ThreadManager::RegisterThread(kThreadUI);
// 获取资源路径,初始化全局参数
// 默认皮肤使用 resources\themes\default
// 默认语言使用 resources\lang\zh_CN
// 如需修改请指定 Startup 最后两个参数
std::wstring theme_dir = QPath::GetAppPath();
ui::GlobalManager::Startup(theme_dir + L"resources\", ui::CreateControlCallback(), false);
// 创建一个默认带有阴影的居中窗口
BasicForm* window = new BasicForm();
window->Create(NULL, BasicForm::kClassName.c_str(), WS_OVERLAPPEDWINDOW & ~WS_MAXIMIZEBOX, 0);
window->CenterWindow();
window->ShowWindow();
}
```
--------------------------------
### GetSel (long)
Source: https://github.com/netease-im/nim_duilib_framework/blob/master/docs/Controls/RichEdit.md
Gets the start and end character positions of the selected text. The positions are returned via reference parameters.
```APIDOC
## GetSel (long)
### Description
Gets the start and end character positions of the selected text.
### Method
```cpp
void GetSel(long& nStartChar, long& nEndChar)
```
### Parameters
- **nStartChar** (long&) - Output - The starting position of the selection.
- **nEndChar** (long&) - Output - The ending position of the selection.
```
--------------------------------
### Get Tooltip Window Handle
Source: https://github.com/netease-im/nim_duilib_framework/blob/master/docs/Controls/Window.md
Retrieves the window handle associated with tooltip information.
```cpp
HWND GetTooltipWindow()
```
--------------------------------
### OnCreate
Source: https://github.com/netease-im/nim_duilib_framework/blob/master/docs/Utils/WindowImplBase.md
Handles the window creation message. Use InitWindow to implement custom window initialization.
```APIDOC
## OnCreate
### Description
Handles the window creation message. Use InitWindow to implement custom window initialization.
### Method
`LRESULT OnCreate(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)`
### Parameters
#### Path Parameters
- **uMsg** (UINT) - Message ID
- **wParam** (WPARAM) - Additional message parameters
- **lParam** (LPARAM) - Additional message parameters
- **bHandled** (BOOL&) - Whether the message has already been processed.
### Response
#### Success Response
- **Return Value** (LRESULT) - The result of message processing.
```
--------------------------------
### GetSel (CHARRANGE)
Source: https://github.com/netease-im/nim_duilib_framework/blob/master/docs/Controls/RichEdit.md
Gets the start and end positions of the selected text using a CHARANGE structure. The structure will be populated with the selection range.
```APIDOC
## GetSel (CHARRANGE)
### Description
Gets the start and end positions of the selected text using a CHARANGE structure.
### Method
```cpp
void GetSel(CHARRANGE &cr)
```
### Parameters
- **cr** (CHARRANGE&) - Output - A CHARANGE structure that will be populated with the start and end positions of the selection.
```
--------------------------------
### Get Maximize Info
Source: https://github.com/netease-im/nim_duilib_framework/blob/master/docs/Controls/Window.md
Retrieves the information defining the window's maximized state.
```cpp
UiRect GetMaximizeInfo()
```
--------------------------------
### Init
Source: https://github.com/netease-im/nim_duilib_framework/blob/master/docs/Controls/Control.md
Initializes the control.
```APIDOC
## Init
### Description
Initializes the control.
### Method
```cpp
virtual void Init()
```
### Parameters
None
```
--------------------------------
### Get Selected Text Range (CHARRANGE)
Source: https://github.com/netease-im/nim_duilib_framework/blob/master/docs/Controls/RichEdit.md
Retrieve the start and end positions of the currently selected text using a CHARANGE structure.
```cpp
void GetSel(CHARRANGE &cr)
```
--------------------------------
### Get Shadow Corner
Source: https://github.com/netease-im/nim_duilib_framework/blob/master/docs/Controls/Window.md
Retrieves the nine-grid description for the shadow's border.
```cpp
UiRect GetShadowCorner()
```
--------------------------------
### Get Selected Text Range (long)
Source: https://github.com/netease-im/nim_duilib_framework/blob/master/docs/Controls/RichEdit.md
Retrieve the start and end character positions of the currently selected text as separate long integers.
```cpp
void GetSel(long& nStartChar, long& nEndChar)
```
--------------------------------
### Handle Window Creation
Source: https://github.com/netease-im/nim_duilib_framework/blob/master/docs/Utils/WindowImplBase.md
Handles the WM_CREATE message, which is sent when the window is first created. Use InitWindow for initialization logic.
```cpp
LRESULT OnCreate(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
```
--------------------------------
### GetText
Source: https://github.com/netease-im/nim_duilib_framework/blob/master/docs/Controls/RichEdit.md
Gets the text content of the control. Returns the text as a wide string.
```APIDOC
## GetText
### Description
Gets the text content of the control.
### Method
```cpp
std::wstring GetText()
```
### Parameters
None
### Returns
- std::wstring: Returns the text content of the control.
```
--------------------------------
### Init Method
Source: https://github.com/netease-im/nim_duilib_framework/blob/master/docs/Controls/Control.md
Initializes the control. This is a virtual method intended to be overridden by derived classes.
```cpp
virtual void Init()
```
--------------------------------
### DoInit
Source: https://github.com/netease-im/nim_duilib_framework/blob/master/docs/Controls/Control.md
Called by Init, this function has the same functionality as Init.
```APIDOC
## DoInit
### Description
Called by Init, this function has the same functionality as Init.
### Method
```cpp
virtual void DoInit()
```
### Parameters
None
```
--------------------------------
### Get Text Length with Flags
Source: https://github.com/netease-im/nim_duilib_framework/blob/master/docs/Controls/RichEdit.md
Get the length of the text in the RichEdit control, with options to specify how the length is determined using flags.
```cpp
long GetTextLength(DWORD dwFlags = GTL_DEFAULT)
```
--------------------------------
### Set Initial Window Size
Source: https://github.com/netease-im/nim_duilib_framework/blob/master/docs/Controls/Window.md
Sets the initial width and height of the window, with options for shadow inclusion and DPI scaling.
```cpp
void SetInitSize(int cx, int cy, bool bContainShadow = false, bool bNeedDpiScale = true)
```
--------------------------------
### GetCaretRect
Source: https://github.com/netease-im/nim_duilib_framework/blob/master/docs/Controls/RichEdit.md
Gets the rectangular position of the caret.
```APIDOC
## GetCaretRect
### Description
Gets the rectangular position of the caret.
### Method
```cpp
RECT GetCaretRect()
```
### Parameters
None
### Returns
- (RECT) - The rectangular position of the caret.
```
--------------------------------
### Get Skin Folder Path
Source: https://github.com/netease-im/nim_duilib_framework/blob/master/docs/Utils/WindowImplBase.md
Retrieves the path to the skin folder used by the window. This is typically the directory containing skin resources.
```cpp
virtual std::wstring GetSkinFolder()
```
--------------------------------
### GetCaretColor
Source: https://github.com/netease-im/nim_duilib_framework/blob/master/docs/Controls/RichEdit.md
Gets the current color of the caret.
```APIDOC
## GetCaretColor
### Description
Gets the current color of the caret.
### Method
```cpp
std::wstring GetCaretColor()
```
### Parameters
None
### Returns
- (std::wstring) - The current caret color.
```
--------------------------------
### ActiveWindow
Source: https://github.com/netease-im/nim_duilib_framework/blob/master/docs/Utils/WindowImplBase.md
Activates the window.
```APIDOC
## ActiveWindow
### Description
Activates the window.
### Method
`virtual void ActiveWindow()`
### Response
#### Success Response
- **Return Value** (void) - This method does not return a value.
```
--------------------------------
### GetSkinFile
Source: https://github.com/netease-im/nim_duilib_framework/blob/master/docs/Utils/WindowImplBase.md
Retrieves the skin XML file path. This method should be implemented to get the actual skin XML file.
```APIDOC
## GetSkinFile
### Description
Retrieves the skin XML file path. This method should be implemented to get the actual skin XML file.
### Method
`virtual std::wstring GetSkinFile()`
### Response
#### Success Response
- **Return Value** (std::wstring) - The path to the skin XML file.
```
--------------------------------
### SetInitSize
Source: https://github.com/netease-im/nim_duilib_framework/blob/master/docs/Controls/Window.md
Sets the initial size of the window when it is first created. This method also allows for DPI scaling adjustments. Takes width (cx), height (cy), and optional booleans for shadow inclusion and DPI scaling.
```APIDOC
## SetInitSize
### Description
Sets the initial size of the window.
### Parameters
#### Path Parameters
- **cx** (int) - Required - The initial width.
- **cy** (int) - Required - The initial height.
- **bContainShadow** (bool) - Optional - If false, cx and cy do not include shadow dimensions; defaults to false.
- **bNeedDpiScale** (bool) - Optional - If false, the size is not adjusted for DPI scaling; defaults to true.
```
--------------------------------
### GetFocusedImage
Source: https://github.com/netease-im/nim_duilib_framework/blob/master/docs/Controls/RichEdit.md
Gets the image displayed when the control has focus.
```APIDOC
## GetFocusedImage
### Description
Gets the image displayed when the control has focus.
### Method
```cpp
std::wstring GetFocusedImage()
```
### Parameters
None
### Returns
- (std::wstring) - The path to the focused image.
```
--------------------------------
### Application Title Bar with HBox
Source: https://github.com/netease-im/nim_duilib_framework/blob/master/docs/Containers/HBox.md
An example of a standard application title bar using HBox for horizontal arrangement. It includes minimize, maximize/restore, and close buttons, with a flexible space at the beginning.
```xml
```
--------------------------------
### CharFromPos
Source: https://github.com/netease-im/nim_duilib_framework/blob/master/docs/Controls/RichEdit.md
Gets the character index closest to the specified coordinates.
```APIDOC
## CharFromPos
### Description
Gets the character index closest to the specified coordinates.
### Method
```cpp
int CharFromPos(CPoint pt)
```
### Parameters
#### Path Parameters
- **pt** (CPoint) - Required - The coordinate information.
### Returns
- (int) - The character index closest to the specified coordinates.
```
--------------------------------
### SetWindow Method (with parent and init)
Source: https://github.com/netease-im/nim_duilib_framework/blob/master/docs/Controls/Control.md
Sets the window that owns this control, along with its parent container and an option to initialize the control.
```cpp
virtual void SetWindow(Window* pManager, Box* pParent, bool bInit = true)
```
--------------------------------
### Get Window Position
Source: https://github.com/netease-im/nim_duilib_framework/blob/master/docs/Controls/Window.md
Retrieves the window's position, optionally including its shadow area.
```cpp
UiRect GetPos(bool bContainShadow = false)
```
--------------------------------
### Get Minimum Window Size
Source: https://github.com/netease-im/nim_duilib_framework/blob/master/docs/Controls/Window.md
Retrieves the minimum allowed dimensions for the window, optionally including shadow.
```cpp
CSize GetMinInfo(bool bContainShadow = false)
```
--------------------------------
### Get Caret Color
Source: https://github.com/netease-im/nim_duilib_framework/blob/master/docs/Controls/RichEdit.md
Retrieves the current color of the caret.
```cpp
std::wstring GetCaretColor()
```
--------------------------------
### Basic HBox with Buttons
Source: https://github.com/netease-im/nim_duilib_framework/blob/master/docs/Containers/HBox.md
Demonstrates how three Button controls are arranged horizontally from left to right within an HBox.
```xml
```
--------------------------------
### GetInitSize
Source: https://github.com/netease-im/nim_duilib_framework/blob/master/docs/Controls/Window.md
Retrieves the initial size of the window when it is first created. An optional boolean parameter can specify whether to include shadow dimensions. Returns a CSize structure.
```APIDOC
## GetInitSize
### Description
Retrieves the initial size of the window. Optionally includes shadow dimensions.
### Parameters
#### Query Parameters
- **bContainShadow** (bool) - Optional - If true, includes shadow dimensions; defaults to false.
### Returns
- **CSize** - A structure representing the initial width (cx) and height (cy).
```
--------------------------------
### GetZipFilePath
Source: https://github.com/netease-im/nim_duilib_framework/blob/master/docs/GLOBAL.md
Gets the location of a file within a zip archive.
```APIDOC
## GetZipFilePath
### Description
Gets the location of a file within a zip archive.
### Method
static
### Parameters
#### Path Parameters
- **path** (std::wstring) - Description: The path to the file to locate.
### Return Value
- std::wstring: Returns the file's location within the zip archive.
```
--------------------------------
### Get UTF8 Background Image Path
Source: https://github.com/netease-im/nim_duilib_framework/blob/master/docs/Controls/Control.md
Retrieves the file path of the background image using a UTF8 encoded string.
```cpp
std::string GetUTF8BkImage()
```
--------------------------------
### Get Cursor Type
Source: https://github.com/netease-im/nim_duilib_framework/blob/master/docs/Controls/Control.md
Retrieves the current cursor type for the control.
```cpp
virtual CursorType GetCursorType()
```
--------------------------------
### Get Border Size
Source: https://github.com/netease-im/nim_duilib_framework/blob/master/docs/Controls/Control.md
Retrieves the size of the control's border.
```cpp
int GetBorderSize()
```
--------------------------------
### Activate Window
Source: https://github.com/netease-im/nim_duilib_framework/blob/master/docs/Utils/WindowImplBase.md
Activates the current window, bringing it to the foreground and giving it focus.
```cpp
virtual void ActiveWindow()
```
--------------------------------
### Get Shadow Image
Source: https://github.com/netease-im/nim_duilib_framework/blob/master/docs/Controls/Window.md
Retrieves the file path of the image used for the window's shadow.
```cpp
std::wstring GetShadowImage()
```
--------------------------------
### GetSkinFolder
Source: https://github.com/netease-im/nim_duilib_framework/blob/master/docs/Utils/WindowImplBase.md
Retrieves the skin folder path. This method should be implemented to get the actual skin folder.
```APIDOC
## GetSkinFolder
### Description
Retrieves the skin folder path. This method should be implemented to get the actual skin folder.
### Method
`virtual std::wstring GetSkinFolder()`
### Response
#### Success Response
- **Return Value** (std::wstring) - The path to the skin folder.
```
--------------------------------
### PosFromChar
Source: https://github.com/netease-im/nim_duilib_framework/blob/master/docs/Controls/RichEdit.md
Gets the client area coordinates of the character at the specified index.
```APIDOC
## PosFromChar
### Description
Gets the client area coordinates of the character at the specified index.
### Method
```cpp
CPoint PosFromChar(UINT nChar)
```
### Parameters
#### Path Parameters
- **nChar** (UINT) - Required - The index of the character.
### Returns
- (CPoint) - The client area coordinates of the character.
```
--------------------------------
### Initialize Layout
Source: https://github.com/netease-im/nim_duilib_framework/blob/master/docs/Controls/Window.md
Virtual function called during the initialization phase of the control's layout. Derived classes can override this for custom setup.
```cpp
virtual void OnInitLayout()
```
--------------------------------
### Basic Window Layout XML
Source: https://github.com/netease-im/nim_duilib_framework/blob/master/docs/GETTING-STARTED.md
Defines the structure and appearance of a basic window, including buttons and labels. This XML file should be placed in the specified theme directory.
```xml
```
--------------------------------
### LineFromChar
Source: https://github.com/netease-im/nim_duilib_framework/blob/master/docs/Controls/RichEdit.md
Gets the line number that contains the character at the specified index.
```APIDOC
## LineFromChar
### Description
Gets the line number that contains the character at the specified index.
### Method
```cpp
long LineFromChar(long nIndex)
```
### Parameters
#### Path Parameters
- **nIndex** (long) - Required - The index of the character.
### Returns
- (long) - The line number containing the character.
```
--------------------------------
### DoInit Method
Source: https://github.com/netease-im/nim_duilib_framework/blob/master/docs/Controls/Control.md
Called by the Init method, this function serves the same purpose as Init and can be overridden for initialization logic.
```cpp
virtual void DoInit()
```
--------------------------------
### GetCharPos
Source: https://github.com/netease-im/nim_duilib_framework/blob/master/docs/Controls/RichEdit.md
Gets the client area coordinates of a character at a specified index.
```APIDOC
## GetCharPos
### Description
Gets the client area coordinates of a character at a specified index.
### Method
```cpp
CPoint GetCharPos(long lChar)
```
### Parameters
#### Path Parameters
- **lChar** (long) - Required - The index of the character.
### Returns
- (CPoint) - The client area coordinates of the character.
```
--------------------------------
### Get Focused Control
Source: https://github.com/netease-im/nim_duilib_framework/blob/master/docs/Controls/Window.md
Retrieves a pointer to the control that currently has focus.
```cpp
Control* GetFocus()
```
--------------------------------
### Load Global Resources
Source: https://github.com/netease-im/nim_duilib_framework/blob/master/docs/GLOBAL.md
Initiates the loading of global resources for the application. No parameters are required.
```cpp
static void LoadGlobalResource()
```
--------------------------------
### Set Prompt Text (wstring)
Source: https://github.com/netease-im/nim_duilib_framework/blob/master/docs/Controls/RichEdit.md
Sets the prompt text using a wide string.
```cpp
void SetPromptText(const std::wstring& strText)
```
--------------------------------
### GetCurSel
Source: https://github.com/netease-im/nim_duilib_framework/blob/master/docs/List/Combo.md
Gets the index of the currently selected item in the Combo box.
```APIDOC
## GetCurSel
### Description
Retrieves the index of the currently selected item.
### Method
GET (conceptual)
### Endpoint
N/A (Method Call)
### Parameters
None
### Response
#### Success Response
- **selectedIndex** (int) - The index of the currently selected item.
### Response Example
```json
{
"selectedIndex": 1
}
```
```
--------------------------------
### Get Bottom Border Size
Source: https://github.com/netease-im/nim_duilib_framework/blob/master/docs/Controls/Control.md
Retrieves the size of the bottom border of the control.
```cpp
int GetBottomBorderSize()
```
--------------------------------
### Arrange Method
Source: https://github.com/netease-im/nim_duilib_framework/blob/master/docs/Controls/Control.md
Performs the layout arrangement for the control.
```cpp
virtual void Arrange()
```
--------------------------------
### OnInitLayout
Source: https://github.com/netease-im/nim_duilib_framework/blob/master/docs/Controls/Window.md
Virtual function called during the initialization of the control's layout.
```APIDOC
## OnInitLayout
### Description
Virtual function called when the control's layout is being initialized. This can be overridden by derived classes to perform custom layout setup.
### Signature
```cpp
virtual void OnInitLayout()
```
### Parameters
None.
### Returns
None.
```
--------------------------------
### Get Right Border Size
Source: https://github.com/netease-im/nim_duilib_framework/blob/master/docs/Controls/Control.md
Retrieves the size of the right border of the control.
```cpp
int GetRightBorderSize()
```
--------------------------------
### Get Top Border Size
Source: https://github.com/netease-im/nim_duilib_framework/blob/master/docs/Controls/Control.md
Retrieves the size of the top border of the control.
```cpp
int GetTopBorderSize()
```
--------------------------------
### Clone NIM Duilib Framework Repository
Source: https://github.com/netease-im/nim_duilib_framework/blob/master/README_en-US.md
Use this command to clone the NIM Duilib framework repository from GitHub.
```bash
git clone https://github.com/netease-im/NIM_Duilib_Framework
```
--------------------------------
### Get Left Border Size
Source: https://github.com/netease-im/nim_duilib_framework/blob/master/docs/Controls/Control.md
Retrieves the size of the left border of the control.
```cpp
int GetLeftBorderSize()
```
--------------------------------
### On Apply Attribute List
Source: https://github.com/netease-im/nim_duilib_framework/blob/master/docs/Controls/Control.md
Handles the application of an attribute list. This method is currently pending further documentation.
```cpp
bool OnApplyAttributeList(const std::wstring& strReceiver, const std::wstring& strList, EventArgs* eventArgs)
```
--------------------------------
### Paint Prompt Text
Source: https://github.com/netease-im/nim_duilib_framework/blob/master/docs/Controls/RichEdit.md
Renders the prompt text onto the provided render context.
```cpp
void PaintPromptText(IRenderContext* pRender)
```
--------------------------------
### Get Focused Image
Source: https://github.com/netease-im/nim_duilib_framework/blob/master/docs/Controls/RichEdit.md
Retrieves the image path used when the control has focus.
```cpp
std::wstring GetFocusedImage()
```
--------------------------------
### Get Image Info Object
Source: https://github.com/netease-im/nim_duilib_framework/blob/master/docs/GLOBAL.md
Retrieves the ImageInfo object for a given bitmap path. It returns a shared pointer to the ImageInfo object.
```cpp
static std::shared_ptr GetImage(const std::wstring& bitmap)
```
--------------------------------
### ToTopMost
Source: https://github.com/netease-im/nim_duilib_framework/blob/master/docs/Utils/WindowImplBase.md
Keeps the window on top.
```APIDOC
## ToTopMost
### Description
Keeps the window on top.
### Method
`void ToTopMost(bool forever)`
### Parameters
#### Path Parameters
- **forever** (bool) - Whether to keep the window on top permanently.
### Response
#### Success Response
- **Return Value** (void) - This method does not return a value.
```
--------------------------------
### Handle Message Template (Raw Input)
Source: https://github.com/netease-im/nim_duilib_framework/blob/master/docs/Controls/Control.md
The primary entry point for handling messages. This function converts traditional Windows messages into a custom format for internal processing.
```cpp
void HandleMessageTemplate(EventType eventType, WPARAM wParam = 0, LPARAM lParam = 0, TCHAR tChar = 0, CPoint mousePos = CPoint()
```
--------------------------------
### Get Caret Rectangle
Source: https://github.com/netease-im/nim_duilib_framework/blob/master/docs/Controls/RichEdit.md
Retrieves the bounding rectangle of the caret in client coordinates.
```cpp
RECT GetCaretRect()
```
--------------------------------
### GetMinInfo
Source: https://github.com/netease-im/nim_duilib_framework/blob/master/docs/Controls/Window.md
Retrieves the minimum size constraints for the window. This corresponds to the 'mininfo' attribute in XML. An optional boolean parameter can specify whether to include shadow dimensions. Returns a CSize structure.
```APIDOC
## GetMinInfo
### Description
Retrieves the minimum size constraints for the window, corresponding to the 'mininfo' XML attribute. Optionally includes shadow dimensions.
### Parameters
#### Query Parameters
- **bContainShadow** (bool) - Optional - If true, includes shadow dimensions; defaults to false.
### Returns
- **CSize** - A structure representing the minimum width (cx) and height (cy).
```
--------------------------------
### Set Prompt Text (string UTF8)
Source: https://github.com/netease-im/nim_duilib_framework/blob/master/docs/Controls/RichEdit.md
Sets the prompt text using a UTF-8 encoded string.
```cpp
void SetUTF8PromptText(const std::string& strText)
```
--------------------------------
### Set Minimum Window Size
Source: https://github.com/netease-im/nim_duilib_framework/blob/master/docs/Controls/Window.md
Sets the minimum width and height for the window, with an option to include shadow.
```cpp
void SetMinInfo(int cx, int cy, bool bContainShadow = false)
```
--------------------------------
### HandleMessageTemplate (1)
Source: https://github.com/netease-im/nim_duilib_framework/blob/master/docs/Controls/Control.md
The unified message handling entry point for controls, converting traditional Windows messages into a custom format.
```APIDOC
## HandleMessageTemplate (1)
### Description
Unified message handling entry point for controls, converting traditional Windows messages into a custom format.
### Method
`void HandleMessageTemplate(EventType eventType, WPARAM wParam = 0, LPARAM lParam = 0, TCHAR tChar = 0, CPoint mousePos = CPoint())`
### Parameters
#### Path Parameters
- `eventType` (EventType) - The message content.
- `wParam` (WPARAM) - Additional message content. Defaults to 0.
- `lParam` (LPARAM) - Additional message content. Defaults to 0.
- `tChar` (TCHAR) - Key information. Defaults to 0.
- `mousePos` (CPoint) - Mouse information. Defaults to CPoint().
```
--------------------------------
### Get Text Color
Source: https://github.com/netease-im/nim_duilib_framework/blob/master/docs/Controls/RichEdit.md
Retrieve the current text color of the RichEdit control.
```cpp
std::wstring GetTextColor()
```
--------------------------------
### Get Root Control
Source: https://github.com/netease-im/nim_duilib_framework/blob/master/docs/Controls/Window.md
Retrieves a pointer to the outermost container control of the window.
```cpp
Control* GetRoot()
```
--------------------------------
### Get Image Information
Source: https://github.com/netease-im/nim_duilib_framework/blob/master/docs/Controls/Control.md
Caches image information based on the provided image path. This method prepares image data for rendering.
```cpp
void GetImage(Image& duiImage)
```
--------------------------------
### Set Height Percent
Source: https://github.com/netease-im/nim_duilib_framework/blob/master/docs/Controls/Window.md
Sets the initial height of the window as a percentage of the screen height.
```cpp
void SetHeightPercent(double heightPercent)
```
--------------------------------
### Get Round Corner
Source: https://github.com/netease-im/nim_duilib_framework/blob/master/docs/Controls/Window.md
Retrieves the current roundness of the window's corners.
```cpp
CSize GetRoundCorner()
```
--------------------------------
### SetHeightPercent
Source: https://github.com/netease-im/nim_duilib_framework/blob/master/docs/Controls/Window.md
Sets the initial height of the window as a percentage of the screen height. This allows the window's height to scale relative to the screen. Takes a double value as input.
```APIDOC
## SetHeightPercent
### Description
Sets the initial height of the window as a percentage of the screen height.
### Parameters
#### Path Parameters
- **heightPercent** (double) - Required - The percentage value for the window's height.
```
--------------------------------
### Get Mouse Position
Source: https://github.com/netease-im/nim_duilib_framework/blob/master/docs/Controls/Window.md
Returns the current screen coordinates of the mouse cursor.
```cpp
POINT GetMousePos()
```
--------------------------------
### SetMinInfo
Source: https://github.com/netease-im/nim_duilib_framework/blob/master/docs/Controls/Window.md
Sets the minimum size constraints for the window. This prevents the window from being resized smaller than the specified dimensions. Takes width (cx), height (cy), and an optional boolean for shadow inclusion.
```APIDOC
## SetMinInfo
### Description
Sets the minimum size constraints for the window.
### Parameters
#### Path Parameters
- **cx** (int) - Required - The minimum width.
- **cy** (int) - Required - The minimum height.
- **bContainShadow** (bool) - Optional - If false, cx and cy do not include shadow dimensions; defaults to false.
```
--------------------------------
### Create Caret
Source: https://github.com/netease-im/nim_duilib_framework/blob/master/docs/Controls/RichEdit.md
Creates a caret (cursor) with the specified width and height. Returns true on success, false on failure.
```cpp
BOOL CreateCaret(INT xWidth, INT yHeight)
```
--------------------------------
### GetThumbStateImage
Source: https://github.com/netease-im/nim_duilib_framework/blob/master/docs/Controls/Slider.md
Gets the image associated with a specific state of the slider's thumb.
```APIDOC
## GetThumbStateImage
### Description
Gets the image associated with a specific state of the slider's thumb.
### Method
```cpp
std::wstring GetThumbStateImage(ControlStateType stateType)
```
### Parameters
#### Path Parameters
- **stateType** (ControlStateType) - Required - The state for which to get the image (refer to Control enum).
```
--------------------------------
### Get Change Step
Source: https://github.com/netease-im/nim_duilib_framework/blob/master/docs/Controls/Slider.md
Retrieves the current step increment value for the slider.
```cpp
int GetChangeStep()
```
--------------------------------
### Create Box from XML
Source: https://github.com/netease-im/nim_duilib_framework/blob/master/docs/GLOBAL.md
Creates a UI Box object from an XML file. An optional callback can be provided for custom control handling.
```cpp
static Box* CreateBox(const std::wstring& strXmlPath, CreateControlCallback callback = CreateControlCallback())
```
--------------------------------
### Get Estimate Image Pointer
Source: https://github.com/netease-im/nim_duilib_framework/blob/master/docs/Controls/Control.md
Retrieves a pointer to the control's image object.
```cpp
virtual Image* GetEstimateImage()
```
--------------------------------
### GetTextLength
Source: https://github.com/netease-im/nim_duilib_framework/blob/master/docs/Controls/RichEdit.md
Gets the length of the text in the control. Supports flags to specify how length is determined.
```APIDOC
## GetTextLength
### Description
Gets the length of the text in the control.
### Method
```cpp
long GetTextLength(DWORD dwFlags = GTL_DEFAULT)
```
### Parameters
- **dwFlags** (DWORD) - Optional - Specifies how to determine the text length. Refer to https://docs.microsoft.com/en-us/windows/desktop/controls/em-gettextlengthex for details. Defaults to GTL_DEFAULT.
```
--------------------------------
### Set Prompt Mode
Source: https://github.com/netease-im/nim_duilib_framework/blob/master/docs/Controls/RichEdit.md
Enables or disables the display of prompt text. Set `bPrompt` to true to show, false to hide.
```cpp
void SetPromptMode(bool bPrompt)
```
--------------------------------
### GetLimitText
Source: https://github.com/netease-im/nim_duilib_framework/blob/master/docs/Controls/RichEdit.md
Gets the maximum number of characters allowed in the control. Returns the character limit.
```APIDOC
## GetLimitText
### Description
Gets the maximum number of characters allowed in the control.
### Method
```cpp
int GetLimitText()
```
### Parameters
None
### Returns
- int: Returns the character limit.
```
--------------------------------
### GetTextColor
Source: https://github.com/netease-im/nim_duilib_framework/blob/master/docs/Controls/RichEdit.md
Gets the current text color of the control. Returns the current text color.
```APIDOC
## GetTextColor
### Description
Gets the current text color of the control.
### Method
```cpp
std::wstring GetTextColor()
```
### Parameters
None
### Returns
- std::wstring: Returns the current text color.
```
--------------------------------
### Add Font with Properties
Source: https://github.com/netease-im/nim_duilib_framework/blob/master/docs/GLOBAL.md
Adds a new font to the system with specified properties including name, size, and style (bold, underline, italic). Returns the HFONT handle of the created font.
```cpp
static HFONT AddFont(const std::wstring& strFontName, int nSize, bool bBold, bool bUnderline, bool bItalic)
```
--------------------------------
### GetTextVerAlignType
Source: https://github.com/netease-im/nim_duilib_framework/blob/master/docs/Controls/RichEdit.md
Gets the vertical alignment type for the content. Returns the vertical alignment setting.
```APIDOC
## GetTextVerAlignType
### Description
Gets the vertical alignment type for the content.
### Method
```cpp
VerAlignType GetTextVerAlignType()
```
### Parameters
None
### Returns
- VerAlignType: Returns the vertical alignment type for the content (top, center, bottom).
```
--------------------------------
### SetWindow (overload 1)
Source: https://github.com/netease-im/nim_duilib_framework/blob/master/docs/Controls/Control.md
Sets the window that the container belongs to, with an option to initialize the control.
```APIDOC
## SetWindow
### Description
Sets the window that the container belongs to, with an option to initialize the control.
### Method
```cpp
virtual void SetWindow(Window* pManager, Box* pParent, bool bInit = true)
```
### Parameters
#### Path Parameters
- **pManager** (Window*) - Pointer to the window.
- **pParent** (Box*) - Pointer to the parent container.
- **bInit** (bool) - Whether to call Init to initialize the control after setting. Defaults to true.
```
--------------------------------
### Paint
Source: https://github.com/netease-im/nim_duilib_framework/blob/master/docs/Controls/Window.md
Executes the painting logic for the control.
```APIDOC
## Paint
### Description
Executes the control's painting routine. This function is typically called by the framework when the control needs to be redrawn.
### Signature
```cpp
void Paint()
```
### Parameters
None.
### Returns
None.
```
--------------------------------
### Get Character Limit
Source: https://github.com/netease-im/nim_duilib_framework/blob/master/docs/Controls/RichEdit.md
Retrieve the maximum number of characters that can be entered into the RichEdit control.
```cpp
int GetLimitText()
```
--------------------------------
### Arrange
Source: https://github.com/netease-im/nim_duilib_framework/blob/master/docs/Controls/Control.md
Performs the layout arrangement for the control.
```APIDOC
## Arrange
### Description
Performs the layout arrangement for the control.
### Method
```cpp
virtual void Arrange()
```
### Parameters
None
```
--------------------------------
### HomeUp
Source: https://github.com/netease-im/nim_duilib_framework/blob/master/docs/Containers/ScrollableBox.md
Scrolls the content to the very top.
```APIDOC
## HomeUp
### Description
Scrolls to the very top of the scrollbar.
### Method
`virtual void HomeUp()
`
### Returns
- None.
```
--------------------------------
### Get Last Mouse Position
Source: https://github.com/netease-im/nim_duilib_framework/blob/master/docs/Controls/Window.md
Retrieves the last recorded coordinates of the mouse cursor.
```cpp
POINT GetLastMousePos()
```
--------------------------------
### Get Font Info with Device Context
Source: https://github.com/netease-im/nim_duilib_framework/blob/master/docs/GLOBAL.md
Retrieves font information for a given font index and device context. This is useful for accurate font rendering metrics.
```cpp
static TFontInfo* GetFontInfo(std::size_t index, HDC hDcPaint)
```
--------------------------------
### Get New Hover Control
Source: https://github.com/netease-im/nim_duilib_framework/blob/master/docs/Controls/Window.md
Retrieves a pointer to the control currently under the mouse cursor.
```cpp
Control* GetNewHover()
```
--------------------------------
### Set Prompt Text ID (wstring)
Source: https://github.com/netease-im/nim_duilib_framework/blob/master/docs/Controls/RichEdit.md
Sets the prompt text using a string ID, which must exist in the loaded language files.
```cpp
void SetPromptTextId(const std::wstring& strTextId)
```
--------------------------------
### Set UTF8 Background Image Path
Source: https://github.com/netease-im/nim_duilib_framework/blob/master/docs/Controls/Control.md
Sets the background image for the control using a UTF8 encoded string path.
```cpp
void SetUTF8BkImage(const std::string& strImage)
```
--------------------------------
### GetHorizontalScrollBar - Get Horizontal Scrollbar Object
Source: https://github.com/netease-im/nim_duilib_framework/blob/master/docs/Containers/ScrollableBox.md
Retrieves a pointer to the horizontal scrollbar object.
```cpp
virtual void GetHorizontalScrollBar()
```
--------------------------------
### EstimateSize Method
Source: https://github.com/netease-im/nim_duilib_framework/blob/master/docs/Controls/Control.md
Estimates the size of the control based on available space. Further details are pending.
```cpp
virtual CSize EstimateSize(CSize szAvailable)
```
--------------------------------
### GetVerticalScrollBar - Get Vertical Scrollbar Object
Source: https://github.com/netease-im/nim_duilib_framework/blob/master/docs/Containers/ScrollableBox.md
Retrieves a pointer to the vertical scrollbar object.
```cpp
virtual void GetVerticalScrollBar()
```
--------------------------------
### SetFixedWidth Method
Source: https://github.com/netease-im/nim_duilib_framework/blob/master/docs/Controls/Control.md
Sets a fixed width for the control. Options include whether to re-arrange the layout and if DPI scaling should be applied.
```cpp
void SetFixedWidth(int cx, bool bArrange = true, bool bNeedDpiScale = true)
```
--------------------------------
### CreateCaret
Source: https://github.com/netease-im/nim_duilib_framework/blob/master/docs/Controls/RichEdit.md
Creates a caret with the specified width and height. Returns true on success and false on failure.
```APIDOC
## CreateCaret
### Description
Creates a caret with the specified width and height. Returns true on success and false on failure.
### Method
```cpp
BOOL CreateCaret(INT xWidth, INT yHeight)
```
### Parameters
#### Path Parameters
- **xWidth** (INT) - Required - The width of the caret.
- **yHeight** (INT) - Required - The height of the caret.
### Returns
- (BOOL) - True if the caret was created successfully, false otherwise.
```
--------------------------------
### Get Current Progress Value
Source: https://github.com/netease-im/nim_duilib_framework/blob/master/docs/Controls/Progress.md
Retrieves the current progress value, typically a percentage.
```cpp
double GetValue()
```
--------------------------------
### Get Thumb Rect
Source: https://github.com/netease-im/nim_duilib_framework/blob/master/docs/Controls/Slider.md
Retrieves the rectangular bounding box of the slider's thumb.
```cpp
UiRect GetThumbRect()
```
--------------------------------
### Create Box from XML with Cache
Source: https://github.com/netease-im/nim_duilib_framework/blob/master/docs/GLOBAL.md
Creates a UI Box object from an XML file, utilizing a cache if available. An optional callback can be provided for custom control handling.
```cpp
static Box* CreateBoxWithCache(const std::wstring& strXmlPath, CreateControlCallback callback = CreateControlCallback())
```
--------------------------------
### Get Button 2 State Image
Source: https://github.com/netease-im/nim_duilib_framework/blob/master/docs/Controls/ScrollBar.md
Retrieves the image path for the second button (right or bottom arrow) based on its current state (e.g., normal, hot, pushed).
```cpp
std::wstring GetButton2StateImage(ControlStateType stateType)
```
--------------------------------
### Get Tool Tip Text
Source: https://github.com/netease-im/nim_duilib_framework/blob/master/docs/Controls/Control.md
Retrieves the tooltip text displayed when the mouse hovers over the control.
```cpp
virtual std::wstring GetToolTipText()
```
--------------------------------
### Paint Control
Source: https://github.com/netease-im/nim_duilib_framework/blob/master/docs/Controls/Control.md
The main entry point for painting the control. It takes a render context and a rectangle defining the area to be painted.
```cpp
virtual void Paint(IRenderContext* pRender, const UiRect& rcPaint)
```
--------------------------------
### GetWindow Method
Source: https://github.com/netease-im/nim_duilib_framework/blob/master/docs/Controls/Control.md
Retrieves a pointer to the window associated with this control.
```cpp
virtual Window* GetWindow()
```
--------------------------------
### Get Border Round Size
Source: https://github.com/netease-im/nim_duilib_framework/blob/master/docs/Controls/Control.md
Retrieves the rounded corner sizes for the control's border.
```cpp
CSize GetBorderRound()
```
--------------------------------
### Set Maximize Info
Source: https://github.com/netease-im/nim_duilib_framework/blob/master/docs/Controls/Window.md
Sets the parameters that define how the window behaves when maximized.
```cpp
void SetMaximizeInfo(UiRect& rcMaximize)
```
--------------------------------
### LineLength
Source: https://github.com/netease-im/nim_duilib_framework/blob/master/docs/Controls/RichEdit.md
Gets the data length of a specified line. Defaults to the last line if no line is specified.
```APIDOC
## LineLength
### Description
Gets the data length of a specified line. Defaults to the last line if no line is specified.
### Method
```cpp
int LineLength(int nLine = -1)
```
### Parameters
#### Path Parameters
- **nLine** (int) - Optional - The line number to get the length for. Defaults to -1.
### Returns
- (int) - The data length of the specified line.
```
--------------------------------
### Nested HBox with VBox Containers
Source: https://github.com/netease-im/nim_duilib_framework/blob/master/docs/Containers/HBox.md
Shows an HBox containing three VBox containers, each arranged horizontally. Each VBox then contains a Label.
```xml
```
--------------------------------
### Set Background Image Path
Source: https://github.com/netease-im/nim_duilib_framework/blob/master/docs/Controls/Control.md
Sets the background image for the control using a wide string path.
```cpp
void SetBkImage(const std::wstring& strImage)
```
--------------------------------
### Get Character Position from Index
Source: https://github.com/netease-im/nim_duilib_framework/blob/master/docs/Controls/RichEdit.md
Calculates the client area coordinates of a character at a given index.
```cpp
CPoint GetCharPos(long lChar)
```
--------------------------------
### Create a Drawing Path
Source: https://github.com/netease-im/nim_duilib_framework/blob/master/docs/GLOBAL.md
Creates a new drawing path object. This function does not take any parameters and returns a unique pointer to an IPath object.
```cpp
static std::unique_ptr CreatePath()
```
--------------------------------
### GetUTF8Text
Source: https://github.com/netease-im/nim_duilib_framework/blob/master/docs/Controls/RichEdit.md
Gets the text content of the control in UTF8 format. Returns the text as a UTF8 string.
```APIDOC
## GetUTF8Text
### Description
Gets the text content of the control in UTF8 format.
### Method
```cpp
virtual std::string GetUTF8Text()
```
### Parameters
None
### Returns
- std::string: Returns the text content of the control in UTF8 format.
```
--------------------------------
### Set Button Up on Kill Focus
Source: https://github.com/netease-im/nim_duilib_framework/blob/master/docs/Controls/Control.md
Determines if a mouse button up message should be sent when the control loses focus. Set to true to send the message, false to suppress it.
```cpp
void SetNeedButtonUpWhenKillFocus(bool bNeed)
```
--------------------------------
### Set Pointer Handling
Source: https://github.com/netease-im/nim_duilib_framework/blob/master/docs/Controls/Window.md
Configures whether touch events should be handled by the window.
```cpp
void SetHandlePointer(bool bHandle)
```
--------------------------------
### Get Alpha Fix Corner
Source: https://github.com/netease-im/nim_duilib_framework/blob/master/docs/Controls/Window.md
Retrieves the nine-grid description for the transparent channel repair area.
```cpp
UiRect GetAlphaFixCorner()
```
--------------------------------
### Get Option Group
Source: https://github.com/netease-im/nim_duilib_framework/blob/master/docs/Controls/Window.md
Retrieves the list of controls associated with a specific option group name.
```cpp
std::vector* GetOptionGroup(const std::wstring& strGroupName)
```
--------------------------------
### Set Maximum Window Size
Source: https://github.com/netease-im/nim_duilib_framework/blob/master/docs/Controls/Window.md
Sets the maximum width and height for the window, with an option to include shadow.
```cpp
void SetMaxInfo(int cx, int cy, bool bContainShadow = false)
```
--------------------------------
### Nested VBox with HBoxes
Source: https://github.com/netease-im/nim_duilib_framework/blob/master/docs/Containers/VBox.md
Shows a VBox containing three HBox containers, each with a Label, arranged vertically. The HBoxes are stacked from top to bottom.
```xml
```
--------------------------------
### GetRoot
Source: https://github.com/netease-im/nim_duilib_framework/blob/master/docs/Controls/Window.md
Retrieves a pointer to the root control of the window.
```APIDOC
## GetRoot
### Description
Gets the root control of the window.
### Method
Control* GetRoot()
### Parameters
None.
```
--------------------------------
### Get Maximum Value of Progress Bar
Source: https://github.com/netease-im/nim_duilib_framework/blob/master/docs/Controls/Progress.md
Retrieves the maximum value set for the progress bar.
```cpp
int GetMaxValue()
```
--------------------------------
### Get Minimum Value of Progress Bar
Source: https://github.com/netease-im/nim_duilib_framework/blob/master/docs/Controls/Progress.md
Retrieves the minimum value set for the progress bar.
```cpp
int GetMinValue()
```
--------------------------------
### Get Progress Bar Padding
Source: https://github.com/netease-im/nim_duilib_framework/blob/master/docs/Controls/Slider.md
Retrieves the padding applied to the progress bar area of the slider.
```cpp
UiRect GetProgressBarPadding()
```
--------------------------------
### GetWindow
Source: https://github.com/netease-im/nim_duilib_framework/blob/master/docs/Controls/Control.md
Retrieves a pointer to the associated window of the control.
```APIDOC
## GetWindow
### Description
Retrieves a pointer to the associated window of the control.
### Method
```cpp
virtual Window* GetWindow()
```
### Parameters
None
### Returns
Returns a pointer to the associated window.
```
--------------------------------
### Get Border Color
Source: https://github.com/netease-im/nim_duilib_framework/blob/master/docs/Controls/Control.md
Retrieves the border color of the control as a string. This color value is defined in global.xml.
```cpp
std::wstring GetBorderColor()
```
--------------------------------
### Fill Box with XML
Source: https://github.com/netease-im/nim_duilib_framework/blob/master/docs/GLOBAL.md
Fills an existing UI Box object with content defined in an XML file. An optional callback can be provided for custom control handling.
```cpp
static void FillBox(Box* pUserDefinedBox, const std::wstring& strXmlPath, CreateControlCallback callback = CreateControlCallback())
```
--------------------------------
### SetWinStyle
Source: https://github.com/netease-im/nim_duilib_framework/blob/master/docs/Controls/RichEdit.md
Sets the window style of the control. Accepts the desired window style value.
```APIDOC
## SetWinStyle
### Description
Sets the window style of the control.
### Method
```cpp
void SetWinStyle(LONG lStyle)
```
### Parameters
- **lStyle** (LONG) - Required - The window style to set.
```
--------------------------------
### Get Control State
Source: https://github.com/netease-im/nim_duilib_framework/blob/master/docs/Controls/Control.md
Retrieves the current state of the control. Refer to the ControlStateType enum for possible states.
```cpp
ControlStateType GetState()
```
--------------------------------
### Get Background Color
Source: https://github.com/netease-im/nim_duilib_framework/blob/master/docs/Controls/Control.md
Retrieves the background color of the control as a string. This color value is defined in global.xml.
```cpp
std::wstring GetBkColor()
```
--------------------------------
### TouchUp
Source: https://github.com/netease-im/nim_duilib_framework/blob/master/docs/Containers/ScrollableBox.md
Handles touch input for scrolling upwards.
```APIDOC
## TouchUp
### Description
Handles touch input for scrolling upwards (responds to WM_TOUCH messages).
### Method
`virtual void TouchUp()
`
### Returns
- None.
```
--------------------------------
### Get Character Index from Position
Source: https://github.com/netease-im/nim_duilib_framework/blob/master/docs/Controls/RichEdit.md
Finds the character index closest to a given client area coordinate.
```cpp
int CharFromPos(CPoint pt)
```
--------------------------------
### Get Line Number from Character Index
Source: https://github.com/netease-im/nim_duilib_framework/blob/master/docs/Controls/RichEdit.md
Determines the line number that contains a character at a specific index.
```cpp
long LineFromChar(long nIndex)
```
--------------------------------
### GetModify
Source: https://github.com/netease-im/nim_duilib_framework/blob/master/docs/Controls/RichEdit.md
Gets the modification flag of the control. Returns true if the modification flag is set, false otherwise.
```APIDOC
## GetModify
### Description
Gets the modification flag of the control.
### Method
```cpp
bool GetModify()
```
### Parameters
None
### Returns
- bool: Returns true if the modification flag is set, false otherwise.
```
--------------------------------
### Get Text Content as UTF8
Source: https://github.com/netease-im/nim_duilib_framework/blob/master/docs/Controls/RichEdit.md
Retrieve the plain text content of the RichEdit control in UTF8 format.
```cpp
virtual std::string GetUTF8Text()
```
--------------------------------
### Get Maximum Window Size
Source: https://github.com/netease-im/nim_duilib_framework/blob/master/docs/Controls/Window.md
Retrieves the maximum allowed dimensions for the window, optionally including shadow.
```cpp
CSize GetMaxInfo(bool bContainShadow = false)
```
--------------------------------
### PaintChild
Source: https://github.com/netease-im/nim_duilib_framework/blob/master/docs/Controls/Control.md
The entry point for painting child controls within the current control.
```APIDOC
## PaintChild
### Description
Entry function for painting child controls.
### Method
`virtual void PaintChild(IRenderContext* pRender, const UiRect& rcPaint)`
### Parameters
#### Path Parameters
- `pRender` (IRenderContext*) - Specifies the rendering area.
- `rcPaint` (const UiRect&) - Specifies the drawing coordinates.
```
--------------------------------
### Set Window Position
Source: https://github.com/netease-im/nim_duilib_framework/blob/master/docs/Controls/Window.md
Sets the window's position and size, with options for DPI scaling and window ordering.
```cpp
void SetPos(const UiRect& rc, bool bNeedDpiScale, UINT uFlags, HWND hWndInsertAfter = NULL, bool bContainShadow = false)
```
--------------------------------
### GetScrollBarPadding - Get Scrollbar Padding
Source: https://github.com/netease-im/nim_duilib_framework/blob/master/docs/Containers/ScrollableBox.md
Retrieves the padding applied to the scrollbar, affecting its margin from the container edges.
```cpp
virtual void GetScrollBarPadding()
```
--------------------------------
### Fill Box with XML using Cache
Source: https://github.com/netease-im/nim_duilib_framework/blob/master/docs/GLOBAL.md
Fills an existing UI Box object using cached XML data, rebuilding if necessary. An optional callback can be provided for custom control handling.
```cpp
static void FillBoxWithCache(Box* pUserDefinedBox, const std::wstring& strXmlPath, CreateControlCallback callback = CreateControlCallback())
```
--------------------------------
### GetScrollBarFloat - Get Scrollbar Float State
Source: https://github.com/netease-im/nim_duilib_framework/blob/master/docs/Containers/ScrollableBox.md
Retrieves whether the scrollbar is set to float above the child controls.
```cpp
virtual void GetScrollBarFloat()
```
--------------------------------
### GetScrollRange - Get Scrollbar Range
Source: https://github.com/netease-im/nim_duilib_framework/blob/master/docs/Containers/ScrollableBox.md
Retrieves the total range of the scrollbar. Returns scrollbar range information.
```cpp
virtual CSize GetScrollRange()
```
--------------------------------
### SetPromptText
Source: https://github.com/netease-im/nim_duilib_framework/blob/master/docs/Controls/RichEdit.md
Sets the prompt text.
```APIDOC
## SetPromptText
### Description
Sets the prompt text.
### Method
```cpp
void SetPromptText(const std::wstring& strText)
```
### Parameters
#### Path Parameters
- **strText** (const std::wstring&) - Required - The prompt text to set.
### Returns
None
```
--------------------------------
### GetScrollPos - Get Scrollbar Position
Source: https://github.com/netease-im/nim_duilib_framework/blob/master/docs/Containers/ScrollableBox.md
Retrieves the current position of the scrollbar. Returns scrollbar position information.
```cpp
virtual CSize GetScrollPos()
```
--------------------------------
### GetMaxInfo
Source: https://github.com/netease-im/nim_duilib_framework/blob/master/docs/Controls/Window.md
Retrieves the maximum size constraints for the window. This corresponds to the 'maxinfo' attribute in XML. An optional boolean parameter can specify whether to include shadow dimensions. Returns a CSize structure.
```APIDOC
## GetMaxInfo
### Description
Retrieves the maximum size constraints for the window, corresponding to the 'maxinfo' XML attribute. Optionally includes shadow dimensions.
### Parameters
#### Query Parameters
- **bContainShadow** (bool) - Optional - If true, includes shadow dimensions; defaults to false.
### Returns
- **CSize** - A structure representing the maximum width (cx) and height (cy).
```
--------------------------------
### Set Render Transparent Layer
Source: https://github.com/netease-im/nim_duilib_framework/blob/master/docs/Controls/Window.md
Configures whether the control should render with a transparent layer. Returns the previous state of transparent rendering.
```cpp
bool SetRenderTransparent(bool bCanvasTransparent)
```
--------------------------------
### GetWindowClassName
Source: https://github.com/netease-im/nim_duilib_framework/blob/master/docs/Utils/WindowImplBase.md
Retrieves the window class name. This method should be implemented to get the unique window class name.
```APIDOC
## GetWindowClassName
### Description
Retrieves the window class name. This method should be implemented to get the unique window class name.
### Method
`virtual std::wstring GetWindowClassName(void)`
### Response
#### Success Response
- **Return Value** (std::wstring) - The unique window class name.
```
--------------------------------
### SetPromptMode
Source: https://github.com/netease-im/nim_duilib_framework/blob/master/docs/Controls/RichEdit.md
Sets whether to display prompt text. Set to true to display, false to hide.
```APIDOC
## SetPromptMode
### Description
Sets whether to display prompt text. Set to true to display, false to hide.
### Method
```cpp
void SetPromptMode(bool bPrompt)
```
### Parameters
#### Path Parameters
- **bPrompt** (bool) - Required - Set to true to display prompt text, false to hide it.
### Returns
None
```