<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Tools &amp; Development Environment on kenji.blog</title><link>http://kenji.blog/en/categories/tools--development-environment/</link><description>Recent content in Tools &amp; Development Environment on kenji.blog</description><generator>Hugo -- gohugo.io</generator><language>en</language><copyright>kenjinote</copyright><lastBuildDate>Sat, 19 Jul 2025 10:03:51 +0900</lastBuildDate><atom:link href="http://kenji.blog/en/categories/tools--development-environment/index.xml" rel="self" type="application/rss+xml"/><item><title>How to call Microsoft.Windows.AI from C++</title><link>http://kenji.blog/en/p/c-%E3%81%8B%E3%82%89microsoft.windows.ai%E3%82%92%E5%91%BC%E3%81%B3%E5%87%BA%E3%81%99%E6%96%B9%E6%B3%95/</link><pubDate>Sat, 19 Jul 2025 10:03:51 +0900</pubDate><guid>http://kenji.blog/en/p/c-%E3%81%8B%E3%82%89microsoft.windows.ai%E3%82%92%E5%91%BC%E3%81%B3%E5%87%BA%E3%81%99%E6%96%B9%E6%B3%95/</guid><description>&lt;img src="http://kenji.blog/p/c-%E3%81%8B%E3%82%89microsoft.windows.ai%E3%82%92%E5%91%BC%E3%81%B3%E5%87%BA%E3%81%99%E6%96%B9%E6%B3%95/img.png" alt="Featured image of post How to call Microsoft.Windows.AI from C++" />&lt;h1 id="-how-to-call-microsoftwindowsai-from-c-with-sample-code">🎯 How to call &lt;code>Microsoft.Windows.AI&lt;/code> from C++ [With Sample Code]
&lt;/h1>&lt;p>Since Windows 10, Windows has been equipped with a built-in **runtime capable of executing ONNX format AI models &lt;strong>. This is ** Windows ML (Windows.AI.MachineLearning)&lt;/strong>.&lt;/p>
&lt;p>In this article, we will specifically explain &lt;strong>how to call &lt;code>Microsoft.Windows.AI.MachineLearning&lt;/code> from C++ (Win32 app based)&lt;/strong>, along with ** sample code**.&lt;/p>
&lt;hr>
&lt;h2 id="-preparation">✅ Preparation
&lt;/h2>&lt;h3 id="-system-requirements">◾ System Requirements
&lt;/h3>&lt;ul>
&lt;li>Windows 10 (1809+) or Windows 11&lt;/li>
&lt;li>Visual Studio 2019 or later (Community edition is fine)&lt;/li>
&lt;li>C++/WinRT Support (&lt;code>Microsoft.Windows.CppWinRT&lt;/code>)&lt;/li>
&lt;li>Windows SDK 10.0.17763.0 or higher&lt;/li>
&lt;/ul>
&lt;hr>
&lt;h2 id="-project-configuration">✅ Project Configuration
&lt;/h2>&lt;p>Create a project in Visual Studio with the following configuration:&lt;/p>
&lt;ul>
&lt;li>
&lt;p>Type: C++ Windows Desktop Application (Empty Project)&lt;/p>
&lt;/li>
&lt;li>
&lt;p>Subsystem: Windows (&lt;code>WinMain&lt;/code>)&lt;/p>
&lt;/li>
&lt;li>
&lt;p>Add the following package via NuGet:&lt;/p>
&lt;div class="highlight">&lt;div class="chroma">
&lt;table class="lntable">&lt;tr>&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code>&lt;span class="lnt">1
&lt;/span>&lt;/code>&lt;/pre>&lt;/td>
&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code class="language-fallback" data-lang="fallback">&lt;span class="line">&lt;span class="cl">Microsoft.Windows.CppWinRT
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/td>&lt;/tr>&lt;/table>
&lt;/div>
&lt;/div>&lt;/li>
&lt;/ul>
&lt;hr>
&lt;h2 id="-sample-code">✅ Sample Code
&lt;/h2>&lt;p>Below is a minimal sample combining the Win32 API and &lt;code>Windows.AI.MachineLearning&lt;/code> using &lt;code>WinMain&lt;/code>.&lt;/p>
&lt;blockquote>
&lt;ul>
&lt;li>Note: Assume the ONNX model to be used is &lt;code>model.onnx&lt;/code>, and place it in the same folder as the executable file.&lt;/li>
&lt;/ul>
&lt;/blockquote>
&lt;h3 id="maincpp">&lt;code>main.cpp&lt;/code>
&lt;/h3>&lt;div class="highlight">&lt;div class="chroma">
&lt;table class="lntable">&lt;tr>&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code>&lt;span class="lnt"> 1
&lt;/span>&lt;span class="lnt"> 2
&lt;/span>&lt;span class="lnt"> 3
&lt;/span>&lt;span class="lnt"> 4
&lt;/span>&lt;span class="lnt"> 5
&lt;/span>&lt;span class="lnt"> 6
&lt;/span>&lt;span class="lnt"> 7
&lt;/span>&lt;span class="lnt"> 8
&lt;/span>&lt;span class="lnt"> 9
&lt;/span>&lt;span class="lnt">10
&lt;/span>&lt;span class="lnt">11
&lt;/span>&lt;span class="lnt">12
&lt;/span>&lt;span class="lnt">13
&lt;/span>&lt;span class="lnt">14
&lt;/span>&lt;span class="lnt">15
&lt;/span>&lt;span class="lnt">16
&lt;/span>&lt;span class="lnt">17
&lt;/span>&lt;span class="lnt">18
&lt;/span>&lt;span class="lnt">19
&lt;/span>&lt;span class="lnt">20
&lt;/span>&lt;span class="lnt">21
&lt;/span>&lt;span class="lnt">22
&lt;/span>&lt;span class="lnt">23
&lt;/span>&lt;span class="lnt">24
&lt;/span>&lt;span class="lnt">25
&lt;/span>&lt;span class="lnt">26
&lt;/span>&lt;span class="lnt">27
&lt;/span>&lt;span class="lnt">28
&lt;/span>&lt;span class="lnt">29
&lt;/span>&lt;span class="lnt">30
&lt;/span>&lt;span class="lnt">31
&lt;/span>&lt;span class="lnt">32
&lt;/span>&lt;span class="lnt">33
&lt;/span>&lt;span class="lnt">34
&lt;/span>&lt;span class="lnt">35
&lt;/span>&lt;span class="lnt">36
&lt;/span>&lt;span class="lnt">37
&lt;/span>&lt;span class="lnt">38
&lt;/span>&lt;/code>&lt;/pre>&lt;/td>
&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code class="language-cpp" data-lang="cpp">&lt;span class="line">&lt;span class="cl">&lt;span class="cp">#include&lt;/span> &lt;span class="cpf">&amp;lt;windows.h&amp;gt;&lt;/span>&lt;span class="cp">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="cp">#include&lt;/span> &lt;span class="cpf">&amp;lt;winrt/Windows.AI.MachineLearning.h&amp;gt;&lt;/span>&lt;span class="cp">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="cp">#include&lt;/span> &lt;span class="cpf">&amp;lt;winrt/Windows.Storage.h&amp;gt;&lt;/span>&lt;span class="cp">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="cp">&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="cp">#pragma comment(lib, &amp;#34;windowsapp&amp;#34;) &lt;/span>&lt;span class="c1">// For WinRT linking
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="k">using&lt;/span> &lt;span class="k">namespace&lt;/span> &lt;span class="n">winrt&lt;/span>&lt;span class="p">;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="k">using&lt;/span> &lt;span class="k">namespace&lt;/span> &lt;span class="n">Windows&lt;/span>&lt;span class="o">::&lt;/span>&lt;span class="n">AI&lt;/span>&lt;span class="o">::&lt;/span>&lt;span class="n">MachineLearning&lt;/span>&lt;span class="p">;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="k">using&lt;/span> &lt;span class="k">namespace&lt;/span> &lt;span class="n">Windows&lt;/span>&lt;span class="o">::&lt;/span>&lt;span class="n">Storage&lt;/span>&lt;span class="p">;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="kt">int&lt;/span> &lt;span class="n">WINAPI&lt;/span> &lt;span class="nf">WinMain&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">HINSTANCE&lt;/span> &lt;span class="n">hInstance&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="n">HINSTANCE&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="n">LPSTR&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="kt">int&lt;/span> &lt;span class="n">nCmdShow&lt;/span>&lt;span class="p">)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="p">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="c1">// Initialize WinRT (Either MTA or STA is fine)
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">&lt;/span> &lt;span class="n">winrt&lt;/span>&lt;span class="o">::&lt;/span>&lt;span class="n">init_apartment&lt;/span>&lt;span class="p">();&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="k">try&lt;/span> &lt;span class="p">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="c1">// Load the model file
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">&lt;/span> &lt;span class="k">auto&lt;/span> &lt;span class="n">modelFile&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="n">StorageFile&lt;/span>&lt;span class="o">::&lt;/span>&lt;span class="n">GetFileFromPathAsync&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="sa">L&lt;/span>&lt;span class="s">&amp;#34;model.onnx&amp;#34;&lt;/span>&lt;span class="p">).&lt;/span>&lt;span class="n">get&lt;/span>&lt;span class="p">();&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="n">LearningModel&lt;/span> &lt;span class="n">model&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="n">LearningModel&lt;/span>&lt;span class="o">::&lt;/span>&lt;span class="n">LoadFromStorageFileAsync&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">modelFile&lt;/span>&lt;span class="p">).&lt;/span>&lt;span class="n">get&lt;/span>&lt;span class="p">();&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="c1">// Create a session
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">&lt;/span> &lt;span class="n">LearningModelSession&lt;/span> &lt;span class="n">session&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">model&lt;/span>&lt;span class="p">);&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="n">LearningModelBinding&lt;/span> &lt;span class="n">binding&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">session&lt;/span>&lt;span class="p">);&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="c1">// Model input/output (Here, a temporary empty input)
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">&lt;/span> &lt;span class="c1">// In practice, binding with TensorFloat etc. is required
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="c1">// Execute inference
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">&lt;/span> &lt;span class="k">auto&lt;/span> &lt;span class="n">result&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="n">session&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="n">EvaluateAsync&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">binding&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="sa">L&lt;/span>&lt;span class="s">&amp;#34;&amp;#34;&lt;/span>&lt;span class="p">).&lt;/span>&lt;span class="n">get&lt;/span>&lt;span class="p">();&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="n">MessageBox&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="k">nullptr&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="sa">L&lt;/span>&lt;span class="s">&amp;#34;Inference completed&amp;#34;&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="sa">L&lt;/span>&lt;span class="s">&amp;#34;Windows ML (C++)&amp;#34;&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="n">MB_OK&lt;/span>&lt;span class="p">);&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="p">}&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="k">catch&lt;/span> &lt;span class="p">(&lt;/span>&lt;span class="n">winrt&lt;/span>&lt;span class="o">::&lt;/span>&lt;span class="n">hresult_error&lt;/span> &lt;span class="k">const&lt;/span>&lt;span class="o">&amp;amp;&lt;/span> &lt;span class="n">ex&lt;/span>&lt;span class="p">)&lt;/span> &lt;span class="p">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="n">MessageBox&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="k">nullptr&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="n">ex&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="n">message&lt;/span>&lt;span class="p">().&lt;/span>&lt;span class="n">c_str&lt;/span>&lt;span class="p">(),&lt;/span> &lt;span class="sa">L&lt;/span>&lt;span class="s">&amp;#34;Error&amp;#34;&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="n">MB_ICONERROR&lt;/span>&lt;span class="p">);&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="p">}&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="k">return&lt;/span> &lt;span class="mi">0&lt;/span>&lt;span class="p">;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="p">}&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/td>&lt;/tr>&lt;/table>
&lt;/div>
&lt;/div>&lt;hr>
&lt;h2 id="-supplement-how-to-specify-inputoutput-tensors">✅ Supplement: How to Specify Input/Output Tensors
&lt;/h2>&lt;p>Depending on the model, it is necessary to &lt;strong>create and bind Tensors&lt;/strong> before inference.&lt;/p>
&lt;p>Example:&lt;/p>
&lt;div class="highlight">&lt;div class="chroma">
&lt;table class="lntable">&lt;tr>&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code>&lt;span class="lnt">1
&lt;/span>&lt;span class="lnt">2
&lt;/span>&lt;span class="lnt">3
&lt;/span>&lt;span class="lnt">4
&lt;/span>&lt;span class="lnt">5
&lt;/span>&lt;span class="lnt">6
&lt;/span>&lt;span class="lnt">7
&lt;/span>&lt;span class="lnt">8
&lt;/span>&lt;/code>&lt;/pre>&lt;/td>
&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code class="language-cpp" data-lang="cpp">&lt;span class="line">&lt;span class="cl">&lt;span class="c1">// Convert a 1D float array to a Tensor
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">&lt;/span>&lt;span class="n">std&lt;/span>&lt;span class="o">::&lt;/span>&lt;span class="n">vector&lt;/span>&lt;span class="o">&amp;lt;&lt;/span>&lt;span class="kt">float&lt;/span>&lt;span class="o">&amp;gt;&lt;/span> &lt;span class="n">inputData&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="p">{&lt;/span>&lt;span class="mf">0.5f&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="mf">0.3f&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="mf">0.2f&lt;/span>&lt;span class="p">};&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="n">std&lt;/span>&lt;span class="o">::&lt;/span>&lt;span class="n">vector&lt;/span>&lt;span class="o">&amp;lt;&lt;/span>&lt;span class="kt">int64_t&lt;/span>&lt;span class="o">&amp;gt;&lt;/span> &lt;span class="n">shape&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="p">{&lt;/span>&lt;span class="mi">1&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="mi">3&lt;/span>&lt;span class="p">};&lt;/span> &lt;span class="c1">// Shape: [1, 3]
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="k">auto&lt;/span> &lt;span class="n">tensor&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="n">TensorFloat&lt;/span>&lt;span class="o">::&lt;/span>&lt;span class="n">CreateFromArray&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">shape&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="n">inputData&lt;/span>&lt;span class="p">);&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">// Input binding (Match the model&amp;#39;s input name)
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">&lt;/span>&lt;span class="n">binding&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="n">Bind&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="sa">L&lt;/span>&lt;span class="s">&amp;#34;input_0&amp;#34;&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="n">tensor&lt;/span>&lt;span class="p">);&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/td>&lt;/tr>&lt;/table>
&lt;/div>
&lt;/div>&lt;p>Outputs can be obtained similarly using &lt;code>result.Outputs().Lookup(L&amp;quot;output_0&amp;quot;)&lt;/code>.&lt;/p>
&lt;hr>
&lt;h2 id="-debugging-tips">✅ Debugging Tips
&lt;/h2>&lt;ul>
&lt;li>A &lt;code>FileNotFoundException&lt;/code> will be thrown if the model file is not in the execution folder.&lt;/li>
&lt;li>An &lt;code>invalid_argument&lt;/code> error will occur if the input/output names do not match.&lt;/li>
&lt;li>The exact I/O specifications of the model can be confirmed with tools like &lt;a class="link" href="https://netron.app" target="_blank" rel="noopener"
>Netron&lt;/a>.&lt;/li>
&lt;/ul>
&lt;hr>
&lt;h2 id="-summary">✅ Summary
&lt;/h2>&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Item&lt;/th>
&lt;th>Details&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>API Used&lt;/td>
&lt;td>Windows.AI.MachineLearning (WinRT)&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Language&lt;/td>
&lt;td>C++ (Win32 based)&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Recommended Method&lt;/td>
&lt;td>Via C++/WinRT headers&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Advantages&lt;/td>
&lt;td>ONNX models run natively, GPU support available&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Caution&lt;/td>
&lt;td>Pay attention to model input names and Tensor shapes&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;hr>
&lt;h2 id="-alternatives-for-those-who-do-not-want-to-use-winrt">✅ Alternatives: For those who do not want to use WinRT
&lt;/h2>&lt;ul>
&lt;li>By using Microsoft&amp;rsquo;s &lt;code>ONNX Runtime&lt;/code>, &lt;strong>you can handle ONNX models from C++ entirely without WinRT&lt;/strong>.&lt;/li>
&lt;li>It supports cross-platform, allowing common code for Windows/Linux.&lt;/li>
&lt;/ul>
&lt;hr>
&lt;h2 id="-conclusion">📌 Conclusion
&lt;/h2>&lt;p>Windows ML (Microsoft.Windows.AI) is a powerful AI inference engine that can be robustly used even from C++. If you need native inference on Windows, please give it a try.&lt;/p>
&lt;p>For those who want specific examples of creating ONNX models and Tensor binding, we plan to explain them in a follow-up article!&lt;/p></description></item><item><title>How to Post Messages to Microsoft Teams from C++ (WinHTTP + Graph API)</title><link>http://kenji.blog/en/p/c-%E3%81%8B%E3%82%89-microsoft-teams-%E3%81%AB%E3%83%A1%E3%83%83%E3%82%BB%E3%83%BC%E3%82%B8%E3%82%92%E6%8A%95%E7%A8%BF%E3%81%99%E3%82%8B%E6%96%B9%E6%B3%95winhttp--graph-api/</link><pubDate>Mon, 14 Jul 2025 23:40:15 +0900</pubDate><guid>http://kenji.blog/en/p/c-%E3%81%8B%E3%82%89-microsoft-teams-%E3%81%AB%E3%83%A1%E3%83%83%E3%82%BB%E3%83%BC%E3%82%B8%E3%82%92%E6%8A%95%E7%A8%BF%E3%81%99%E3%82%8B%E6%96%B9%E6%B3%95winhttp--graph-api/</guid><description>&lt;img src="http://kenji.blog/p/c-%E3%81%8B%E3%82%89-microsoft-teams-%E3%81%AB%E3%83%A1%E3%83%83%E3%82%BB%E3%83%BC%E3%82%B8%E3%82%92%E6%8A%95%E7%A8%BF%E3%81%99%E3%82%8B%E6%96%B9%E6%B3%95winhttp--graph-api/img.png" alt="Featured image of post How to Post Messages to Microsoft Teams from C++ (WinHTTP + Graph API)" />&lt;h1 id="how-to-post-messages-to-microsoft-teams-from-c-winhttp--graph-api">How to Post Messages to Microsoft Teams from C++ (WinHTTP + Graph API)
&lt;/h1>&lt;p>I want to automatically post to a Microsoft Teams chat &amp;ndash;&lt;br>
&lt;strong>Microsoft Graph API&lt;/strong> is exactly what you can use in such cases.&lt;br>
In this article, I will introduce a &lt;strong>C++ code example using WinHTTP ** and the ** necessary API authentication steps&lt;/strong> step by step.&lt;/p>
&lt;hr>
&lt;h2 id="-necessary-preparations-microsoft-graph-api-authentication-settings">🔧 Necessary Preparations (Microsoft Graph API Authentication Settings)
&lt;/h2>&lt;h3 id="1-register-app-in-azure-portal">1. Register App in Azure Portal
&lt;/h3>&lt;p>First, to use the Microsoft Graph API, you need to register an app in Azure.&lt;/p>
&lt;ol>
&lt;li>Access the &lt;a class="link" href="https://portal.azure.com" target="_blank" rel="noopener"
>Azure Portal&lt;/a>&lt;/li>
&lt;li>&amp;ldquo;&lt;strong>Microsoft Entra ID &lt;strong>&amp;rdquo; &amp;gt; &amp;ldquo;&lt;/strong>+ Add &lt;strong>&amp;rdquo; &amp;gt; &amp;ldquo;&lt;/strong> App registrations &lt;strong>&amp;rdquo; &amp;gt; &amp;ldquo;&lt;/strong> New registration&lt;/strong>&amp;rdquo;&lt;/li>
&lt;li>Enter any app name and click &amp;ldquo;Register&amp;rdquo;&lt;/li>
&lt;/ol>
&lt;h3 id="2-add-api-permissions">2. Add API Permissions
&lt;/h3>&lt;ol>
&lt;li>Go to the &amp;ldquo;API permissions&amp;rdquo; left menu&lt;/li>
&lt;li>Under &amp;ldquo;&lt;strong>Microsoft Graph &lt;strong>&amp;rdquo; &amp;gt; &amp;ldquo;&lt;/strong> Add a permission &lt;strong>&amp;rdquo;, search for the following scopes and click &amp;ldquo;&lt;/strong> Update permissions&lt;/strong>&amp;rdquo;&lt;/li>
&lt;/ol>
&lt;ul>
&lt;li>Chat.ReadWrite&lt;/li>
&lt;li>User.Read&lt;/li>
&lt;/ul>
&lt;blockquote>
&lt;ul>
&lt;li>If you want to post to a channel, &lt;code>ChannelMessage.Send&lt;/code> is also required&lt;/li>
&lt;/ul>
&lt;/blockquote>
&lt;h3 id="3-note-client-id-and-tenant-id">3. Note Client ID and Tenant ID
&lt;/h3>&lt;p>Make a note of the following two items displayed on the &amp;ldquo;Overview&amp;rdquo; tab:&lt;/p>
&lt;ul>
&lt;li>Application (client) ID&lt;/li>
&lt;li>Directory (tenant) ID&lt;/li>
&lt;/ul>
&lt;h3 id="4-create-client-secret">4. Create Client Secret
&lt;/h3>&lt;ol>
&lt;li>Go to the &amp;ldquo;Certificates &amp;amp; secrets&amp;rdquo; tab&lt;/li>
&lt;li>&amp;ldquo;New client secret&amp;rdquo; &amp;gt; set the expiration date, and click &amp;ldquo;Add&amp;rdquo;&lt;/li>
&lt;li>&lt;strong>Be sure to note ** the displayed value (secret) ** on the spot&lt;/strong>&lt;/li>
&lt;/ol>
&lt;hr>
&lt;h2 id="-obtaining-an-access-token-oauth2">🔐 Obtaining an Access Token (OAuth2)
&lt;/h2>&lt;p>Use the &lt;code>client_credentials&lt;/code> flow to obtain it.&lt;br>
Run the following command with curl to obtain an access token.&lt;/p>
&lt;div class="highlight">&lt;div class="chroma">
&lt;table class="lntable">&lt;tr>&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code>&lt;span class="lnt">1
&lt;/span>&lt;span class="lnt">2
&lt;/span>&lt;span class="lnt">3
&lt;/span>&lt;span class="lnt">4
&lt;/span>&lt;span class="lnt">5
&lt;/span>&lt;span class="lnt">6
&lt;/span>&lt;span class="lnt">7
&lt;/span>&lt;/code>&lt;/pre>&lt;/td>
&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code class="language-bash" data-lang="bash">&lt;span class="line">&lt;span class="cl">curl -X POST ^
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> https://login.microsoftonline.com/&lt;span class="o">{&lt;/span>tenant_id&lt;span class="o">}&lt;/span>/oauth2/v2.0/token ^
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> -H &lt;span class="s2">&amp;#34;Content-Type: application/x-www-form-urlencoded&amp;#34;&lt;/span> ^
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> -d &lt;span class="s2">&amp;#34;client_id={client_id}&amp;#34;&lt;/span> ^
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> -d &lt;span class="s2">&amp;#34;scope=https%3A%2F%2Fgraph.microsoft.com%2F.default&amp;#34;&lt;/span> ^
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> -d &lt;span class="s2">&amp;#34;client_secret={client_secret}&amp;#34;&lt;/span> ^
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> -d &lt;span class="s2">&amp;#34;grant_type=client_credentials&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/td>&lt;/tr>&lt;/table>
&lt;/div>
&lt;/div>&lt;h3 id="example-response">Example Response
&lt;/h3>&lt;div class="highlight">&lt;div class="chroma">
&lt;table class="lntable">&lt;tr>&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code>&lt;span class="lnt">1
&lt;/span>&lt;span class="lnt">2
&lt;/span>&lt;span class="lnt">3
&lt;/span>&lt;span class="lnt">4
&lt;/span>&lt;span class="lnt">5
&lt;/span>&lt;span class="lnt">6
&lt;/span>&lt;/code>&lt;/pre>&lt;/td>
&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code class="language-json" data-lang="json">&lt;span class="line">&lt;span class="cl">&lt;span class="p">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nt">&amp;#34;token_type&amp;#34;&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="s2">&amp;#34;Bearer&amp;#34;&lt;/span>&lt;span class="p">,&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nt">&amp;#34;expires_in&amp;#34;&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="mi">3599&lt;/span>&lt;span class="p">,&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nt">&amp;#34;ext_expires_in&amp;#34;&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="mi">3599&lt;/span>&lt;span class="p">,&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nt">&amp;#34;access_token&amp;#34;&lt;/span>&lt;span class="p">:&lt;/span> &lt;span class="s2">&amp;#34;eyJ0eXAiOiJKV1QiLCJub... (omitted)&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="p">}&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/td>&lt;/tr>&lt;/table>
&lt;/div>
&lt;/div>&lt;p>Call the Microsoft Graph API using this access_token.&lt;/p>
&lt;h2 id="-c-sample-for-posting-to-teams-chat">💬 C++ Sample for Posting to Teams Chat
&lt;/h2>&lt;p>Here is a C++ example of posting to a chat using WinHTTP.&lt;/p>
&lt;div class="highlight">&lt;div class="chroma">
&lt;table class="lntable">&lt;tr>&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code>&lt;span class="lnt"> 1
&lt;/span>&lt;span class="lnt"> 2
&lt;/span>&lt;span class="lnt"> 3
&lt;/span>&lt;span class="lnt"> 4
&lt;/span>&lt;span class="lnt"> 5
&lt;/span>&lt;span class="lnt"> 6
&lt;/span>&lt;span class="lnt"> 7
&lt;/span>&lt;span class="lnt"> 8
&lt;/span>&lt;span class="lnt"> 9
&lt;/span>&lt;span class="lnt">10
&lt;/span>&lt;span class="lnt">11
&lt;/span>&lt;span class="lnt">12
&lt;/span>&lt;span class="lnt">13
&lt;/span>&lt;span class="lnt">14
&lt;/span>&lt;span class="lnt">15
&lt;/span>&lt;span class="lnt">16
&lt;/span>&lt;span class="lnt">17
&lt;/span>&lt;span class="lnt">18
&lt;/span>&lt;span class="lnt">19
&lt;/span>&lt;span class="lnt">20
&lt;/span>&lt;span class="lnt">21
&lt;/span>&lt;span class="lnt">22
&lt;/span>&lt;span class="lnt">23
&lt;/span>&lt;span class="lnt">24
&lt;/span>&lt;span class="lnt">25
&lt;/span>&lt;span class="lnt">26
&lt;/span>&lt;span class="lnt">27
&lt;/span>&lt;span class="lnt">28
&lt;/span>&lt;span class="lnt">29
&lt;/span>&lt;span class="lnt">30
&lt;/span>&lt;span class="lnt">31
&lt;/span>&lt;span class="lnt">32
&lt;/span>&lt;span class="lnt">33
&lt;/span>&lt;span class="lnt">34
&lt;/span>&lt;span class="lnt">35
&lt;/span>&lt;span class="lnt">36
&lt;/span>&lt;span class="lnt">37
&lt;/span>&lt;span class="lnt">38
&lt;/span>&lt;span class="lnt">39
&lt;/span>&lt;span class="lnt">40
&lt;/span>&lt;span class="lnt">41
&lt;/span>&lt;span class="lnt">42
&lt;/span>&lt;span class="lnt">43
&lt;/span>&lt;span class="lnt">44
&lt;/span>&lt;span class="lnt">45
&lt;/span>&lt;span class="lnt">46
&lt;/span>&lt;span class="lnt">47
&lt;/span>&lt;span class="lnt">48
&lt;/span>&lt;span class="lnt">49
&lt;/span>&lt;span class="lnt">50
&lt;/span>&lt;span class="lnt">51
&lt;/span>&lt;span class="lnt">52
&lt;/span>&lt;span class="lnt">53
&lt;/span>&lt;span class="lnt">54
&lt;/span>&lt;/code>&lt;/pre>&lt;/td>
&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code class="language-cpp" data-lang="cpp">&lt;span class="line">&lt;span class="cl">&lt;span class="cp">#include&lt;/span> &lt;span class="cpf">&amp;lt;windows.h&amp;gt;&lt;/span>&lt;span class="cp">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="cp">#include&lt;/span> &lt;span class="cpf">&amp;lt;winhttp.h&amp;gt;&lt;/span>&lt;span class="cp">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="cp">#include&lt;/span> &lt;span class="cpf">&amp;lt;iostream&amp;gt;&lt;/span>&lt;span class="cp">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="cp">#include&lt;/span> &lt;span class="cpf">&amp;lt;string&amp;gt;&lt;/span>&lt;span class="cp">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="cp">&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="cp">#pragma comment(lib, &amp;#34;winhttp.lib&amp;#34;)
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="cp">&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="kt">void&lt;/span> &lt;span class="nf">PostToTeamsChat&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="k">const&lt;/span> &lt;span class="n">std&lt;/span>&lt;span class="o">::&lt;/span>&lt;span class="n">wstring&lt;/span>&lt;span class="o">&amp;amp;&lt;/span> &lt;span class="n">accessToken&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="k">const&lt;/span> &lt;span class="n">std&lt;/span>&lt;span class="o">::&lt;/span>&lt;span class="n">wstring&lt;/span>&lt;span class="o">&amp;amp;&lt;/span> &lt;span class="n">chatId&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="k">const&lt;/span> &lt;span class="n">std&lt;/span>&lt;span class="o">::&lt;/span>&lt;span class="n">wstring&lt;/span>&lt;span class="o">&amp;amp;&lt;/span> &lt;span class="n">message&lt;/span>&lt;span class="p">)&lt;/span> &lt;span class="p">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="n">HINTERNET&lt;/span> &lt;span class="n">hSession&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="n">WinHttpOpen&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="sa">L&lt;/span>&lt;span class="s">&amp;#34;TeamsPoster/1.0&amp;#34;&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="n">WINHTTP_ACCESS_TYPE_DEFAULT_PROXY&lt;/span>&lt;span class="p">,&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="n">WINHTTP_NO_PROXY_NAME&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="n">WINHTTP_NO_PROXY_BYPASS&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="mi">0&lt;/span>&lt;span class="p">);&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="n">HINTERNET&lt;/span> &lt;span class="n">hConnect&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="n">WinHttpConnect&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">hSession&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="sa">L&lt;/span>&lt;span class="s">&amp;#34;graph.microsoft.com&amp;#34;&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="n">INTERNET_DEFAULT_HTTPS_PORT&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="mi">0&lt;/span>&lt;span class="p">);&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="n">std&lt;/span>&lt;span class="o">::&lt;/span>&lt;span class="n">wstring&lt;/span> &lt;span class="n">endpoint&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="sa">L&lt;/span>&lt;span class="s">&amp;#34;/v1.0/chats/&amp;#34;&lt;/span> &lt;span class="o">+&lt;/span> &lt;span class="n">chatId&lt;/span> &lt;span class="o">+&lt;/span> &lt;span class="sa">L&lt;/span>&lt;span class="s">&amp;#34;/messages&amp;#34;&lt;/span>&lt;span class="p">;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="n">HINTERNET&lt;/span> &lt;span class="n">hRequest&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="n">WinHttpOpenRequest&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">hConnect&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="sa">L&lt;/span>&lt;span class="s">&amp;#34;POST&amp;#34;&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="n">endpoint&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="n">c_str&lt;/span>&lt;span class="p">(),&lt;/span> &lt;span class="nb">NULL&lt;/span>&lt;span class="p">,&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="n">WINHTTP_NO_REFERER&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="n">WINHTTP_DEFAULT_ACCEPT_TYPES&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="n">WINHTTP_FLAG_SECURE&lt;/span>&lt;span class="p">);&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="n">std&lt;/span>&lt;span class="o">::&lt;/span>&lt;span class="n">wstring&lt;/span> &lt;span class="n">jsonBody&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="sa">L&lt;/span>&lt;span class="s">&amp;#34;{&lt;/span>&lt;span class="se">\&amp;#34;&lt;/span>&lt;span class="s">body&lt;/span>&lt;span class="se">\&amp;#34;&lt;/span>&lt;span class="s">: {&lt;/span>&lt;span class="se">\&amp;#34;&lt;/span>&lt;span class="s">content&lt;/span>&lt;span class="se">\&amp;#34;&lt;/span>&lt;span class="s">: &lt;/span>&lt;span class="se">\&amp;#34;&lt;/span>&lt;span class="s">&amp;#34;&lt;/span> &lt;span class="o">+&lt;/span> &lt;span class="n">message&lt;/span> &lt;span class="o">+&lt;/span> &lt;span class="sa">L&lt;/span>&lt;span class="s">&amp;#34;&lt;/span>&lt;span class="se">\&amp;#34;&lt;/span>&lt;span class="s">}}&amp;#34;&lt;/span>&lt;span class="p">;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="n">std&lt;/span>&lt;span class="o">::&lt;/span>&lt;span class="n">wstring&lt;/span> &lt;span class="n">headers&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="sa">L&lt;/span>&lt;span class="s">&amp;#34;Authorization: Bearer &amp;#34;&lt;/span> &lt;span class="o">+&lt;/span> &lt;span class="n">accessToken&lt;/span> &lt;span class="o">+&lt;/span> &lt;span class="sa">L&lt;/span>&lt;span class="s">&amp;#34;&lt;/span>&lt;span class="se">\r\n&lt;/span>&lt;span class="s">Content-Type: application/json&lt;/span>&lt;span class="se">\r\n&lt;/span>&lt;span class="s">&amp;#34;&lt;/span>&lt;span class="p">;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="n">BOOL&lt;/span> &lt;span class="n">bResult&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="n">WinHttpSendRequest&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">hRequest&lt;/span>&lt;span class="p">,&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="n">headers&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="n">c_str&lt;/span>&lt;span class="p">(),&lt;/span> &lt;span class="p">(&lt;/span>&lt;span class="n">DWORD&lt;/span>&lt;span class="p">)&lt;/span>&lt;span class="o">-&lt;/span>&lt;span class="mi">1L&lt;/span>&lt;span class="p">,&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="p">(&lt;/span>&lt;span class="n">LPVOID&lt;/span>&lt;span class="p">)&lt;/span>&lt;span class="n">jsonBody&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="n">c_str&lt;/span>&lt;span class="p">(),&lt;/span> &lt;span class="p">(&lt;/span>&lt;span class="n">DWORD&lt;/span>&lt;span class="p">)(&lt;/span>&lt;span class="n">jsonBody&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="n">length&lt;/span>&lt;span class="p">()&lt;/span> &lt;span class="o">*&lt;/span> &lt;span class="k">sizeof&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="kt">wchar_t&lt;/span>&lt;span class="p">)),&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="p">(&lt;/span>&lt;span class="n">DWORD&lt;/span>&lt;span class="p">)(&lt;/span>&lt;span class="n">jsonBody&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="n">length&lt;/span>&lt;span class="p">()&lt;/span> &lt;span class="o">*&lt;/span> &lt;span class="k">sizeof&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="kt">wchar_t&lt;/span>&lt;span class="p">)),&lt;/span> &lt;span class="mi">0&lt;/span>&lt;span class="p">);&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="k">if&lt;/span> &lt;span class="p">(&lt;/span>&lt;span class="n">bResult&lt;/span>&lt;span class="p">)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="n">WinHttpReceiveResponse&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">hRequest&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="nb">NULL&lt;/span>&lt;span class="p">);&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="n">DWORD&lt;/span> &lt;span class="n">dwSize&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="mi">0&lt;/span>&lt;span class="p">;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="n">WinHttpQueryDataAvailable&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">hRequest&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="o">&amp;amp;&lt;/span>&lt;span class="n">dwSize&lt;/span>&lt;span class="p">);&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="k">if&lt;/span> &lt;span class="p">(&lt;/span>&lt;span class="n">dwSize&lt;/span> &lt;span class="o">&amp;gt;&lt;/span> &lt;span class="mi">0&lt;/span>&lt;span class="p">)&lt;/span> &lt;span class="p">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="n">std&lt;/span>&lt;span class="o">::&lt;/span>&lt;span class="n">wstring&lt;/span> &lt;span class="n">response&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">dwSize&lt;/span> &lt;span class="o">/&lt;/span> &lt;span class="k">sizeof&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="kt">wchar_t&lt;/span>&lt;span class="p">),&lt;/span> &lt;span class="mi">0&lt;/span>&lt;span class="p">);&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="n">DWORD&lt;/span> &lt;span class="n">dwDownloaded&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="mi">0&lt;/span>&lt;span class="p">;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="n">WinHttpReadData&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">hRequest&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="o">&amp;amp;&lt;/span>&lt;span class="n">response&lt;/span>&lt;span class="p">[&lt;/span>&lt;span class="mi">0&lt;/span>&lt;span class="p">],&lt;/span> &lt;span class="n">dwSize&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="o">&amp;amp;&lt;/span>&lt;span class="n">dwDownloaded&lt;/span>&lt;span class="p">);&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="n">std&lt;/span>&lt;span class="o">::&lt;/span>&lt;span class="n">wcout&lt;/span> &lt;span class="o">&amp;lt;&amp;lt;&lt;/span> &lt;span class="sa">L&lt;/span>&lt;span class="s">&amp;#34;Response: &amp;#34;&lt;/span> &lt;span class="o">&amp;lt;&amp;lt;&lt;/span> &lt;span class="n">response&lt;/span> &lt;span class="o">&amp;lt;&amp;lt;&lt;/span> &lt;span class="n">std&lt;/span>&lt;span class="o">::&lt;/span>&lt;span class="n">endl&lt;/span>&lt;span class="p">;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="p">}&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="n">WinHttpCloseHandle&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">hRequest&lt;/span>&lt;span class="p">);&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="n">WinHttpCloseHandle&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">hConnect&lt;/span>&lt;span class="p">);&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="n">WinHttpCloseHandle&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">hSession&lt;/span>&lt;span class="p">);&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="p">}&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="kt">int&lt;/span> &lt;span class="nf">main&lt;/span>&lt;span class="p">()&lt;/span> &lt;span class="p">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="n">std&lt;/span>&lt;span class="o">::&lt;/span>&lt;span class="n">wstring&lt;/span> &lt;span class="n">access&lt;/span>&lt;span class="p">;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="n">std&lt;/span>&lt;span class="o">::&lt;/span>&lt;span class="n">wstring&lt;/span> &lt;span class="n">chatId&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="sa">L&lt;/span>&lt;span class="s">&amp;#34;19:&amp;#34;&lt;/span>&lt;span class="p">;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="n">std&lt;/span>&lt;span class="o">::&lt;/span>&lt;span class="n">wstring&lt;/span> &lt;span class="n">message&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="sa">L&lt;/span>&lt;span class="s">&amp;#34;Hello from C++!&amp;#34;&lt;/span>&lt;span class="p">;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="n">std&lt;/span>&lt;span class="o">::&lt;/span>&lt;span class="n">wcout&lt;/span> &lt;span class="o">&amp;lt;&amp;lt;&lt;/span> &lt;span class="sa">L&lt;/span>&lt;span class="s">&amp;#34;Enter your access token: &amp;#34;&lt;/span>&lt;span class="p">;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="n">std&lt;/span>&lt;span class="o">::&lt;/span>&lt;span class="n">getline&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">std&lt;/span>&lt;span class="o">::&lt;/span>&lt;span class="n">wcin&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="n">access&lt;/span>&lt;span class="p">);&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="n">std&lt;/span>&lt;span class="o">::&lt;/span>&lt;span class="n">wcout&lt;/span> &lt;span class="o">&amp;lt;&amp;lt;&lt;/span> &lt;span class="sa">L&lt;/span>&lt;span class="s">&amp;#34;Enter chat ID: &amp;#34;&lt;/span>&lt;span class="p">;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="n">std&lt;/span>&lt;span class="o">::&lt;/span>&lt;span class="n">getline&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">std&lt;/span>&lt;span class="o">::&lt;/span>&lt;span class="n">wcin&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="n">chatId&lt;/span>&lt;span class="p">);&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="n">PostToTeamsChat&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">access&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="n">chatId&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="n">message&lt;/span>&lt;span class="p">);&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="k">return&lt;/span> &lt;span class="mi">0&lt;/span>&lt;span class="p">;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="p">}&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/td>&lt;/tr>&lt;/table>
&lt;/div>
&lt;/div>&lt;h2 id="-how-to-get-chat-id">🔍 How to Get Chat ID
&lt;/h2>&lt;p>You can check the Chat ID with GET /v1.0/me/chats.&lt;/p>
&lt;div class="highlight">&lt;div class="chroma">
&lt;table class="lntable">&lt;tr>&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code>&lt;span class="lnt">1
&lt;/span>&lt;span class="lnt">2
&lt;/span>&lt;span class="lnt">3
&lt;/span>&lt;span class="lnt">4
&lt;/span>&lt;/code>&lt;/pre>&lt;/td>
&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code class="language-fallback" data-lang="fallback">&lt;span class="line">&lt;span class="cl">curl -X GET ^
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> https://graph.microsoft.com/v1.0/me/chats ^
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> -H &amp;#34;Authorization: Bearer {access_token}&amp;#34; ^
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> -H &amp;#34;Content-Type: application/json&amp;#34;
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/td>&lt;/tr>&lt;/table>
&lt;/div>
&lt;/div>&lt;h3 id="example-response-1">Example Response
&lt;/h3>&lt;div class="highlight">&lt;div class="chroma">
&lt;table class="lntable">&lt;tr>&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code>&lt;span class="lnt">1
&lt;/span>&lt;span class="lnt">2
&lt;/span>&lt;span class="lnt">3
&lt;/span>&lt;span class="lnt">4
&lt;/span>&lt;span class="lnt">5
&lt;/span>&lt;span class="lnt">6
&lt;/span>&lt;span class="lnt">7
&lt;/span>&lt;span class="lnt">8
&lt;/span>&lt;span class="lnt">9
&lt;/span>&lt;/code>&lt;/pre>&lt;/td>
&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code class="language-json" data-lang="json">&lt;span class="line">&lt;span class="cl">&lt;span class="p">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nt">&amp;#34;value&amp;#34;&lt;/span>&lt;span class="p">:&lt;/span> &lt;span class="p">[&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="p">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nt">&amp;#34;id&amp;#34;&lt;/span>&lt;span class="p">:&lt;/span> &lt;span class="s2">&amp;#34;19:abc123xyz@thread.v2&amp;#34;&lt;/span>&lt;span class="p">,&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nt">&amp;#34;topic&amp;#34;&lt;/span>&lt;span class="p">:&lt;/span> &lt;span class="kc">null&lt;/span>&lt;span class="p">,&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nt">&amp;#34;chatType&amp;#34;&lt;/span>&lt;span class="p">:&lt;/span> &lt;span class="s2">&amp;#34;oneOnOne&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="p">}&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="p">]&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="p">}&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/td>&lt;/tr>&lt;/table>
&lt;/div>
&lt;/div>&lt;h2 id="-points-to-note">📌 Points to Note
&lt;/h2>&lt;ul>
&lt;li>This sample is a minimal implementation. In actual operation:
&lt;ul>
&lt;li>Token expiration handling&lt;/li>
&lt;li>HTTPS certificate validation&lt;/li>
&lt;li>Enhanced error handling&lt;/li>
&lt;/ul>
&lt;/li>
&lt;li>For channel posting, use teams/{team-id}/channels/{channel-id}/messages.&lt;/li>
&lt;li>Sending attachments requires multipart processing or the Graph Drive API.&lt;/li>
&lt;/ul>
&lt;h2 id="summary">Summary
&lt;/h2>&lt;h2 id="-summary">📎 Summary
&lt;/h2>&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Feature&lt;/th>
&lt;th>Overview&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>Graph API&lt;/td>
&lt;td>Official API to interact with Teams&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>App Registration&lt;/td>
&lt;td>Required authentication procedures on Azure&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Access Token&lt;/td>
&lt;td>Obtained via OAuth2, used for requests&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>C++ Implementation&lt;/td>
&lt;td>Call Graph API using WinHTTP&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;h2 id="-next-steps">🚀 Next Steps
&lt;/h2>&lt;p>As more advanced samples, the following are also possible:&lt;/p>
&lt;ul>
&lt;li>Team channel posting (&lt;code>/teams/{team-id}/channels/...&lt;/code>)&lt;/li>
&lt;li>Posting with attachments&lt;/li>
&lt;li>Switching between bot accounts and user accounts&lt;/li>
&lt;li>Full C++ implementation including token acquisition&lt;/li>
&lt;/ul>
&lt;p>If you have any requests, please feel free to comment!&lt;/p></description></item><item><title>Recommended Visual Studio Code Extensions</title><link>http://kenji.blog/en/p/visual-studio-code%E3%81%8A%E3%81%99%E3%81%99%E3%82%81%E6%8B%A1%E5%BC%B5%E6%A9%9F%E8%83%BD/</link><pubDate>Wed, 29 May 2024 17:20:19 +0900</pubDate><guid>http://kenji.blog/en/p/visual-studio-code%E3%81%8A%E3%81%99%E3%81%99%E3%82%81%E6%8B%A1%E5%BC%B5%E6%A9%9F%E8%83%BD/</guid><description>&lt;img src="http://kenji.blog/p/visual-studio-code%E3%81%8A%E3%81%99%E3%81%99%E3%82%81%E6%8B%A1%E5%BC%B5%E6%A9%9F%E8%83%BD/img.png" alt="Featured image of post Recommended Visual Studio Code Extensions" />&lt;h1 id="visual-studio-code-recommended-extensions-list">Visual Studio Code Recommended Extensions List
&lt;/h1>&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Category&lt;/th>
&lt;th>Name&lt;/th>
&lt;th>Publisher&lt;/th>
&lt;th>Description&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>Virtual / Container Management&lt;/td>
&lt;td>Remote Development&lt;/td>
&lt;td>Microsoft&lt;/td>
&lt;td>Supports remote development by connecting to virtual containers / WSL via SSH&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Virtual / Container Management&lt;/td>
&lt;td>Docker&lt;/td>
&lt;td>Microsoft&lt;/td>
&lt;td>Supports management of Docker containers&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Code Management&lt;/td>
&lt;td>GitHub Pull Requests&lt;/td>
&lt;td>GitHub&lt;/td>
&lt;td>Manage GitHub Pull Requests within VSCode&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Code Management&lt;/td>
&lt;td>GitHub Copilot&lt;/td>
&lt;td>GitHub&lt;/td>
&lt;td>Supports AI-based code completion&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Code Management&lt;/td>
&lt;td>Git Graph&lt;/td>
&lt;td>mhutchie&lt;/td>
&lt;td>Graphically displays Git branches and commits&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Code Management&lt;/td>
&lt;td>Git History&lt;/td>
&lt;td>Don Jayamanne&lt;/td>
&lt;td>Displays Git history&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Browser / Web Development&lt;/td>
&lt;td>Debugger for Firefox&lt;/td>
&lt;td>Firefox DevTools&lt;/td>
&lt;td>Use Firefox&amp;rsquo;s debugger within VSCode&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Browser / Web Development&lt;/td>
&lt;td>Microsoft Edge Tools for VS Code&lt;/td>
&lt;td>Microsoft&lt;/td>
&lt;td>Use Edge&amp;rsquo;s developer tools within VSCode&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Browser / Web Development&lt;/td>
&lt;td>Vue Language Features (Volar)&lt;/td>
&lt;td>Vue&lt;/td>
&lt;td>Supports Vue language features&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Browser / Web Development&lt;/td>
&lt;td>JavaScript (ES6) code snippets&lt;/td>
&lt;td>charalampos karypidis&lt;/td>
&lt;td>Provides JavaScript snippets&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Browser / Web Development&lt;/td>
&lt;td>Tailwind CSS IntelliSense&lt;/td>
&lt;td>Tailwind Labs&lt;/td>
&lt;td>Provides Tailwind CSS snippets&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Cloud Development&lt;/td>
&lt;td>AWS Toolkit&lt;/td>
&lt;td>Amazon Web Services&lt;/td>
&lt;td>Supports AWS development&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Cloud Development&lt;/td>
&lt;td>Azure Tools&lt;/td>
&lt;td>Microsoft&lt;/td>
&lt;td>Supports Azure development&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Cloud Development&lt;/td>
&lt;td>Google Cloud Tools&lt;/td>
&lt;td>Google Cloud&lt;/td>
&lt;td>Supports Google Cloud development&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Database&lt;/td>
&lt;td>MySQL&lt;/td>
&lt;td>Jun Han&lt;/td>
&lt;td>Supports MySQL development&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Database&lt;/td>
&lt;td>SQL Server (mssql)&lt;/td>
&lt;td>Microsoft&lt;/td>
&lt;td>Supports SQL Server development&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Database&lt;/td>
&lt;td>PostgreSQL&lt;/td>
&lt;td>Chris Kolkman&lt;/td>
&lt;td>Supports PostgreSQL development&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Embedded&lt;/td>
&lt;td>PlatformIO&lt;/td>
&lt;td>PlatformIO&lt;/td>
&lt;td>Supports PlatformIO development&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Embedded&lt;/td>
&lt;td>Arduino&lt;/td>
&lt;td>Microsoft&lt;/td>
&lt;td>Supports Arduino development&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Embedded&lt;/td>
&lt;td>WorkBench&lt;/td>
&lt;td>Particle&lt;/td>
&lt;td>Particle&amp;rsquo;s development environment, supporting IoT development including firmware, libraries, and cloud integration&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>C/C++&lt;/td>
&lt;td>C/C++ Extension Pack&lt;/td>
&lt;td>Microsoft&lt;/td>
&lt;td>Supports C/C++ development&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>C/C++&lt;/td>
&lt;td>C/C++ Runner&lt;/td>
&lt;td>franneck94&lt;/td>
&lt;td>Runs C/C++ code (supports gcc, msvc, cuda nvcc compilers)&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>C/C++&lt;/td>
&lt;td>Cortex-Debug&lt;/td>
&lt;td>marus25&lt;/td>
&lt;td>Supports debugging of Cortex-A/R/M microcontrollers&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Python&lt;/td>
&lt;td>Python Extension Pack&lt;/td>
&lt;td>Microsoft&lt;/td>
&lt;td>Supports Python development&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Python&lt;/td>
&lt;td>Jupyter&lt;/td>
&lt;td>Microsoft&lt;/td>
&lt;td>Supports Jupyter Notebook development&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Utility / UI Extension&lt;/td>
&lt;td>Markdown All in One&lt;/td>
&lt;td>Yu Zhang&lt;/td>
&lt;td>Supports Markdown writing&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Utility / UI Extension&lt;/td>
&lt;td>Hex Editor&lt;/td>
&lt;td>Microsoft&lt;/td>
&lt;td>Edits binary files&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Utility / UI Extension&lt;/td>
&lt;td>vscode-pdf&lt;/td>
&lt;td>tomoki1207&lt;/td>
&lt;td>Displays PDF files&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Utility / UI Extension&lt;/td>
&lt;td>Rainbow CSV&lt;/td>
&lt;td>mechatroner&lt;/td>
&lt;td>Displays CSV files colorfully&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Utility / UI Extension&lt;/td>
&lt;td>Draw.io Integration&lt;/td>
&lt;td>Henning Dieterichs&lt;/td>
&lt;td>Use Draw.io within VSCode&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Utility / UI Extension&lt;/td>
&lt;td>Japanese Language Pack for Visual Studio Code&lt;/td>
&lt;td>Microsoft&lt;/td>
&lt;td>Japanese localization pack&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Utility / UI Extension&lt;/td>
&lt;td>Live Share&lt;/td>
&lt;td>Microsoft&lt;/td>
&lt;td>Supports real-time collaborative work&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table></description></item><item><title>Get only the latest of a git repository</title><link>http://kenji.blog/en/p/git%E3%83%AA%E3%83%9D%E3%82%B8%E3%83%88%E3%83%AA%E3%81%AE%E6%9C%80%E6%96%B0%E3%81%A0%E3%81%91%E5%8F%96%E5%BE%97%E3%81%99%E3%82%8B/</link><pubDate>Sat, 27 Apr 2024 02:54:12 +0900</pubDate><guid>http://kenji.blog/en/p/git%E3%83%AA%E3%83%9D%E3%82%B8%E3%83%88%E3%83%AA%E3%81%AE%E6%9C%80%E6%96%B0%E3%81%A0%E3%81%91%E5%8F%96%E5%BE%97%E3%81%99%E3%82%8B/</guid><description>&lt;img src="http://kenji.blog/p/git%E3%83%AA%E3%83%9D%E3%82%B8%E3%83%88%E3%83%AA%E3%81%AE%E6%9C%80%E6%96%B0%E3%81%A0%E3%81%91%E5%8F%96%E5%BE%97%E3%81%99%E3%82%8B/img.png" alt="Featured image of post Get only the latest of a git repository" />&lt;h1 id="get-only-the-latest-of-a-git-repository">Get only the latest of a git repository
&lt;/h1>&lt;p>You can get only the latest of a repository with the following command.
It is useful when you want to quickly fetch a repository to save disk space.&lt;/p>
&lt;div class="highlight">&lt;div class="chroma">
&lt;table class="lntable">&lt;tr>&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code>&lt;span class="lnt">1
&lt;/span>&lt;/code>&lt;/pre>&lt;/td>
&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code class="language-fallback" data-lang="fallback">&lt;span class="line">&lt;span class="cl">git clone --depth 1 &amp;lt;repository URL&amp;gt;
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/td>&lt;/tr>&lt;/table>
&lt;/div>
&lt;/div></description></item><item><title>Introduction to Vim</title><link>http://kenji.blog/en/p/vim%E5%85%A5%E9%96%80/</link><pubDate>Fri, 19 Apr 2024 22:06:34 +0900</pubDate><guid>http://kenji.blog/en/p/vim%E5%85%A5%E9%96%80/</guid><description>&lt;img src="http://kenji.blog/p/vim%E5%85%A5%E9%96%80/img.png" alt="Featured image of post Introduction to Vim" />&lt;p>&lt;img src="http://kenji.blog/p/vim%E5%85%A5%E9%96%80/img_1.png"
width="1920"
height="1080"
srcset="http://kenji.blog/p/vim%E5%85%A5%E9%96%80/img_1_hue190cb5546151f3c9f61d693ae541095_45716_480x0_resize_box_3.png 480w, http://kenji.blog/p/vim%E5%85%A5%E9%96%80/img_1_hue190cb5546151f3c9f61d693ae541095_45716_1024x0_resize_box_3.png 1024w"
loading="lazy"
alt="img_1.png"
class="gallery-image"
data-flex-grow="177"
data-flex-basis="426px"
>&lt;/p>
&lt;h1 id="introduction-to-vim">Introduction to Vim
&lt;/h1>&lt;h2 id="download-and-installation">Download and Installation
&lt;/h2>&lt;p>&lt;a class="link" href="https://www.vim.org/download.php" target="_blank" rel="noopener"
>https://www.vim.org/download.php&lt;/a>&lt;/p>
&lt;p>From the site above, download and install the appropriate module for your OS.&lt;/p>
&lt;p>For Windows, it is recommended to choose &lt;code>gvim_X.X.X_x64_signed.exe&lt;/code>.&lt;/p>
&lt;h2 id="how-to-start">How to Start
&lt;/h2>&lt;p>For Windows, you need to register the folder containing &lt;code>vim.exe&lt;/code> to the Path environment variable.&lt;/p>
&lt;p>How to start:&lt;/p>
&lt;div class="highlight">&lt;div class="chroma">
&lt;table class="lntable">&lt;tr>&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code>&lt;span class="lnt">1
&lt;/span>&lt;/code>&lt;/pre>&lt;/td>
&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code class="language-fallback" data-lang="fallback">&lt;span class="line">&lt;span class="cl">vim
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/td>&lt;/tr>&lt;/table>
&lt;/div>
&lt;/div>&lt;p>When specifying a file name to start:&lt;/p>
&lt;div class="highlight">&lt;div class="chroma">
&lt;table class="lntable">&lt;tr>&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code>&lt;span class="lnt">1
&lt;/span>&lt;/code>&lt;/pre>&lt;/td>
&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code class="language-fallback" data-lang="fallback">&lt;span class="line">&lt;span class="cl">vim filename.txt
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/td>&lt;/tr>&lt;/table>
&lt;/div>
&lt;/div>&lt;h2 id="how-to-exit">How to Exit
&lt;/h2>&lt;p>To exit, type &lt;code>:&lt;/code> (colon), then &lt;code>q&lt;/code>, and press Enter.&lt;/p>
&lt;div class="highlight">&lt;div class="chroma">
&lt;table class="lntable">&lt;tr>&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code>&lt;span class="lnt">1
&lt;/span>&lt;/code>&lt;/pre>&lt;/td>
&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code class="language-fallback" data-lang="fallback">&lt;span class="line">&lt;span class="cl">:q
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/td>&lt;/tr>&lt;/table>
&lt;/div>
&lt;/div>&lt;p>If you have modified the file, a message saying &lt;code>No write since last change (add ! to override)&lt;/code> will be displayed.
You can discard the changes and force quit.&lt;/p>
&lt;div class="highlight">&lt;div class="chroma">
&lt;table class="lntable">&lt;tr>&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code>&lt;span class="lnt">1
&lt;/span>&lt;/code>&lt;/pre>&lt;/td>
&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code class="language-fallback" data-lang="fallback">&lt;span class="line">&lt;span class="cl">:q!
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/td>&lt;/tr>&lt;/table>
&lt;/div>
&lt;/div>&lt;p>To save the file and exit:&lt;/p>
&lt;div class="highlight">&lt;div class="chroma">
&lt;table class="lntable">&lt;tr>&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code>&lt;span class="lnt">1
&lt;/span>&lt;/code>&lt;/pre>&lt;/td>
&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code class="language-fallback" data-lang="fallback">&lt;span class="line">&lt;span class="cl">:wq
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/td>&lt;/tr>&lt;/table>
&lt;/div>
&lt;/div>&lt;p>The following has the same meaning:&lt;/p>
&lt;div class="highlight">&lt;div class="chroma">
&lt;table class="lntable">&lt;tr>&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code>&lt;span class="lnt">1
&lt;/span>&lt;/code>&lt;/pre>&lt;/td>
&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code class="language-fallback" data-lang="fallback">&lt;span class="line">&lt;span class="cl">:x
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/td>&lt;/tr>&lt;/table>
&lt;/div>
&lt;/div>&lt;p>You can also exit by pressing &lt;code>z&lt;/code> twice while holding down &lt;code>Shift&lt;/code> (same as &lt;code>:wq&lt;/code>).&lt;/p>
&lt;h2 id="modes">Modes
&lt;/h2>&lt;p>Vim has a &lt;code>Command mode&lt;/code> and an &lt;code>Insert mode&lt;/code>. When you start Vim, it is in &lt;code>Command mode&lt;/code>. Pressing the &lt;code>i&lt;/code> key switches to &lt;code>Insert mode&lt;/code>.&lt;/p>
&lt;p>In &lt;code>Insert mode&lt;/code>, you can literally type text. To return from &lt;code>Insert mode&lt;/code> to &lt;code>Command mode&lt;/code>, press the &lt;code>ESC&lt;/code> key.&lt;/p>
&lt;p>This switching of input modes is a distinct characteristic of Vim.&lt;/p>
&lt;h2 id="cursor-movement-and-scrolling">Cursor Movement and Scrolling
&lt;/h2>&lt;p>Here is a summary of cursor movement and scrolling in &lt;code>Command mode&lt;/code>.&lt;/p>
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Key&lt;/th>
&lt;th>Description&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>&lt;code>h&lt;/code> (or &lt;code>Ctrl&lt;/code>+&lt;code>H&lt;/code>, &lt;code>BackSpace&lt;/code>, &lt;code>←&lt;/code>)&lt;/td>
&lt;td>Move left&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>j&lt;/code> (or &lt;code>Ctrl&lt;/code>+&lt;code>J&lt;/code>, &lt;code>Ctrl&lt;/code>+&lt;code>N&lt;/code>, &lt;code>↓&lt;/code>)&lt;/td>
&lt;td>Move down&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>k&lt;/code> (or &lt;code>Ctrl&lt;/code>+&lt;code>P&lt;/code>, &lt;code>↑&lt;/code>)&lt;/td>
&lt;td>Move up&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>l&lt;/code> (or &lt;code>Space&lt;/code>, &lt;code>→&lt;/code>)&lt;/td>
&lt;td>Move right&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>+&lt;/code> (or &lt;code>Enter&lt;/code>)&lt;/td>
&lt;td>Move to the beginning of the next line&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>-&lt;/code>&lt;/td>
&lt;td>Move to the beginning of the previous line&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>Ctrl&lt;/code>+&lt;code>B&lt;/code> (or &lt;code>PageUp&lt;/code>)&lt;/td>
&lt;td>Scroll up&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>Ctrl&lt;/code>+&lt;code>F&lt;/code> (or &lt;code>PageDown&lt;/code>)&lt;/td>
&lt;td>Scroll down&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>Ctrl&lt;/code>+&lt;code>U&lt;/code>&lt;/td>
&lt;td>Scroll half a screen up&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>Ctrl&lt;/code>+&lt;code>D&lt;/code>&lt;/td>
&lt;td>Scroll half a screen down&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>Ctrl&lt;/code>+&lt;code>Y&lt;/code>&lt;/td>
&lt;td>Scroll one line up&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>Ctrl&lt;/code>+&lt;code>E&lt;/code>&lt;/td>
&lt;td>Scroll one line down&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>z&lt;/code> &lt;code>Enter&lt;/code>&lt;/td>
&lt;td>Scroll cursor line to top of screen&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>z&lt;/code> &lt;code>.&lt;/code>&lt;/td>
&lt;td>Scroll cursor line to middle of screen&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>z&lt;/code> &lt;code>-&lt;/code>&lt;/td>
&lt;td>Scroll cursor line to bottom of screen&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>0&lt;/code> (or &lt;code>|&lt;/code>)&lt;/td>
&lt;td>Move cursor to the beginning of the line&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>$&lt;/code>&lt;/td>
&lt;td>Move cursor to the end of the line&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>^&lt;/code> (or &lt;code>_&lt;/code>)&lt;/td>
&lt;td>Move cursor to the first non-blank character of the line&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>G&lt;/code> (or &lt;code>:$&lt;/code>)&lt;/td>
&lt;td>Move cursor to the last line&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>:Line Number&lt;/code> &lt;code>Enter&lt;/code>&lt;/td>
&lt;td>Move to specified line&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;p>If you type a &lt;code>Number&lt;/code> followed by any of the above movement keys, it will move that many times.
(For example, typing &lt;code>3j&lt;/code> will move the cursor down 3 lines from the current position.)&lt;/p>
&lt;h2 id="other-commands">Other Commands
&lt;/h2>&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Key&lt;/th>
&lt;th>Description&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>&lt;code>Ctrl&lt;/code>+&lt;code>L&lt;/code>&lt;/td>
&lt;td>Redraw the screen&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>Ctrl&lt;/code>+&lt;code>G&lt;/code>&lt;/td>
&lt;td>Show file status, number of lines, cursor position, etc.&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table></description></item><item><title>Visual Studio Shortcut List</title><link>http://kenji.blog/en/p/visual-studio-%E3%82%B7%E3%83%A7%E3%83%BC%E3%83%88%E3%82%AB%E3%83%83%E3%83%88%E4%B8%80%E8%A6%A7/</link><pubDate>Sat, 06 Apr 2024 11:27:37 +0900</pubDate><guid>http://kenji.blog/en/p/visual-studio-%E3%82%B7%E3%83%A7%E3%83%BC%E3%83%88%E3%82%AB%E3%83%83%E3%83%88%E4%B8%80%E8%A6%A7/</guid><description>&lt;img src="http://kenji.blog/p/visual-studio-%E3%82%B7%E3%83%A7%E3%83%BC%E3%83%88%E3%82%AB%E3%83%83%E3%83%88%E4%B8%80%E8%A6%A7/img.png" alt="Featured image of post Visual Studio Shortcut List" />&lt;h1 id="visual-studio-shortcut-list">Visual Studio Shortcut List
&lt;/h1>&lt;p>I made a list of Visual Studio shortcuts that I personally use often.
By memorizing keyboard operations for Visual Studio shortcuts, you can perform development work efficiently. Please make use of them.&lt;/p>
&lt;ul>
&lt;li>Confirmed in Visual Studio 2022.&lt;/li>
&lt;/ul>
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Shortcut Key&lt;/th>
&lt;th>Description&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>&lt;code>F1&lt;/code>&lt;/td>
&lt;td>Show help for the selected word&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>F2&lt;/code>&lt;/td>
&lt;td>Jump to bookmark&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>Ctrl&lt;/code> + &lt;code>F2&lt;/code>&lt;/td>
&lt;td>Register bookmark&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>Ctrl&lt;/code> + &lt;code>Shif&lt;/code> + &lt;code>F2&lt;/code>&lt;/td>
&lt;td>Delete all bookmarks&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>F5&lt;/code>&lt;/td>
&lt;td>Build and run (Debug run)&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>Ctrl&lt;/code> + &lt;code>F5&lt;/code>&lt;/td>
&lt;td>Build and run (Run without debugging)&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>F7&lt;/code>&lt;/td>
&lt;td>Build&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>F9&lt;/code>&lt;/td>
&lt;td>Toggle breakpoint on the cursor line&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>Ctrl&lt;/code> + &lt;code>F9&lt;/code>&lt;/td>
&lt;td>Disable breakpoint on the cursor line&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>Shift&lt;/code> + &lt;code>Ctrl&lt;/code> + &lt;code>F9&lt;/code>&lt;/td>
&lt;td>Delete all breakpoints&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>F10&lt;/code>&lt;/td>
&lt;td>Step over&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>F11&lt;/code>&lt;/td>
&lt;td>Step into&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>F12&lt;/code>&lt;/td>
&lt;td>Go to definition&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>Ctrl&lt;/code> + &lt;code>D&lt;/code>&lt;/td>
&lt;td>Duplicate cursor line&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>Ctrl&lt;/code> + &lt;code>X&lt;/code>&lt;/td>
&lt;td>Cut the line (if there is no selection)&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>Ctrl&lt;/code> + &lt;code>Shift&lt;/code> + &lt;code>]&lt;/code>&lt;/td>
&lt;td>Select up to the matching brace of the cursor part&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>Alt&lt;/code> + &lt;code>Up/Down Arrow Keys&lt;/code>&lt;/td>
&lt;td>Move cursor line up or down&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>Alt&lt;/code> + &lt;code>Shift&lt;/code> + &lt;code>Arrow Keys&lt;/code>&lt;/td>
&lt;td>Multi-cursor / Box selection&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>Ctrl&lt;/code> + &lt;code>Tab&lt;/code>&lt;/td>
&lt;td>Switch source code / window display&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>Ctrl&lt;/code> + &lt;code>Shift&lt;/code> + &lt;code>V&lt;/code>&lt;/td>
&lt;td>Show clipboard history&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>Ctrl&lt;/code> + &lt;code>K&lt;/code>, &lt;code>Ctrl&lt;/code> + &lt;code>C&lt;/code>&lt;/td>
&lt;td>Comment out the cursor line&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>Ctrl&lt;/code> + &lt;code>K&lt;/code>, &lt;code>Ctrl&lt;/code> + &lt;code>U&lt;/code>&lt;/td>
&lt;td>Uncomment the cursor line&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>Ctrl&lt;/code> + &lt;code>G&lt;/code>&lt;/td>
&lt;td>Go to line&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>Ctrl&lt;/code> + &lt;code>F&lt;/code>&lt;/td>
&lt;td>Find&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>Ctrl&lt;/code> + &lt;code>Shift&lt;/code> + &lt;code>F&lt;/code>&lt;/td>
&lt;td>Find in files (Global search)&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>Ctrl&lt;/code> + &lt;code>H&lt;/code>&lt;/td>
&lt;td>Replace&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>Ctrl&lt;/code> + &lt;code>Shift&lt;/code> + &lt;code>F&lt;/code>&lt;/td>
&lt;td>Replace in files (Global replace)&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>Ctrl&lt;/code> + &lt;code>Tab&lt;/code>&lt;/td>
&lt;td>Switch source code / window display&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>Ctrl&lt;/code> + &lt;code>Space&lt;/code>&lt;/td>
&lt;td>Word completion&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>Ctrl&lt;/code> + &lt;code>Alt&lt;/code> + &lt;code>L&lt;/code>&lt;/td>
&lt;td>Open Solution Explorer window&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>Ctrl&lt;/code> + &lt;code>Shift&lt;/code> + &lt;code>E&lt;/code>&lt;/td>
&lt;td>Open Resource View window&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>Ctrl&lt;/code> + &lt;code>0&lt;/code>, &lt;code>Ctrl&lt;/code> + &lt;code>G&lt;/code>&lt;/td>
&lt;td>Open Git Commit window&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;h2 id="references">References
&lt;/h2>&lt;ul>
&lt;li>&lt;a class="link" href="https://learn.microsoft.com/en-us/visualstudio/ide/default-keyboard-shortcuts-in-visual-studio?view=vs-2022" target="_blank" rel="noopener"
>Keyboard shortcuts in Visual Studio&lt;/a>&lt;/li>
&lt;/ul>
&lt;p>&lt;img src="http://kenji.blog/p/visual-studio-%E3%82%B7%E3%83%A7%E3%83%BC%E3%83%88%E3%82%AB%E3%83%83%E3%83%88%E4%B8%80%E8%A6%A7/img_1.png"
width="1094"
height="823"
srcset="http://kenji.blog/p/visual-studio-%E3%82%B7%E3%83%A7%E3%83%BC%E3%83%88%E3%82%AB%E3%83%83%E3%83%88%E4%B8%80%E8%A6%A7/img_1_hu4eaca85d6437d1dd6b23efd21afacc82_582969_480x0_resize_box_3.png 480w, http://kenji.blog/p/visual-studio-%E3%82%B7%E3%83%A7%E3%83%BC%E3%83%88%E3%82%AB%E3%83%83%E3%83%88%E4%B8%80%E8%A6%A7/img_1_hu4eaca85d6437d1dd6b23efd21afacc82_582969_1024x0_resize_box_3.png 1024w"
loading="lazy"
alt="img_1.png"
class="gallery-image"
data-flex-grow="132"
data-flex-basis="319px"
>&lt;/p></description></item><item><title>Add Hidemaru Editor Grep to Explorer Right-Click Menu</title><link>http://kenji.blog/en/p/%E3%82%A8%E3%82%AF%E3%82%B9%E3%83%97%E3%83%AD%E3%83%BC%E3%83%A9%E3%83%BC%E3%81%AE%E5%8F%B3%E3%82%AF%E3%83%AA%E3%83%83%E3%82%AF%E3%83%A1%E3%83%8B%E3%83%A5%E3%83%BC%E3%81%AB%E7%A7%80%E4%B8%B8%E3%82%A8%E3%83%87%E3%82%A3%E3%82%BFgrep%E3%82%92%E8%BF%BD%E5%8A%A0%E3%81%99%E3%82%8B/</link><pubDate>Wed, 03 Apr 2024 00:00:46 +0900</pubDate><guid>http://kenji.blog/en/p/%E3%82%A8%E3%82%AF%E3%82%B9%E3%83%97%E3%83%AD%E3%83%BC%E3%83%A9%E3%83%BC%E3%81%AE%E5%8F%B3%E3%82%AF%E3%83%AA%E3%83%83%E3%82%AF%E3%83%A1%E3%83%8B%E3%83%A5%E3%83%BC%E3%81%AB%E7%A7%80%E4%B8%B8%E3%82%A8%E3%83%87%E3%82%A3%E3%82%BFgrep%E3%82%92%E8%BF%BD%E5%8A%A0%E3%81%99%E3%82%8B/</guid><description>&lt;img src="http://kenji.blog/p/%E3%82%A8%E3%82%AF%E3%82%B9%E3%83%97%E3%83%AD%E3%83%BC%E3%83%A9%E3%83%BC%E3%81%AE%E5%8F%B3%E3%82%AF%E3%83%AA%E3%83%83%E3%82%AF%E3%83%A1%E3%83%8B%E3%83%A5%E3%83%BC%E3%81%AB%E7%A7%80%E4%B8%B8%E3%82%A8%E3%83%87%E3%82%A3%E3%82%BFgrep%E3%82%92%E8%BF%BD%E5%8A%A0%E3%81%99%E3%82%8B/img.png" alt="Featured image of post Add Hidemaru Editor Grep to Explorer Right-Click Menu" />&lt;p>Here is how to add Hidemaru Editor&amp;rsquo;s grep to the right-click menu of Explorer in Windows 10/11.&lt;/p>
&lt;p>&lt;strong>※ The following steps involve modifying the registry, so please proceed at your own risk.&lt;/strong>&lt;/p>
&lt;h2 id="steps">Steps
&lt;/h2>&lt;ol>
&lt;li>Open the link below and save it to a folder of your choice.&lt;/li>
&lt;/ol>
&lt;p>&lt;a class="link" href="%e7%a7%80%e4%b8%b8%e3%83%ac%e3%82%b8%e3%82%b9%e3%83%88%e3%83%aa%e7%99%bb%e9%8c%b2.reg" >秀丸レジストリ登録.reg&lt;/a>&lt;/p>
&lt;ol start="2">
&lt;li>Double-click the &lt;code>秀丸レジストリ登録.reg&lt;/code> file to add it to the registry.&lt;/li>
&lt;/ol>
&lt;h2 id="references">References
&lt;/h2>&lt;ul>
&lt;li>&lt;a class="link" href="https://aimek-developer.blogspot.com/2019/02/grep.html" target="_blank" rel="noopener"
>Run Hidemaru grep from the folder&amp;rsquo;s right-click menu&lt;/a>&lt;/li>
&lt;/ul></description></item><item><title>How to install the text editor micro on Windows</title><link>http://kenji.blog/en/p/%E3%83%86%E3%82%AD%E3%82%B9%E3%83%88%E3%82%A8%E3%83%87%E3%82%A3%E3%82%BFmicro%E3%82%92windows%E3%81%AB%E3%82%A4%E3%83%B3%E3%82%B9%E3%83%88%E3%83%BC%E3%83%AB%E3%81%99%E3%82%8B%E6%96%B9%E6%B3%95/</link><pubDate>Sun, 31 Mar 2024 21:50:39 +0900</pubDate><guid>http://kenji.blog/en/p/%E3%83%86%E3%82%AD%E3%82%B9%E3%83%88%E3%82%A8%E3%83%87%E3%82%A3%E3%82%BFmicro%E3%82%92windows%E3%81%AB%E3%82%A4%E3%83%B3%E3%82%B9%E3%83%88%E3%83%BC%E3%83%AB%E3%81%99%E3%82%8B%E6%96%B9%E6%B3%95/</guid><description>&lt;img src="http://kenji.blog/p/%E3%83%86%E3%82%AD%E3%82%B9%E3%83%88%E3%82%A8%E3%83%87%E3%82%A3%E3%82%BFmicro%E3%82%92windows%E3%81%AB%E3%82%A4%E3%83%B3%E3%82%B9%E3%83%88%E3%83%BC%E3%83%AB%E3%81%99%E3%82%8B%E6%96%B9%E6%B3%95/img.png" alt="Featured image of post How to install the text editor micro on Windows" />&lt;h2 id="download-micro">Download micro
&lt;/h2>&lt;p>&lt;a class="link" href="https://github.com/zyedidia/micro/releases" target="_blank" rel="noopener"
>https://github.com/zyedidia/micro/releases&lt;/a>&lt;/p>
&lt;p>Open the link above, click &lt;code>Show all XX assets&lt;/code> (where X is a number), and download &lt;code>micro-X.X.XX-win64.zip&lt;/code> (where X is a number).
Unzip the zip file and place the files in a folder of your choice.&lt;/p>
&lt;h2 id="set-environment-variables">Set Environment Variables
&lt;/h2>&lt;p>To use &lt;code>micro.exe&lt;/code> from the command prompt, you need to set the environment variables.&lt;/p>
&lt;ol>
&lt;li>Press &lt;code>Win key&lt;/code> + &lt;code>R key&lt;/code>, type &lt;code>sysdm.cpl&lt;/code>, and press &lt;code>Enter&lt;/code>.&lt;/li>
&lt;li>Click &lt;code>System Properties&lt;/code> in &lt;code>System Properties&lt;/code>.&lt;/li>
&lt;li>Click &lt;code>Environment Variables&lt;/code>.&lt;/li>
&lt;li>Select &lt;code>Path&lt;/code> under &lt;code>System variables&lt;/code> and click &lt;code>Edit&lt;/code>.&lt;/li>
&lt;li>Click &lt;code>New&lt;/code> and add the path of the folder containing &lt;code>micro.exe&lt;/code>.&lt;/li>
&lt;li>Click &lt;code>OK&lt;/code> to close all dialogs.&lt;/li>
&lt;li>Restart the command prompt and type &lt;code>nano&lt;/code> to check if it can be executed.&lt;/li>
&lt;/ol>
&lt;h2 id="how-to-use-micro">How to use micro
&lt;/h2>&lt;p>When you type &lt;code>micro&lt;/code> in the command prompt and execute it, the following screen is displayed.
&lt;img src="http://kenji.blog/p/%E3%83%86%E3%82%AD%E3%82%B9%E3%83%88%E3%82%A8%E3%83%87%E3%82%A3%E3%82%BFmicro%E3%82%92windows%E3%81%AB%E3%82%A4%E3%83%B3%E3%82%B9%E3%83%88%E3%83%BC%E3%83%AB%E3%81%99%E3%82%8B%E6%96%B9%E6%B3%95/img_3.png"
width="962"
height="512"
srcset="http://kenji.blog/p/%E3%83%86%E3%82%AD%E3%82%B9%E3%83%88%E3%82%A8%E3%83%87%E3%82%A3%E3%82%BFmicro%E3%82%92windows%E3%81%AB%E3%82%A4%E3%83%B3%E3%82%B9%E3%83%88%E3%83%BC%E3%83%AB%E3%81%99%E3%82%8B%E6%96%B9%E6%B3%95/img_3_hucac22a4d580735ddd83b1fd5173c3197_6852_480x0_resize_box_3.png 480w, http://kenji.blog/p/%E3%83%86%E3%82%AD%E3%82%B9%E3%83%88%E3%82%A8%E3%83%87%E3%82%A3%E3%82%BFmicro%E3%82%92windows%E3%81%AB%E3%82%A4%E3%83%B3%E3%82%B9%E3%83%88%E3%83%BC%E3%83%AB%E3%81%99%E3%82%8B%E6%96%B9%E6%B3%95/img_3_hucac22a4d580735ddd83b1fd5173c3197_6852_1024x0_resize_box_3.png 1024w"
loading="lazy"
alt="img_3.png"
class="gallery-image"
data-flex-grow="187"
data-flex-basis="450px"
>&lt;/p>
&lt;p>The main operations and shortcut keys are as follows.&lt;/p>
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Shortcut Key&lt;/th>
&lt;th>Operation&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>Ctrl+Q&lt;/td>
&lt;td>Close file&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Ctrl+S&lt;/td>
&lt;td>Save file&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Ctrl+O&lt;/td>
&lt;td>Open file&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Ctrl+A&lt;/td>
&lt;td>Select all&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Ctrl+X&lt;/td>
&lt;td>Cut selection&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Ctrl+C&lt;/td>
&lt;td>Copy selection&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Ctrl+V&lt;/td>
&lt;td>Paste&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Ctrl+Z&lt;/td>
&lt;td>Undo&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Ctrl+Y&lt;/td>
&lt;td>Redo&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Ctrl+E&lt;/td>
&lt;td>Execute editor command&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;h2 id="reference">Reference
&lt;/h2>&lt;ul>
&lt;li>&lt;a class="link" href="https://micro-editor.github.io/" target="_blank" rel="noopener"
>micro&lt;/a>&lt;/li>
&lt;/ul></description></item><item><title>How to Fix "Temporary failure resolving..." Error in WSL</title><link>http://kenji.blog/en/p/wsl-%E3%81%A7temporary-failure-resolving%E3%81%A8%E8%A1%A8%E7%A4%BA%E3%81%95%E3%82%8C%E3%82%8B%E5%A0%B4%E5%90%88%E3%81%AE%E5%AF%BE%E5%87%A6%E6%96%B9%E6%B3%95/</link><pubDate>Sun, 31 Mar 2024 16:57:33 +0900</pubDate><guid>http://kenji.blog/en/p/wsl-%E3%81%A7temporary-failure-resolving%E3%81%A8%E8%A1%A8%E7%A4%BA%E3%81%95%E3%82%8C%E3%82%8B%E5%A0%B4%E5%90%88%E3%81%AE%E5%AF%BE%E5%87%A6%E6%96%B9%E6%B3%95/</guid><description>&lt;img src="http://kenji.blog/p/wsl-%E3%81%A7temporary-failure-resolving%E3%81%A8%E8%A1%A8%E7%A4%BA%E3%81%95%E3%82%8C%E3%82%8B%E5%A0%B4%E5%90%88%E3%81%AE%E5%AF%BE%E5%87%A6%E6%96%B9%E6%B3%95/img.png" alt="Featured image of post How to Fix "Temporary failure resolving..." Error in WSL" />&lt;h1 id="how-to-fix-temporary-failure-resolving-error-in-wsl">How to Fix &amp;ldquo;Temporary failure resolving&amp;hellip;&amp;rdquo; Error in WSL
&lt;/h1>&lt;div class="highlight">&lt;div class="chroma">
&lt;table class="lntable">&lt;tr>&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code>&lt;span class="lnt">1
&lt;/span>&lt;span class="lnt">2
&lt;/span>&lt;span class="lnt">3
&lt;/span>&lt;span class="lnt">4
&lt;/span>&lt;/code>&lt;/pre>&lt;/td>
&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code class="language-fallback" data-lang="fallback">&lt;span class="line">&lt;span class="cl">kenji@MyComputer:~$ sudo apt update
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">[sudo] password for kenji:
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">Err:1 http://archive.ubuntu.com/ubuntu focal InRelease
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> Temporary failure resolving &amp;#39;archive.ubuntu.com&amp;#39;
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/td>&lt;/tr>&lt;/table>
&lt;/div>
&lt;/div>&lt;p>When the above error appears in WSL, the DNS server settings might be incorrect.
In my environment, I solved it with the following steps.&lt;/p>
&lt;ol>
&lt;li>Start WSL.&lt;/li>
&lt;li>Run &lt;code>sudo nano /etc/resolv.conf&lt;/code>.&lt;/li>
&lt;li>Change the &lt;code>nameserver&lt;/code> line as follows:&lt;/li>
&lt;/ol>
&lt;div class="highlight">&lt;div class="chroma">
&lt;table class="lntable">&lt;tr>&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code>&lt;span class="lnt">1
&lt;/span>&lt;/code>&lt;/pre>&lt;/td>
&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code class="language-fallback" data-lang="fallback">&lt;span class="line">&lt;span class="cl">nameserver 8.8.8.8
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/td>&lt;/tr>&lt;/table>
&lt;/div>
&lt;/div>&lt;ol start="4">
&lt;li>Save with &lt;code>Ctrl&lt;/code> + &lt;code>S&lt;/code> and exit with &lt;code>Ctrl&lt;/code> + &lt;code>X&lt;/code>.&lt;/li>
&lt;li>Run &lt;code>sudo apt update&lt;/code>.&lt;/li>
&lt;li>If the error doesn&amp;rsquo;t appear, it&amp;rsquo;s solved.&lt;/li>
&lt;/ol>
&lt;h2 id="if-the-above-steps-do-not-solve-the-issue">If the above steps do not solve the issue
&lt;/h2>&lt;p>It seems there are cases where the above steps don&amp;rsquo;t resolve the issue. Please refer to the following article:&lt;/p>
&lt;ul>
&lt;li>&lt;a class="link" href="https://qiita.com/ryosukeYamazaki/items/c04ec3ff78aac6eb8d26" target="_blank" rel="noopener"
>How to resolve &amp;lsquo;Temporary failure resolving ~&amp;rsquo; during apt update in WSL&lt;/a>&lt;/li>
&lt;/ul></description></item><item><title>How to Launch Hidemaru Editor with the "hide" Command</title><link>http://kenji.blog/en/p/%E3%82%B3%E3%83%9E%E3%83%B3%E3%83%89hide%E3%81%A7%E7%A7%80%E4%B8%B8%E3%82%A8%E3%83%87%E3%82%A3%E3%82%BF%E3%82%92%E7%AB%8B%E3%81%A1%E4%B8%8A%E3%81%92%E3%82%8B%E6%96%B9%E6%B3%95/</link><pubDate>Fri, 29 Mar 2024 23:45:37 +0900</pubDate><guid>http://kenji.blog/en/p/%E3%82%B3%E3%83%9E%E3%83%B3%E3%83%89hide%E3%81%A7%E7%A7%80%E4%B8%B8%E3%82%A8%E3%83%87%E3%82%A3%E3%82%BF%E3%82%92%E7%AB%8B%E3%81%A1%E4%B8%8A%E3%81%92%E3%82%8B%E6%96%B9%E6%B3%95/</guid><description>&lt;img src="http://kenji.blog/p/%E3%82%B3%E3%83%9E%E3%83%B3%E3%83%89hide%E3%81%A7%E7%A7%80%E4%B8%B8%E3%82%A8%E3%83%87%E3%82%A3%E3%82%BF%E3%82%92%E7%AB%8B%E3%81%A1%E4%B8%8A%E3%81%92%E3%82%8B%E6%96%B9%E6%B3%95/img_2.png" alt="Featured image of post How to Launch Hidemaru Editor with the "hide" Command" />&lt;h2 id="here-is-how-to-launch-hidemaru-editor-with-the-hide-command">Here is how to launch Hidemaru Editor with the &amp;ldquo;hide&amp;rdquo; command.
&lt;/h2>&lt;p>Note: This method has been verified to work on &lt;code>Windows 10/11&lt;/code>.&lt;/p>
&lt;ol>
&lt;li>Open the Registry Editor.&lt;/li>
&lt;li>Navigate to &lt;code>HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths&lt;/code>.&lt;/li>
&lt;li>Create a key named &lt;code>hide.exe&lt;/code> under &lt;code>App Paths&lt;/code>. &lt;em>The part before &lt;code>.exe&lt;/code> in this key name will be the command name.&lt;/em>&lt;/li>
&lt;li>Set the &lt;code>(Default)&lt;/code> value of the &lt;code>hide.exe&lt;/code> key to the executable file path of Hidemaru Editor. In my environment, it was &lt;code>&amp;quot;C:\Program Files (x86)\Hidemaru\Hidemaru.exe&amp;quot;&lt;/code>.&lt;/li>
&lt;li>Create a String value named &lt;code>Path&lt;/code> in the &lt;code>hide.exe&lt;/code> key.&lt;/li>
&lt;li>Set the data of &lt;code>Path&lt;/code> to the folder path where the Hidemaru Editor executable file is located. In my environment, it was &lt;code>&amp;quot;C:\Program Files (x86)\Hidemaru&amp;quot;&lt;/code>.&lt;/li>
&lt;li>Now you can launch Hidemaru Editor with the &lt;code>hide&lt;/code> command in the &lt;em>Run&lt;/em> dialog, which can be opened with &lt;code>Win&lt;/code> + &lt;code>R&lt;/code>. Also, in the Command Prompt, you can launch it with the &lt;code>start hide&lt;/code> command.&lt;/li>
&lt;/ol>
&lt;div class="highlight">&lt;div class="chroma">
&lt;table class="lntable">&lt;tr>&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code>&lt;span class="lnt">1
&lt;/span>&lt;span class="lnt">2
&lt;/span>&lt;span class="lnt">3
&lt;/span>&lt;span class="lnt">4
&lt;/span>&lt;span class="lnt">5
&lt;/span>&lt;/code>&lt;/pre>&lt;/td>
&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code class="language-fallback" data-lang="fallback">&lt;span class="line">&lt;span class="cl">Windows Registry Editor Version 5.00
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\hide.exe]
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">@=&amp;#34;\&amp;#34;C:\\Program Files (x86)\\Hidemaru\\Hidemaru.exe\&amp;#34;&amp;#34;
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&amp;#34;Path&amp;#34;=&amp;#34;\&amp;#34;C:\\Program Files (x86)\\Hidemaru\\\&amp;#34;&amp;#34;
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/td>&lt;/tr>&lt;/table>
&lt;/div>
&lt;/div>&lt;p>If you save the above content in a &lt;code>.reg&lt;/code> file and execute it, the settings will be added to the registry.&lt;/p>
&lt;p>&lt;img src="http://kenji.blog/p/%E3%82%B3%E3%83%9E%E3%83%B3%E3%83%89hide%E3%81%A7%E7%A7%80%E4%B8%B8%E3%82%A8%E3%83%87%E3%82%A3%E3%82%BF%E3%82%92%E7%AB%8B%E3%81%A1%E4%B8%8A%E3%81%92%E3%82%8B%E6%96%B9%E6%B3%95/img_1.png"
width="399"
height="206"
srcset="http://kenji.blog/p/%E3%82%B3%E3%83%9E%E3%83%B3%E3%83%89hide%E3%81%A7%E7%A7%80%E4%B8%B8%E3%82%A8%E3%83%87%E3%82%A3%E3%82%BF%E3%82%92%E7%AB%8B%E3%81%A1%E4%B8%8A%E3%81%92%E3%82%8B%E6%96%B9%E6%B3%95/img_1_hue374203b955e2a50cac4186ada52cd43_10600_480x0_resize_box_3.png 480w, http://kenji.blog/p/%E3%82%B3%E3%83%9E%E3%83%B3%E3%83%89hide%E3%81%A7%E7%A7%80%E4%B8%B8%E3%82%A8%E3%83%87%E3%82%A3%E3%82%BF%E3%82%92%E7%AB%8B%E3%81%A1%E4%B8%8A%E3%81%92%E3%82%8B%E6%96%B9%E6%B3%95/img_1_hue374203b955e2a50cac4186ada52cd43_10600_1024x0_resize_box_3.png 1024w"
loading="lazy"
alt="img_1.png"
class="gallery-image"
data-flex-grow="193"
data-flex-basis="464px"
>&lt;/p></description></item><item><title>Install PowerToys via Command Prompt</title><link>http://kenji.blog/en/p/powertoys%E3%81%AE%E3%82%A4%E3%83%B3%E3%82%B9%E3%83%88%E3%83%BC%E3%83%AB/</link><pubDate>Sat, 30 Sep 2023 21:23:00 +0900</pubDate><guid>http://kenji.blog/en/p/powertoys%E3%81%AE%E3%82%A4%E3%83%B3%E3%82%B9%E3%83%88%E3%83%BC%E3%83%AB/</guid><description>&lt;img src="http://kenji.blog/p/powertoys%E3%81%AE%E3%82%A4%E3%83%B3%E3%82%B9%E3%83%88%E3%83%BC%E3%83%AB/img.png" alt="Featured image of post Install PowerToys via Command Prompt" />&lt;h1 id="install-powertoys-via-command-prompt">Install PowerToys via Command Prompt
&lt;/h1>&lt;p>Here is how to install PowerToys via Command Prompt.&lt;/p>
&lt;div class="highlight">&lt;div class="chroma">
&lt;table class="lntable">&lt;tr>&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code>&lt;span class="lnt">1
&lt;/span>&lt;/code>&lt;/pre>&lt;/td>
&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code class="language-fallback" data-lang="fallback">&lt;span class="line">&lt;span class="cl">winget install Microsoft.PowerToys --source winget
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/td>&lt;/tr>&lt;/table>
&lt;/div>
&lt;/div>&lt;h1 id="uninstall-powertoys-via-command-prompt">Uninstall PowerToys via Command Prompt
&lt;/h1>&lt;div class="highlight">&lt;div class="chroma">
&lt;table class="lntable">&lt;tr>&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code>&lt;span class="lnt">1
&lt;/span>&lt;/code>&lt;/pre>&lt;/td>
&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code class="language-fallback" data-lang="fallback">&lt;span class="line">&lt;span class="cl">winget uninstall --name PowerToys
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/td>&lt;/tr>&lt;/table>
&lt;/div>
&lt;/div></description></item><item><title>About Receiving the Microsoft MVP Award (2023-2024)</title><link>http://kenji.blog/en/p/microsoft-mvp%E5%8F%97%E8%B3%9E%E3%81%AB%E3%81%A4%E3%81%84%E3%81%A62023-2024/</link><pubDate>Mon, 31 Jul 2023 19:15:14 +0900</pubDate><guid>http://kenji.blog/en/p/microsoft-mvp%E5%8F%97%E8%B3%9E%E3%81%AB%E3%81%A4%E3%81%84%E3%81%A62023-2024/</guid><description>&lt;img src="http://kenji.blog/p/microsoft-mvp%E5%8F%97%E8%B3%9E%E3%81%AB%E3%81%A4%E3%81%84%E3%81%A62023-2024/img.png" alt="Featured image of post About Receiving the Microsoft MVP Award (2023-2024)" />&lt;h1 id="about-receiving-the-microsoft-mvp-award-2023-2024">About Receiving the Microsoft MVP Award (2023-2024)
&lt;/h1>&lt;p>I have received the Microsoft MVP (2023-2024) award.
This is the 7th consecutive year I have received this award since 2017.&lt;/p>
&lt;p>The category I was awarded in is &lt;strong>Developer Technologies&lt;/strong>.&lt;/p>
&lt;p>Looking back at my past activities, I have been doing the following:&lt;/p>
&lt;ul>
&lt;li>Publishing code on &lt;a class="link" href="https://github.com/kenjinote" target="_blank" rel="noopener"
>GitHub&lt;/a>&lt;/li>
&lt;li>Disseminating technical information on my blog and &lt;a class="link" href="https://twitter.com/kenjinote" target="_blank" rel="noopener"
>SNS (Twitter, etc.)&lt;/a>&lt;/li>
&lt;li>Posting on the &lt;a class="link" href="https://social.msdn.microsoft.com/Forums/ja-JP/home" target="_blank" rel="noopener"
>MSDN Forums&lt;/a>&lt;/li>
&lt;li>Providing feedback on Microsoft products&lt;/li>
&lt;/ul>
&lt;p>I hope to continue writing better articles and sharing information.&lt;/p>
&lt;p>Thank you very much.&lt;/p></description></item><item><title>Graph Editor</title><link>http://kenji.blog/en/p/%E3%82%B0%E3%83%A9%E3%83%95%E3%82%A8%E3%83%87%E3%82%A3%E3%82%BF/</link><pubDate>Thu, 13 Oct 2022 23:31:11 +0900</pubDate><guid>http://kenji.blog/en/p/%E3%82%B0%E3%83%A9%E3%83%95%E3%82%A8%E3%83%87%E3%82%A3%E3%82%BF/</guid><description>&lt;img src="http://kenji.blog/p/%E3%82%B0%E3%83%A9%E3%83%95%E3%82%A8%E3%83%87%E3%82%A3%E3%82%BF/img.png" alt="Featured image of post Graph Editor" />&lt;h1 id="graph-editor">Graph Editor
&lt;/h1>&lt;p>This is an introduction to a web page where you can easily create simple graphs.&lt;/p>
&lt;p>&lt;a class="link" href="https://csacademy.com/app/graph_editor/" target="_blank" rel="noopener"
>https://csacademy.com/app/graph_editor/&lt;/a>&lt;/p>
&lt;p>You can create graphs by entering numerical values.
You can also move elements around using the mouse.&lt;/p>
&lt;p>By clicking &lt;code>Directed&lt;/code>, you can create directed graphs as well.&lt;/p>
&lt;p>&lt;img src="http://kenji.blog/p/%E3%82%B0%E3%83%A9%E3%83%95%E3%82%A8%E3%83%87%E3%82%A3%E3%82%BF/img_1.png"
width="300"
height="300"
srcset="http://kenji.blog/p/%E3%82%B0%E3%83%A9%E3%83%95%E3%82%A8%E3%83%87%E3%82%A3%E3%82%BF/img_1_hu8da2a7e6049b3e95e8ba3eb3a30bc8ba_14422_480x0_resize_box_3.png 480w, http://kenji.blog/p/%E3%82%B0%E3%83%A9%E3%83%95%E3%82%A8%E3%83%87%E3%82%A3%E3%82%BF/img_1_hu8da2a7e6049b3e95e8ba3eb3a30bc8ba_14422_1024x0_resize_box_3.png 1024w"
loading="lazy"
alt="img_1.png"
class="gallery-image"
data-flex-grow="100"
data-flex-basis="240px"
>&lt;/p>
&lt;p>You can save the graphs you create as images using &lt;code>Download as PNG&lt;/code>.&lt;/p></description></item><item><title>Installing Apps via Command Line Using WinGet</title><link>http://kenji.blog/en/p/winget-%E3%82%92%E4%BD%BF%E3%81%A3%E3%81%A6%E3%82%B3%E3%83%9E%E3%83%B3%E3%83%89%E3%81%A7%E3%82%A2%E3%83%97%E3%83%AA%E3%82%92%E3%82%A4%E3%83%B3%E3%82%B9%E3%83%88%E3%83%BC%E3%83%AB%E3%81%99%E3%82%8B/</link><pubDate>Wed, 05 Oct 2022 12:15:20 +0900</pubDate><guid>http://kenji.blog/en/p/winget-%E3%82%92%E4%BD%BF%E3%81%A3%E3%81%A6%E3%82%B3%E3%83%9E%E3%83%B3%E3%83%89%E3%81%A7%E3%82%A2%E3%83%97%E3%83%AA%E3%82%92%E3%82%A4%E3%83%B3%E3%82%B9%E3%83%88%E3%83%BC%E3%83%AB%E3%81%99%E3%82%8B/</guid><description>&lt;img src="http://kenji.blog/p/winget-%E3%82%92%E4%BD%BF%E3%81%A3%E3%81%A6%E3%82%B3%E3%83%9E%E3%83%B3%E3%83%89%E3%81%A7%E3%82%A2%E3%83%97%E3%83%AA%E3%82%92%E3%82%A4%E3%83%B3%E3%82%B9%E3%83%88%E3%83%BC%E3%83%AB%E3%81%99%E3%82%8B/img.png" alt="Featured image of post Installing Apps via Command Line Using WinGet" />&lt;h2 id="prerequisites">Prerequisites
&lt;/h2>&lt;p>Windows 11&lt;/p>
&lt;h2 id="steps">Steps
&lt;/h2>&lt;ol>
&lt;li>Install &lt;code>App Installer&lt;/code> from the Microsoft Store
&lt;a class="link" href="https://www.microsoft.com/store/productId/9NBLGGH4NNS1" target="_blank" rel="noopener"
>https://www.microsoft.com/store/productId/9NBLGGH4NNS1&lt;/a>&lt;/li>
&lt;li>Install apps from the command prompt
&lt;div class="highlight">&lt;div class="chroma">
&lt;table class="lntable">&lt;tr>&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code>&lt;span class="lnt">1
&lt;/span>&lt;/code>&lt;/pre>&lt;/td>
&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code class="language-powershell" data-lang="powershell">&lt;span class="line">&lt;span class="cl">&lt;span class="n">winget&lt;/span> &lt;span class="n">install&lt;/span> &lt;span class="n">Google&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="py">Chrome&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/td>&lt;/tr>&lt;/table>
&lt;/div>
&lt;/div>&lt;/li>
&lt;/ol>
&lt;h2 id="main-apps-that-can-be-installed">Main Apps that Can Be Installed
&lt;/h2>&lt;ul>
&lt;li>Google Chrome (command &lt;code>winget install Google.Chrome&lt;/code>)&lt;/li>
&lt;li>Microsoft Edge (command &lt;code>winget install Microsoft.Edge&lt;/code>)&lt;/li>
&lt;li>Microsoft Teams (command &lt;code>winget install Microsoft.Teams&lt;/code>)&lt;/li>
&lt;li>Microsoft Office (command &lt;code>winget install Microsoft.Office&lt;/code>)&lt;/li>
&lt;li>Visual Studio Code (command &lt;code>winget install vscode&lt;/code>)&lt;/li>
&lt;li>Slack (command &lt;code>winget install SlackTechnologies.Slack&lt;/code>)&lt;/li>
&lt;li>Discord (command &lt;code>winget install Discord.Discord&lt;/code>)&lt;/li>
&lt;li>Docker Desktop (command &lt;code>winget install Docker.DockerDesktop&lt;/code>)&lt;/li>
&lt;li>Git (command &lt;code>winget install Git&lt;/code>)&lt;/li>
&lt;li>7zip (command &lt;code>winget install 7zip&lt;/code>)&lt;/li>
&lt;li>VLC (command &lt;code>winget install VideoLAN.VLC&lt;/code>)&lt;/li>
&lt;/ul>
&lt;h2 id="references">References
&lt;/h2>&lt;p>&lt;a class="link" href="https://learn.microsoft.com/en-us/windows/package-manager/winget/" target="_blank" rel="noopener"
>Use the winget tool to install and manage applications&lt;/a>&lt;/p>
&lt;h3 id="aside">Aside
&lt;/h3>&lt;p>I thought I could install Paint.Net too, but I wasn&amp;rsquo;t able to.&lt;/p>
&lt;p>&lt;a class="link" href="https://forums.getpaint.net/topic/118574-please-add-paintnet-to-the-available-packages-for-windows-package-manager-winget/" target="_blank" rel="noopener"
>https://forums.getpaint.net/topic/118574-please-add-paintnet-to-the-available-packages-for-windows-package-manager-winget/&lt;/a>&lt;/p></description></item><item><title>Deleting a tag in git</title><link>http://kenji.blog/en/p/git%E3%81%A7%E3%82%BF%E3%82%B0%E3%82%92%E6%B6%88%E3%81%99/</link><pubDate>Sun, 02 Oct 2022 02:18:04 +0900</pubDate><guid>http://kenji.blog/en/p/git%E3%81%A7%E3%82%BF%E3%82%B0%E3%82%92%E6%B6%88%E3%81%99/</guid><description>&lt;img src="http://kenji.blog/p/git%E3%81%A7%E3%82%BF%E3%82%B0%E3%82%92%E6%B6%88%E3%81%99/img.png" alt="Featured image of post Deleting a tag in git" />&lt;h1 id="delete-a-local-tag">Delete a local tag
&lt;/h1>&lt;ol>
&lt;li>Check existing local tags with &lt;code>git tag&lt;/code>.&lt;/li>
&lt;li>Delete the tag with &lt;code>git tag -d v0.1.0&lt;/code>. (Replace &lt;code>v0.1.0&lt;/code> with the tag you want to delete)&lt;/li>
&lt;/ol>
&lt;h1 id="delete-a-remote-tag">Delete a remote tag
&lt;/h1>&lt;ol>
&lt;li>Check existing remote tags with &lt;code>git ls-remote --tags&lt;/code>.&lt;/li>
&lt;li>Delete the remote tag with &lt;code>git push origin --delete v0.1.0&lt;/code>. (Replace &lt;code>v0.1.0&lt;/code> with the tag you want to delete)&lt;/li>
&lt;/ol>
&lt;h2 id="reference">Reference
&lt;/h2>&lt;p>&lt;a class="link" href="https://qumeru.com/magazine/528" target="_blank" rel="noopener"
>How to delete a tag in git locally and remotely!&lt;/a>&lt;/p></description></item><item><title>Using GitHub Copilot in IntelliJ IDEA</title><link>http://kenji.blog/en/p/intellij-idea%E3%81%A7github-copilot%E3%82%92%E4%BD%BF%E3%81%86/</link><pubDate>Sat, 10 Sep 2022 09:44:55 +0900</pubDate><guid>http://kenji.blog/en/p/intellij-idea%E3%81%A7github-copilot%E3%82%92%E4%BD%BF%E3%81%86/</guid><description>&lt;img src="http://kenji.blog/p/intellij-idea%E3%81%A7github-copilot%E3%82%92%E4%BD%BF%E3%81%86/images/img.png" alt="Featured image of post Using GitHub Copilot in IntelliJ IDEA" />&lt;h1 id="introduction">Introduction
&lt;/h1>&lt;p>GitHub Copilot is an AI-based code completion tool developed by GitHub.
By installing the GitHub Copilot plugin in the IntelliJ IDEA development environment, you can also use GitHub Copilot in IntelliJ IDEA.
A Github account is required for activation.&lt;/p>
&lt;h1 id="how-to-install">How to Install
&lt;/h1>&lt;ol>
&lt;li>Select Settings from the File menu in IntelliJ IDEA&lt;/li>
&lt;li>Select Plugins, and search for &amp;ldquo;GitHub Copilot&amp;rdquo;
&lt;img src="http://kenji.blog/p/intellij-idea%E3%81%A7github-copilot%E3%82%92%E4%BD%BF%E3%81%86/images/img_0.png"
width="984"
height="713"
srcset="http://kenji.blog/p/intellij-idea%E3%81%A7github-copilot%E3%82%92%E4%BD%BF%E3%81%86/images/img_0_hu1a17f06d84f4c3bc905993428da2585e_52443_480x0_resize_box_3.png 480w, http://kenji.blog/p/intellij-idea%E3%81%A7github-copilot%E3%82%92%E4%BD%BF%E3%81%86/images/img_0_hu1a17f06d84f4c3bc905993428da2585e_52443_1024x0_resize_box_3.png 1024w"
loading="lazy"
alt="img.png"
class="gallery-image"
data-flex-grow="138"
data-flex-basis="331px"
>&lt;/li>
&lt;li>Install via the Install button
&lt;img src="http://kenji.blog/p/intellij-idea%E3%81%A7github-copilot%E3%82%92%E4%BD%BF%E3%81%86/images/img_1.png"
width="440"
height="288"
srcset="http://kenji.blog/p/intellij-idea%E3%81%A7github-copilot%E3%82%92%E4%BD%BF%E3%81%86/images/img_1_hu760c08385147deb656e4c3f97738e20a_11542_480x0_resize_box_3.png 480w, http://kenji.blog/p/intellij-idea%E3%81%A7github-copilot%E3%82%92%E4%BD%BF%E3%81%86/images/img_1_hu760c08385147deb656e4c3f97738e20a_11542_1024x0_resize_box_3.png 1024w"
loading="lazy"
alt="img_1.png"
class="gallery-image"
data-flex-grow="152"
data-flex-basis="366px"
>&lt;/li>
&lt;li>Click the Restart IDE button to restart IntelliJ IDEA
&lt;img src="http://kenji.blog/p/intellij-idea%E3%81%A7github-copilot%E3%82%92%E4%BD%BF%E3%81%86/images/img_2.png"
width="984"
height="713"
srcset="http://kenji.blog/p/intellij-idea%E3%81%A7github-copilot%E3%82%92%E4%BD%BF%E3%81%86/images/img_2_hue7ac4db80b402fe88ff676c2505b2e26_63613_480x0_resize_box_3.png 480w, http://kenji.blog/p/intellij-idea%E3%81%A7github-copilot%E3%82%92%E4%BD%BF%E3%81%86/images/img_2_hue7ac4db80b402fe88ff676c2505b2e26_63613_1024x0_resize_box_3.png 1024w"
loading="lazy"
alt="img_2.png"
class="gallery-image"
data-flex-grow="138"
data-flex-basis="331px"
>
&lt;img src="http://kenji.blog/p/intellij-idea%E3%81%A7github-copilot%E3%82%92%E4%BD%BF%E3%81%86/images/img_3.png"
width="370"
height="128"
srcset="http://kenji.blog/p/intellij-idea%E3%81%A7github-copilot%E3%82%92%E4%BD%BF%E3%81%86/images/img_3_huf684fa748633ae887c193539a3f1f778_4849_480x0_resize_box_3.png 480w, http://kenji.blog/p/intellij-idea%E3%81%A7github-copilot%E3%82%92%E4%BD%BF%E3%81%86/images/img_3_huf684fa748633ae887c193539a3f1f778_4849_1024x0_resize_box_3.png 1024w"
loading="lazy"
alt="img_3.png"
class="gallery-image"
data-flex-grow="289"
data-flex-basis="693px"
>
The installation is complete once IntelliJ IDEA restarts.&lt;/li>
&lt;/ol>
&lt;h1 id="activation">Activation
&lt;/h1>&lt;ol>
&lt;li>Click the icon at the bottom right&lt;/li>
&lt;li>Click Login to Github
&lt;img src="http://kenji.blog/p/intellij-idea%E3%81%A7github-copilot%E3%82%92%E4%BD%BF%E3%81%86/images/img_4.png"
width="179"
height="97"
srcset="http://kenji.blog/p/intellij-idea%E3%81%A7github-copilot%E3%82%92%E4%BD%BF%E3%81%86/images/img_4_huda05efd9621c0a19fb78fc4f90866e22_2661_480x0_resize_box_3.png 480w, http://kenji.blog/p/intellij-idea%E3%81%A7github-copilot%E3%82%92%E4%BD%BF%E3%81%86/images/img_4_huda05efd9621c0a19fb78fc4f90866e22_2661_1024x0_resize_box_3.png 1024w"
loading="lazy"
alt="img_4.png"
class="gallery-image"
data-flex-grow="184"
data-flex-basis="442px"
>&lt;/li>
&lt;li>Click the Copy and Open button
&lt;img src="http://kenji.blog/p/intellij-idea%E3%81%A7github-copilot%E3%82%92%E4%BD%BF%E3%81%86/images/img_6.png"
width="422"
height="199"
srcset="http://kenji.blog/p/intellij-idea%E3%81%A7github-copilot%E3%82%92%E4%BD%BF%E3%81%86/images/img_6_hua124fecdd3632e6b95f8259e5e606e1a_8284_480x0_resize_box_3.png 480w, http://kenji.blog/p/intellij-idea%E3%81%A7github-copilot%E3%82%92%E4%BD%BF%E3%81%86/images/img_6_hua124fecdd3632e6b95f8259e5e606e1a_8284_1024x0_resize_box_3.png 1024w"
loading="lazy"
alt="img_6.png"
class="gallery-image"
data-flex-grow="212"
data-flex-basis="508px"
>&lt;/li>
&lt;li>A browser will open. If you are not logged into Github, log in, paste the code using Ctrl+V, and click the Continue button
&lt;img src="http://kenji.blog/p/intellij-idea%E3%81%A7github-copilot%E3%82%92%E4%BD%BF%E3%81%86/images/img_7.png"
width="579"
height="530"
srcset="http://kenji.blog/p/intellij-idea%E3%81%A7github-copilot%E3%82%92%E4%BD%BF%E3%81%86/images/img_7_hub4e276df82537681adc4331944f40166_19231_480x0_resize_box_3.png 480w, http://kenji.blog/p/intellij-idea%E3%81%A7github-copilot%E3%82%92%E4%BD%BF%E3%81%86/images/img_7_hub4e276df82537681adc4331944f40166_19231_1024x0_resize_box_3.png 1024w"
loading="lazy"
alt="img_7.png"
class="gallery-image"
data-flex-grow="109"
data-flex-basis="262px"
>&lt;/li>
&lt;li>Click the Authorize GitHub Copilot Plugin button
&lt;img src="http://kenji.blog/p/intellij-idea%E3%81%A7github-copilot%E3%82%92%E4%BD%BF%E3%81%86/images/img_8.png"
width="546"
height="689"
srcset="http://kenji.blog/p/intellij-idea%E3%81%A7github-copilot%E3%82%92%E4%BD%BF%E3%81%86/images/img_8_hu1e48fa0fb5989dc3e0616b0ee84b6476_33153_480x0_resize_box_3.png 480w, http://kenji.blog/p/intellij-idea%E3%81%A7github-copilot%E3%82%92%E4%BD%BF%E3%81%86/images/img_8_hu1e48fa0fb5989dc3e0616b0ee84b6476_33153_1024x0_resize_box_3.png 1024w"
loading="lazy"
alt="img_8.png"
class="gallery-image"
data-flex-grow="79"
data-flex-basis="190px"
>
&lt;img src="http://kenji.blog/p/intellij-idea%E3%81%A7github-copilot%E3%82%92%E4%BD%BF%E3%81%86/images/img_9.png"
width="454"
height="337"
srcset="http://kenji.blog/p/intellij-idea%E3%81%A7github-copilot%E3%82%92%E4%BD%BF%E3%81%86/images/img_9_hu73bf5cd6f6a7ddf7aa8e1b63387b9c7d_7965_480x0_resize_box_3.png 480w, http://kenji.blog/p/intellij-idea%E3%81%A7github-copilot%E3%82%92%E4%BD%BF%E3%81%86/images/img_9_hu73bf5cd6f6a7ddf7aa8e1b63387b9c7d_7965_1024x0_resize_box_3.png 1024w"
loading="lazy"
alt="img_9.png"
class="gallery-image"
data-flex-grow="134"
data-flex-basis="323px"
>
Activation is complete when the screen above is displayed.&lt;/li>
&lt;/ol>
&lt;h1 id="try-it-out">Try it out
&lt;/h1>&lt;p>&lt;img src="http://kenji.blog/p/intellij-idea%E3%81%A7github-copilot%E3%82%92%E4%BD%BF%E3%81%86/images/img_10.png"
width="330"
height="136"
srcset="http://kenji.blog/p/intellij-idea%E3%81%A7github-copilot%E3%82%92%E4%BD%BF%E3%81%86/images/img_10_hu25143f366631b8ce9af8689b387ca520_6039_480x0_resize_box_3.png 480w, http://kenji.blog/p/intellij-idea%E3%81%A7github-copilot%E3%82%92%E4%BD%BF%E3%81%86/images/img_10_hu25143f366631b8ce9af8689b387ca520_6039_1024x0_resize_box_3.png 1024w"
loading="lazy"
alt="img_10.png"
class="gallery-image"
data-flex-grow="242"
data-flex-basis="582px"
>
When you type a few characters in the IntelliJ IDEA editor, GitHub Copilot will start suggesting code completions.
Enjoy the powerful code completion features provided by AI!&lt;/p></description></item></channel></rss>