GetDlgItemTextA Function
https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-getdlgitemtexta
GetDlgItemTextA function (winuser.h)
Retrieves the title or text associated with a control in a dialog box.
docs.microsoft.com
대화 상자에서 컨트롤과 관련된 제목 또는 텍스트를 검색한다.
Syntax
UINT GetDlgItemTextA(
HWND hDlg,
int nIDDlgItem,
LPSTR lpString,
int cchMax
);
Parameters
1. hDlg
1) type: HWND
2) dialog box의 핸들
2. nIDDlgItem
1) type: int
2) 제목 또는 텍스트를 검색할 컨트롤의 식별자.
3. lpString
1) Type: LPTSTR
2) 제목 또는 텍스트를 수신하는 버퍼.
4. cchMax
1) type: int
2) lpString이 가리키는 버퍼에 복사할 문자열의 최대 길이(문자). NULL 문자를 포함한 문자열의 길이가 한도를 초과하면 문자열이 잘린다.
Return Value
1. type: UINT
2. 함수가 성공하면 반환 값은 종료 null 문자를 포함하지 않고 버퍼에 복사된 문자 수를 지정한다.
3. 함수가 실패하면 리턴 값은 0이다. To get extended error information, call GetLastError.
Remarks
1. 문자열이 버퍼보다 길거나 긴 경우 버퍼는 종료 null 문자로 잘린 문자열을 포함할 것이다.
2. GetDlgItem텍스트 기능은 WM_GETTEXT 메시지를 컨트롤로 전송한다.
Requirements
1. Minimum supported client
Windows 2000 Professional [desktop apps only]
2. Minimum supported server
Windows 2000 Server [desktop apps only]
3. Target Platform
Windows
4. Header
winuser.h (include Windows.h)
5. Library
User32.lib
6. DLL
User32.dll