|
|
|
| Пишу программу в Win32 API, столкнулся с проблемой: как вывести значение поля ip-адреса?
Допустим у меня в этом поле след. ip: 172.16.0.202
GetDlgItemText(hDlg, IDC_IP, str, 15); // выдаёт 0
GetDlgItemInt(hDlg, IDC_IP, NULL, TRUE); // выдаёт 172
Чем "вычитывать" содержимое? | |
|
|
|
|
автор: heed (05.03.2010 в 12:36) |
|
|
для: StaFox
(05.03.2010 в 02:00)
| | всмысле в диалоге у контрола класс SysIPAddress32 ?
пока видел только с SendMessage() такие действия
IPM_GETADDRESS Message
Retrieves the address values for all four fields in the IP address control. lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) IPM_GETADDRESS, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = (LPARAM) (LPDWORD) pdwAddr;
); |
wParam
Must be zero.
pdwAddr
Pointer to a DWORD value that receives the address. The field 3 value will be contained in bits 0 through 7. The field 2 value will be contained in bits 8 through 15. The field 1 value will be contained in bits 16 through 23. The field 0 value will be contained in bits 24 through 31. The FIRST_IPADDRESS, SECOND_IPADDRESS, THIRD_IPADDRESS, and FOURTH_IPADDRESS macros can also be used to extract the address information. Zero will be returned as the address for any blank fields.
Return Value
Returns the number of nonblank fields.
IPM_CLEARADDRESS Message
Clears the contents of the IP address control. lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) IPM_CLEARADDRESS, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = 0; not used, must be zero
); |
wParam
Must be zero.
lParam
Must be zero.
Return Value
The return value is not used.
IPM_SETADDRESS Message
Sets the address values for all four fields in the IP address control. lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) IPM_SETADDRESS, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = (LPARAM) (DWORD) dwAddr; ); |
wParam
Must be zero.
dwAddr
DWORD value that contains the new address. The field 3 value is contained in bits 0 through 7. The field 2 value is contained in bits 8 through 15. The field 1 value is contained in bits 16 through 23. The field 0 value is contained in bits 24 through 31. The MAKEIPADDRESS macro can also be used to create the address information.
Return Value
The return value is not used.
Remarks
This message does not generate an IPN_FIELDCHANGED notification. | |
|
|
|
|
|
|
|
для: heed
(05.03.2010 в 12:36)
| | Большое спс, а то не мог в мсдн найти.. буду пробывать | |
|
|
|