「Windowsのクリップボードを用いた選択コンテンツの取得」の版間の差分

Notion-MW
Notion-MW
167行目: 167行目:
に従い、コンストラクタの冒頭に
に従い、コンストラクタの冒頭に


<syntaxhighlight lang="visual basic">this.Visible = false;
<syntaxhighlight lang="vb.net">this.Visible = false;
this.WindowState = FormWindowState.Minimized;
this.WindowState = FormWindowState.Minimized;
this.ShowInTaskbar = false;</syntaxhighlight>
this.ShowInTaskbar = false;</syntaxhighlight>
を入れると、一見消えているように見えるが、Alt+Tabなどをすると表示されているのが見えてしまうので、自分のHWNDを対象にSW_HIDEを指定してShowWindowをすると完全に消える。
を入れると、一見消えているように見えるが、Alt+Tabなどをすると表示されているのが見えてしまうので、自分のHWNDを対象にSW_HIDEを指定してShowWindowをすると完全に消える。


<syntaxhighlight lang="visual basic">case WM_SHOWWINDOW:
<syntaxhighlight lang="vb.net">case WM_SHOWWINDOW:
                 this.CenterToScreen();
                 this.CenterToScreen();
                 if ((int)message.WParam == 1)
                 if ((int)message.WParam == 1)
215行目: 215行目:
C&#35;の<code>NamedPipeClientStream</code>ではパイプの名前を<code>&quot;.&quot;</code> <code>&quot;test&quot;</code>とコンピュータ名/パイプ名で分けているのに対して(AutoHotkeyで呼び出されている)Win32 APIの関数<code>CreateNamedPipe</code>では<code>&quot;\\.\</code><strong><code>pipe\</code></strong><code>test&quot;</code>と書く必要があるようなので注意。
C&#35;の<code>NamedPipeClientStream</code>ではパイプの名前を<code>&quot;.&quot;</code> <code>&quot;test&quot;</code>とコンピュータ名/パイプ名で分けているのに対して(AutoHotkeyで呼び出されている)Win32 APIの関数<code>CreateNamedPipe</code>では<code>&quot;\\.\</code><strong><code>pipe\</code></strong><code>test&quot;</code>と書く必要があるようなので注意。


<syntaxhighlight lang="visual basic">using System;
<syntaxhighlight lang="vb.net">using System;
using System.IO.Pipes;
using System.IO.Pipes;


241行目: 241行目:
   }
   }
}</syntaxhighlight>
}</syntaxhighlight>
<syntaxhighlight lang="visual basic">ptr := A_PtrSize ? "Ptr" : "UInt"
<syntaxhighlight lang="vb.net">ptr := A_PtrSize ? "Ptr" : "UInt"
char_size := A_IsUnicode ? 2 : 1
char_size := A_IsUnicode ? 2 : 1
pipe := DllCall("CreateNamedPipe", "str", "\\.\pipe\test", "uint", 3, "uint", 4, "uint", 10, "uint", 100, "uint", 100, "uint", 0, ptr, 0, ptr)
pipe := DllCall("CreateNamedPipe", "str", "\\.\pipe\test", "uint", 3, "uint", 4, "uint", 10, "uint", 100, "uint", 100, "uint", 0, ptr, 0, ptr)