I would like to know how to get the Value in EDIT1.
Printable View
I would like to know how to get the Value in EDIT1.
Try this:
That will work if you are using EDIT1 on a dialog box. If it's on a standard window and you know its handle, you can use the following code:PHP Code:int len = GetWindowTextLength(GetDlgItem(dlghwnd, EDIT1));
char* buf;
buf = (char*)GlobalAlloc(GPTR, len + 1);
GetDlgItemText(dlghwnd, EDIT1, buf, len + 1);
MessageBox(NULL,buf,"EDIT1 Text", MB_OK);
GlobalFree((HANDLE)buf);
PHP Code:int len = GetWindowTextLength(edit1hwnd);
char* buf;
buf = (char*)GlobalAlloc(GPTR, len + 1);
GetWindowText(wndhwnd, buf, len + 1);
MessageBox(NULL,buf,"EDIT1 Text", MB_OK);
GlobalFree((HANDLE)buf);
GlobalAlloc is deprecated. Use HeapAlloc.