我现在用D7其中没有这几个functions
有哪位用过这几个vista中新加的api的?你们用的什么版本的delphi
可不可以贴些调用的程序

解决方案 »

  1.   

    这个应该是在Delphi2000+版本上的程序才有的,不过也可以直接从kernel32.dll直接导出用
      

  2.   

    这个貌似确实是vista和server 2008才有的
    这两个系统都不是俺这种穷人用得起的
      

  3.   

    如何导出?
    external 'kernel32.dll' name EnumSystemLocalesEx?
    或者能不能看看你200*版里windows.pas里怎么写的给我贴过来?
      

  4.   

    就是那个意思,静态调用DLL的函数
      

  5.   

    我静态调用了
    然后很奇怪的是我的EnumLocalesProcEx只被回调一次,返回了一个arabe阿拉伯就结束了
    有没有遇到过这种情况??EnumSystemLocalesEx(@EnumLocalesProcEx,0,0,nil);
    function EnumLocalesProcEx(pLocaleString: PWideChar; dwFlags: DWORD; lParam: LPARAM):boolean; stdcall;
    var
      LCID,m:integer;
      Buffer:array[0..255] of widechar;
      S:string;  function SearchIndex(S:String):integer;
      var Found:boolean;
      begin
        Result:=0;Found:=false;
        while (Result<ListLocales.Count) and not(Found) do begin
          if Uppercase(SansAccent(S))<UpperCase(SansAccent(ListLocales[Result])) then Found:=true else inc(Result);
        end;
      end;
    begin
      try
        Result:=true;
        LCID:=LocaleNameToLCID(pLocaleString,0);
        FillChar(Buffer,SizeOf(Buffer),0);
        GetLocaleInfoEx(pLocaleString,LOCALE_IDEFAULTANSICODEPAGE,Buffer,SizeOf(Buffer));
        Application.MessageBox(PChar(WideCharToString(pLocaleString)),'1');
        //if CP=StrToIntDef(Buffer,0) then begin
          FillChar(Buffer,SizeOf(Buffer),0);
          GetLocaleInfoEx(pLocaleString,LOCALE_SLANGUAGE,Buffer,SizeOf(Buffer));
          Application.MessageBox(PChar(WideCharToString(Buffer)),'2');
          //tri par ordre alphabétique ListLocales avec synchro ListIdLangages
          s := WideCharToString(Buffer);
          Application.MessageBox(PChar(s),'3');
          m:=SearchIndex(s);
          ListLocales.Insert(m,s);
          ListIdLangages.Insert(m,IntToStr(LCID));
        //end;
      except
        Application.MessageBox('exception','4');
        //Result:=false;
      end;
    end;