回答編集履歴

2

コードコメント補足

2016/02/03 00:19

投稿

hsk
hsk

スコア728

test CHANGED
@@ -48,6 +48,8 @@
48
48
 
49
49
  // エクスプローラを開く
50
50
 
51
+ // C:¥を開いた場合
52
+
51
53
  System.Diagnostics.Process.Start("explorer.exe", "c:\\");
52
54
 
53
55
 
@@ -63,6 +65,8 @@
63
65
 
64
66
 
65
67
  // ウインドウハンドルを得る
68
+
69
+ // ウインドウタイトルは C:¥になっていると仮定
66
70
 
67
71
  hWnd = FindWindow(null, "C:\\");
68
72
 

1

1行抜けていました\.\.\.

2016/02/03 00:19

投稿

hsk
hsk

スコア728

test CHANGED
@@ -23,6 +23,8 @@
23
23
  [System.Runtime.InteropServices.DllImport("user32.dll", CharSet = System.Runtime.InteropServices.CharSet.Auto)]
24
24
 
25
25
  private static extern IntPtr SendMessage(IntPtr hWnd, UInt32 Msg, IntPtr wParam, IntPtr lParam);
26
+
27
+ [System.Runtime.InteropServices.DllImport("user32.dll", SetLastError = true)]
26
28
 
27
29
  private static extern bool IsWindowVisible(IntPtr hWnd);
28
30