怎么获得窗口里的Text
HDC hdc;PAINTSTRUCT pt;
static HWND hwndedit,hwndbutton;
char str[10]="";
switch(uMsg)
{
case WM_COMMAND:
if(((HWND)lParam==hwndbutton)&&(HIWORD(wParam)==BN_CLICKED))
{
GetWindowText(hwndedit,str,10);
return 0;
}
break;
case WM_PAINT:
hdc=BeginPaint(hwnd,&pt);
TextOut(hdc,200,200,str,strlen(str));
EndPaint(hwnd,&pt);
break;
case WM_CREATE:
hwndedit=CreateWindow("edit",NULL,WS_CHILD|WS_VISIBLE|WS_BORDER,10,60,100,25,hwnd,NULL,NULL,NULL);
ShowWindow(hwnd,SW_SHOWNORMAL);
hwndbutton=CreateWindow("button","计算",WS_CHILD|WS_VISIBLE|BS_PUSHBUTTON,100,150,100,25,hwnd,NULL,NULL,NULL);
ShowWindow(hwnd,SW_SHOWNORMAL);
break;
我调试过:str没有得到输入框中的的文本,谢谢,那位教一下,怎么改