CN_XXX消息是什么含义,他们是windows标准消息加上CN_BASE(= $BC00)的delphi自定义消息,我自己作实验发现原始的windows消息是不会被vcl处理的,比如自己写代码处理WM_NOTIFY和CN_NOTIFY,发现只有CN_NOTIFY能被处理,有人能回答吗?

解决方案 »

  1.   

    原始的windows消息是能够被处理的,你是怎么写的?
    关于CN_XXX的消息到是不太清楚。
      

  2.   

    在TWinControl的响应WM_NOTIFY的函数WMNotify

    procedure TWinControl.WMNotify(var Message: TWMNotify);
    begin
      if not DoControlMsg(Message.NMHdr^.hWndFrom, Message) then inherited;
    end;其中 DoControlMsg这样
    function DoControlMsg(ControlHandle: HWnd; var Message): Boolean;
    var
      Control: TWinControl;
    begin
      DoControlMsg := False;
      Control := FindControl(ControlHandle);
      if Control <> nil then
        with TMessage(Message) do
        begin
          Result := Control.Perform(Msg + CN_BASE, WParam, LParam);
          DoControlMsg := True;
        end;
    end;
    所以这个消息就形成了CN_NOTIFY=CN_BASE+WM_NOTIFY