質問するログイン新規登録

回答編集履歴

3

メソッドにstaticがついていなかったのを修正

2021/02/15 13:36

投稿

nanagami
nanagami

スコア16

answer CHANGED
@@ -7,7 +7,7 @@
7
7
  public static class WindowManager
8
8
  {
9
9
  // 今回作成したWindowが、最前面に固定化されているか調べる関数
10
- public bool IsAtTheFront(IntPtr handle)
10
+ public static bool IsAtTheFront(IntPtr handle)
11
11
  {
12
12
  const int TopMostFlag = 0x00000008;
13
13
  NativeMethods.GetWindowInfo(handle,out var windowInfo)

2

メソッドにpublicがついていなかったのを修正

2021/02/15 13:36

投稿

nanagami
nanagami

スコア16

answer CHANGED
@@ -7,7 +7,7 @@
7
7
  public static class WindowManager
8
8
  {
9
9
  // 今回作成したWindowが、最前面に固定化されているか調べる関数
10
- bool IsAtTheFront(IntPtr handle)
10
+ public bool IsAtTheFront(IntPtr handle)
11
11
  {
12
12
  const int TopMostFlag = 0x00000008;
13
13
  NativeMethods.GetWindowInfo(handle,out var windowInfo)

1

主語が抜けていたのを修正

2021/02/15 13:35

投稿

nanagami
nanagami

スコア16

answer CHANGED
@@ -1,4 +1,4 @@
1
- Windows Formに最前面に固定されているか判定するTopMostプロパティがあったので、内部実装を調べたらわかりました。
1
+ Windows FormにWindowが、最前面に固定されているか判定するTopMostプロパティがあったので、内部実装を調べたらわかりました。
2
2
 
3
3
  下のコードのIsAtTheFront関数が今回、Windowが、最前面に固定されているか調べる関数になります。
4
4