在Win10操作系统,delphi 2007开发的系统,无法看到输入法,如何处理? 
Edit1.ImeName := "输入法",这个写法在win10用不了,怎么解决?

解决方案 »

  1.   

    可考虑升级到至少Delphi XE版本
      

  2.   

    不是输入法,而应是输入法的名称。 比如:
    Edit1.ImeName := "中文 - QQ五笔输入法";
      

  3.   

    用delphi 10.2在win10试了一下,设置输入法不起作用,结论就是升级Delphi也解决不了问题。
      

  4.   

    我自动打开某一输入法的操作,在win7下正常,win10下无动作。
    procedure TForm1.ComboBox70DropDown(Sender: TObject);
    var
      i: Integer;
    begin
      ComboBox70.Clear;
      for i := 0 to Screen.Imes.Count - 1 do
      begin
        ComboBox70.Items.Add(Screen.Imes.Strings[i]);
      end;
    end;
      

  5.   

    我用delphi 10.2在win10试了一下,设置输入法都正常。 
      

  6.   

    请问一下是如何设置的?直接在设计界面的录入项选择imename项,还是用代码设置?
    我在属性直接选择imename没问题,代码就不行(win10下)
      

  7.   

    for i:=0 to ComponentCount-1 do
       SetVclIme(Components[i],ImeNameS,1);     // 自己编写的输入法函数内容主要下列代码 
    var VclClass:TComponent
        StrImeName :string  // 系统约定的输入法名称字符      TEdit(VclClass).ImeMode:=imOpen;     // 打开 
          TEdit(VclClass).ImeName:=StrImeName;
          TEdit(VclClass).ImeMode:=ImChinese;   // 中文输入法
          TEdit(VclClass).ImeName:=StrImeName;
          TEdit(VclClass).ImeMode:=imClose;    // 关闭
          TEdit(VclClass).ImeName:='';      TEdit(VclClass).ImeMode:=imSAlpha;   // 英文
          TEdit(VclClass).ImeName:=StrImeName;
      

  8.   

    你这是控件里打开输入法,我需要在全局打开输入法,原来的screen.imes属性在win10下好像失效了,取不到列表和名字,count=0。win7下没问题。
    这样做的原因是全屏显示且屏蔽了任务栏,不能选择了,只能单独加一个输入法选择功能,除了在控件里输入还有其他内容。
      

  9.   

    win10的输入法如果窗口没有光标不会激活
      

  10.   

    特别提醒:
    win7,XP的输入法支持IMM方式,
    从Vista起,输入法引入CTF方式输入法,
    Win10操作系统同时支持IMM和CTF方式,
    Screen.Imes仅能读取IMM方式的输入法。安装输入法时,高版本都是CTF方式。
      

  11.   


    {
    Microsoft Windows 文本服务框架(TSF)
    輸入法相關函數
    author:HAB
    }
    unit uTSFUtil;interfaceuses
      System.SysUtils,
      System.Classes;type
      TTSFUtil = class
      private
        class procedure DoImes(var AInputMethods: TStrings; const AName: string = '');
      public
        class function GetImes: TStrings;                //獲得輸入法列表
        class procedure SetImeName(const AName: string); //設置系統當前輸入法
      end;
    implementationuses
      Winapi.MsCTF;var
      mImeList: TStrings;type
      TLanguageProfile = class
      private
        FName: string;
        FProfile: TF_LANGUAGEPROFILE;
      public
        property Name: string read FName write FName;
        property Profile: TF_LANGUAGEPROFILE read FProfile write FProfile;
      end;{ TTSFUtil }class procedure TTSFUtil.DoImes(var AInputMethods: TStrings; const AName: string);
    var
      profiles: PPTfInputProcessorProfiles;
      Iprofiles: ITfInputProcessorProfiles;
      plangid: Word;
      enumerator: IEnumTfLanguageProfiles;
      langProfile: TF_LANGUAGEPROFILE;
      FetchedItems: Cardinal;
      pbstrProfile: WideString;
      pfEnable: Integer;
      oLanPro: TLanguageProfile;
    begin
      if not IsMSCTFAvailable then Exit;  New(profiles);
      try
        if TF_CreateInputProcessorProfiles(profiles) = S_OK then
        begin
          Iprofiles := ITfInputProcessorProfiles(profiles^);
          Iprofiles.GetCurrentLanguage(plangid);      if plangid > 0 then
          begin
            Iprofiles.EnumLanguageProfiles(plangid, enumerator);        if enumerator <> nil then
            begin
              enumerator.Next(1, langProfile, FetchedItems);
              while FetchedItems > 0 do
              begin
                //langProfile.fActive;  // -1时为当前激活输入法
                pbstrProfile := '';
                if Iprofiles.GetLanguageProfileDescription(langProfile.clsid, langProfile.langid, langProfile.guidProfile, pbstrProfile) = S_OK then
                begin              if Iprofiles.IsEnabledLanguageProfile(langProfile.clsid, langProfile.langid, langProfile.guidProfile, pfEnable) = S_OK then
                  begin
                    if pfEnable = 1 then
                    begin
                      //显示TSF输入法名称
                      oLanPro := TLanguageProfile.Create;
                      oLanPro.Name := pbstrProfile;
                      oLanPro.Profile := langProfile;
                      AInputMethods.AddObject(pbstrProfile, oLanPro);                  //激活指定输入法(clsid、 guidProfile为空时,取消激活)
                      if not AName.IsEmpty and SameText(pbstrProfile, AName) then
                        Iprofiles.ActivateLanguageProfile(langProfile.clsid, langProfile.langid, langProfile.guidProfile);
                    end;
                  end;
                end;            enumerator.Next(1, langProfile, FetchedItems);
              end;
            end;      end;
        end;
      finally
        Dispose(profiles);
      end;
    end;class function TTSFUtil.GetImes: TStrings;
    begin
      if mImeList = nil  then
      begin
        mImeList := TStringList.Create(True);
        DoImes(mImeList, '');
      end;
      Result := mImeList;
    end;class procedure TTSFUtil.SetImeName(const AName: string);
    var
      sList: TStrings;
      iIndex: Integer;
      profiles: PPTfInputProcessorProfiles;
      Iprofiles: ITfInputProcessorProfiles;
      plangid: Word;
      oLanPro: TLanguageProfile;
      langProfile: TF_LANGUAGEPROFILE;
    begin
      sList := GetImes;
      iIndex := sList.IndexOf(AName);
      if iIndex > - 1 then
      begin
        oLanPro := TLanguageProfile(sList.Objects[iIndex]);
        langProfile := oLanPro.Profile;
        New(profiles);
        try
          if TF_CreateInputProcessorProfiles(profiles) = S_OK then
          begin
            Iprofiles := ITfInputProcessorProfiles(profiles^);
            Iprofiles.GetCurrentLanguage(plangid);
            if plangid > 0 then
            begin
              Iprofiles.ActivateLanguageProfile(langProfile.clsid, langProfile.langid, langProfile.guidProfile);
            end;
          end;
        finally
          Dispose(profiles);
        end;
      end;
    end;initialization
    finalization
      FreeAndNil(mImeList);end.
      

  12.   

    输入法有十种上格式,Win初期都是IMM,如win98,XP,win7输入法支持IMM方式,
    从Vista起,输入法引入CTF方式输入法。你的问题,Win10操作系统同时支持IMM和CTF方式,
    Screen.Imes仅能读取IMM方式的输入法。安装输入法时,高版本都是CTF方式。如果你的Win10,使用输入法,IMM格式的,在Win10中,通过你的方式,设置输入法才能有效的。所有在软件中设置输入法,不是一种好的办法了。