如上.
STDCALL能不能不用在DLL文件里面的?

解决方案 »

  1.   

    给你简单的例子。
    function getedit(HWND:HWND;LPARAM :lParam):boolean;stdcall;
    var
      classname : pchar;
    begin
      GetMem(classname,100);
      ZeroMemory(classname,100);
      while hwnd<>0 do
      begin
        GetClassName(hwnd,classname,100);
        if classname='Edit' then
        begin
          SetWindowText(HWND,pchar('123'));
          Result := false;
        end;
      end;
    end;
    //调用
    procedure TForm1.Button1Click(Sender: TObject);
    var
      hl : THandle;
    begin
      hl := FindWindow(nil,'Form1');
      if hl=0 then exit;
      EnumChildWindows(hl,@getedit,0);
    end;
      

  2.   

    回调函数必须声明为stdcall.STDCALL能不能不用在DLL文件里面的?
    ?? 什么意思 你如果是用C/C++写的 可以用cdecl