P
phenix_sd
Unregistered / Unconfirmed
GUEST, unregistred user!
type
MyArr=array[0..255] of char;
PMyArr=^MyArr;
procedure TForm1.Button2Click(Sender: TObject);
var str:MyArr;
begin
str:='lol';
PostMessage(HWND_BROADCAST,WM_SETTEXT,0,integer(@str));
end;
procedure TForm1.Button1Click(Sender: TObject);
var Buffer:MSG;
begin
PeekMessage(Buffer,0,WM_SETTEXT,WM_SETTEXT,PM_NOREMOVE);
edit2.Text:=PMyArr(buffer.lParam)^;//Label
end;
edit2.Text出不来,编译通过,运行时//label处报错,
调试时发现PMyArr(buffer.lParam)^全#0,就是说没赋值,why????????
MyArr=array[0..255] of char;
PMyArr=^MyArr;
procedure TForm1.Button2Click(Sender: TObject);
var str:MyArr;
begin
str:='lol';
PostMessage(HWND_BROADCAST,WM_SETTEXT,0,integer(@str));
end;
procedure TForm1.Button1Click(Sender: TObject);
var Buffer:MSG;
begin
PeekMessage(Buffer,0,WM_SETTEXT,WM_SETTEXT,PM_NOREMOVE);
edit2.Text:=PMyArr(buffer.lParam)^;//Label
end;
edit2.Text出不来,编译通过,运行时//label处报错,
调试时发现PMyArr(buffer.lParam)^全#0,就是说没赋值,why????????