2021-09-05から1日間の記事一覧
ディレクトリ内のファイル名をJSONへ出力するサンプルコードです。pathlib、jsonを使用しています。 すべてのファイルを列挙する import json from pathlib import Path # ファイル名を取得するディレクトリのパス dir_path = Path(r"C:\Windows") # 作成す…
C# 9 システムフォルダに存在するOS DLLを取得するサンプルコードです。バージョン情報の製品名が「Microsoft® Windows® Operating System」のDLLをOS DLLとみなしています。 using System; using System.Diagnostics; using System.IO; using System.Linq; …
#include <format> #include <iostream> #include <string> #include <vector> #include <optional> #define STRICT #include <Windows.h> #include <powrprof.h> #pragma comment(lib, "powrprof.lib") namespace PowerUtil { std::vector<GUID> GetPowerSchemeGUIDs() { std::vector<GUID> guids; for (ULONG i = 0; ; ++…</guid></guid></powrprof.h></windows.h></optional></vector></string></iostream></format>
#include <iostream> #include <string> #include <vector> #include <optional> #define STRICT #include <Windows.h> #include <powrprof.h> #pragma comment(lib, "powrprof.lib") namespace PowerUtil { std::vector<GUID> GetPowerSchemeGUIDs() { std::vector<GUID> guids; for (ULONG i = 0; ; ++i) { GUID guid; DW…</guid></guid></powrprof.h></windows.h></optional></vector></string></iostream>
Windows Vista以降で画面の明るさを取得・設定するサンプルコードです。 画面の明るさの範囲と設定値を取得する。 画面の明るさを設定する。 現在の画面プロファイルの概要・名前を取得する。 画面の明るさの範囲と設定値を取得する。 #include <iostream> #include <string> #</string></iostream>…