就是不用按快捷键,有新消息就自动弹出。
程序如何知QQ有新消息?
以前好像有看这个小软件,但我想知道用DELPHI如何实现,大伙帮帮忙,谢谢!

解决方案 »

  1.   

    qq 中可以自己设的。不用写程序。在“系统参数”->“参数设置”->“综合设置”中有一个“自动弹出消息”。
      

  2.   

    unit Unit1;interfaceuses
      Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
      StdCtrls, NMUDP;type
      TForm1 = class(TForm)
        NMUDP: TNMUDP;
        Memo1: TMemo;
        Edit1: TEdit;
        Button1: TButton;
        ListBox1: TListBox;
        procedure Button1Click(Sender: TObject);
        procedure NMUDPDataReceived(Sender: TComponent; NumberBytes: Integer;
          FromIP: String; Port: Integer);
      private
        { Private declarations }
      public
        { Public declarations }
      end;var
      Form1: TForm1;implementation{$R *.DFM}procedure TForm1.Button1Click(Sender: TObject);
    var
      buf: array[0..127] of char;
    begin
      if Edit1.Text <> '' then StrCopy(buf, pchar(Edit1.text));
      if ListBox1.Items.Count > 0 then
      begin
        if ListBox1.ItemIndex <> -1 then
          NMUDP.RemoteHost := ListBox1.Items.Strings[ListBox1.ItemIndex];
      end;
      NMUDP.SendBuffer(buf, 128);
      Form1.WindowState := wsMinimized;
    end;procedure TForm1.NMUDPDataReceived(Sender: TComponent;
      NumberBytes: Integer; FromIP: String; Port: Integer);
    var
      buf: array[0..127] of char;
      bufStr: string;
      HaveIt: boolean;
      i: integer;
    begin
      for i := 0 to Listbox1.Items.Count -1 do
        if Listbox1.Items.Strings[i] = FromIP then
        begin
          HaveIt := True; break;
        end;
      if not Haveit then ListBox1.Items.Add(FromIp);  NMUDP.ReadBuffer(buf, NumberBytes);
      BufStr := string(buf);
      Memo1.Lines.Add(BufStr);
      Form1.WindowState := wsNormal;
    end;end.
      

  3.   

    系统参数”->“参数设置”->“综合设置”中有一个“自动弹出消息”。
      

  4.   

    bluebilly(蓝色天使) :NMUDP是什么?学习