1、问题a: 我想把这个while GetMessage(Msg, 0, 0, 0) do
TranslateMessage(Msg);
转换成字符串,然后存到c:\001.txt,而不是弹出窗口的方式显示消息。2、如何把存到c:\001.txt发送到指定的邮箱,如发到[email protected]

解决方案 »

  1.   

    1:
    procedure TForm1.Button1Click(Sender: TObject);
    var
      Msg: TMsg;
      SL: TStringList;
      I: Integer;
    begin
      SL := TStringList.Create;
      I := 0;
      try
        while GetMessage(Msg, 0, 0, 0) do
        begin
          SL.Add(Format('hwnd: %.8x, wParam: %.8x, lParam: %.8x, message: %.8x, pt(%d, %d)',
            [Msg.hwnd, Msg.wParam, Msg.lParam, Msg.message, Msg.pt.X, Msg.pt.Y]));
          Inc(I);
          if I > 10 then Break;
        end;
      finally
        SL.SaveToFile('c:\001.txt');
        SL.Free;
      end;
    end;
      

  2.   

    1 转换成字符串
     ------------
     是想要数字的字符串还是类似WM_MOUSEMOVE这样的字符串?2 发邮件参看这个例子
    http://www.tomore.com/1/24669.html
      

  3.   

    小虫:你好,谢谢,但有个问题不能创建001.txt文件,而且还是弹出对话框,老驾,帮我在看看。老之:你好,谢谢,应该是文本字符串。