OSFeatureとは? わかりやすく解説

OSFeature クラス

オペレーティング システム固有の機能についてのクエリを提供します。

名前空間: System.Windows.Forms
アセンブリ: System.Windows.Forms (system.windows.forms.dll 内)
構文構文

Public Class OSFeature
    Inherits FeatureSupport
public class OSFeature : FeatureSupport
public ref class OSFeature : public
 FeatureSupport
public class OSFeature extends FeatureSupport
public class OSFeature extends
 FeatureSupport
解説解説
使用例使用例

OSFeature を使用し、LayeredWindows 機能がインストールされているかどうかをオペレーティング システムに問い合わせる例を次に示します。この例では、機能が存在するかどうかを確認する 2 種類の方法を示します。最初のメソッドは、myVersion が null 参照 (Visual Basic では Nothing) かどうかを確認します。バージョンが null 参照 (Visual Basic では Nothing) の場合、機能はインストールされていません。2 番目のメソッドは、基本クラスのメソッド IsPresent を呼び出し、機能がインストールされているかどうかを調べます。結果はテキスト ボックスに表示されます。

このコードは、textBox1 が作成され、フォーム上に配置されていることを前提にしています。

Private Sub LayeredWindows()
    ' Gets the version of the layered windows feature.
    Dim myVersion As Version = _
       OSFeature.Feature.GetVersionPresent(OSFeature.LayeredWindows)
       
    ' Prints whether the feature is available.
    If Not (myVersion Is
 Nothing) Then
        textBox1.Text = "Layered windows feature is installed."
 & _
           ControlChars.CrLf
    Else
        textBox1.Text = "Layered windows feature is not installed."
 & _
           ControlChars.CrLf
    End If 
    'This is an alternate way to check whether a feature is present.
    If OSFeature.Feature.IsPresent(OSFeature.LayeredWindows) Then
        textBox1.Text &= "Again, layered windows feature is
 installed."
    Else
        textBox1.Text &= "Again, layered windows feature is
 not installed."
    End If
End Sub

private void LayeredWindows() {
   // Gets the version of the layered windows feature.
   Version myVersion = OSFeature.Feature.GetVersionPresent(OSFeature.LayeredWindows);

   // Prints whether the feature is available.
   if (myVersion != null)
      textBox1.Text = "Layered windows feature is installed." + '\n';
   else
      textBox1.Text = "Layered windows feature is not installed." + '\n';

   // This is an alternate way to check whether a feature is present.
   if (OSFeature.Feature.IsPresent(OSFeature.LayeredWindows))
      textBox1.Text += "Again, layered windows feature is installed.";
   else
      textBox1.Text += "Again, layered windows feature is not installed.";
}

private:
   void LayeredWindows()
   {
      // Gets the version of the layered windows feature.
      Version^ myVersion = OSFeature::Feature->GetVersionPresent(
         OSFeature::LayeredWindows );
      
      // Prints whether the feature is available.
      if ( myVersion != nullptr )
      {
         textBox1->Text = "Layered windows feature is installed.\n";
      }
      else
      {
         textBox1->Text = "Layered windows feature is not installed.\n";
      }

      
      // This is an alternate way to check whether a feature is present.
      if ( OSFeature::Feature->IsPresent( OSFeature::LayeredWindows
 ) )
      {
         textBox1->Text = String::Concat( textBox1->Text,
            "Again, layered windows feature is installed." );
      }
      else
      {
         textBox1->Text = String::Concat( textBox1->Text,
            "Again, layered windows feature is not installed." );
      }
   }
private void LayeredWindows()
{
    // Gets the version of the layered windows feature.
    Version myVersion = OSFeature.get_Feature().GetVersionPresent
        (OSFeature.LayeredWindows);

    // Prints whether the feature is available.
    if (myVersion != null) {
        textBox1.set_Text("Layered windows feature is installed." 
            + '\n');
    }
    else {
        textBox1.set_Text("Layered windows feature is not installed." 
            + '\n');
    }

    // This is an alternate way to check whether a feature is present.
    if (OSFeature.get_Feature().IsPresent(OSFeature.LayeredWindows))
 {
        textBox1.set_Text(textBox1.get_Text()
            + "Again, layered windows feature is installed.");
    }
    else {
        textBox1.set_Text(textBox1.get_Text() 
            + "Again, layered windows feature is not installed.");
    }
} //LayeredWindows 
継承階層継承階層
System.Object
   System.Windows.Forms.FeatureSupport
    System.Windows.Forms.OSFeature
スレッド セーフスレッド セーフ
この型の public static (Visual Basic では Shared) メンバはすべて、スレッド セーフです。インスタンス メンバの場合は、スレッド セーフであるとは限りません。
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
OSFeature メンバ
System.Windows.Forms 名前空間
System.AppDomain
Application クラス
System.Environment
SystemInformation

OSFeature コンストラクタ

OSFeature クラスの新しいインスタンスを初期化します。

名前空間: System.Windows.Forms
アセンブリ: System.Windows.Forms (system.windows.forms.dll 内)
構文構文

解説解説
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照

OSFeature フィールド


OSFeature プロパティ


OSFeature メソッド


パブリック メソッドパブリック メソッド

プロテクト メソッドプロテクト メソッド
参照参照

関連項目

OSFeature クラス
System.Windows.Forms 名前空間
System.AppDomain
Application クラス
System.Environment
SystemInformation

OSFeature メンバ

オペレーティング システム固有の機能についてのクエリを提供します。

OSFeature データ型で公開されるメンバを以下の表に示します。


プロテクト コンストラクタプロテクト コンストラクタ
  名前 説明
プロテクト メソッド OSFeature OSFeature クラスの新しいインスタンスを初期化します。
パブリック フィールドパブリック フィールド
パブリック プロパティパブリック プロパティ
パブリック メソッドパブリック メソッド
プロテクト メソッドプロテクト メソッド
参照参照

関連項目

OSFeature クラス
System.Windows.Forms 名前空間
System.AppDomain
Application クラス
System.Environment
SystemInformation



英和和英テキスト翻訳

英語⇒日本語日本語⇒英語

辞書ショートカット

すべての辞書の索引

「OSFeature」の関連用語

OSFeatureのお隣キーワード

   

英語⇒日本語
日本語⇒英語
   



OSFeatureのページの著作権

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2026 Microsoft.All rights reserved.

©2026 GRAS Group, Inc.RSS