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

回答編集履歴

2

#if UNITY_STANDALONE_WINが不足していたため追加、見た目を調整

2019/05/21 22:55

投稿

Bongo
Bongo

スコア10816

answer CHANGED
@@ -37,7 +37,7 @@
37
37
 
38
38
  private void Awake()
39
39
  {
40
- #if UNITY_STANDALONE_WIN
40
+ #if UNITY_STANDALONE_WIN
41
41
  var window = FindWindow(null, this.windowName);
42
42
  if (this.hideTitleBar)
43
43
  {
@@ -60,9 +60,10 @@
60
60
  this.width,
61
61
  this.height,
62
62
  (this.width * this.height) == 0 ? 1 : 0);
63
- #endif
63
+ #endif
64
64
  }
65
65
 
66
+ #if UNITY_STANDALONE_WIN
66
67
  // 独自のウィンドウプロシージャ
67
68
  private IntPtr CustomWndProc(IntPtr hWnd, uint msg, IntPtr wParam, IntPtr lParam)
68
69
  {
@@ -80,6 +81,7 @@
80
81
 
81
82
  return result;
82
83
  }
84
+ #endif
83
85
 
84
86
  [StructLayout(LayoutKind.Sequential)]
85
87
  public struct RECT
@@ -107,7 +109,7 @@
107
109
  public WINDOWPOS lppos;
108
110
  }
109
111
 
110
- #if UNITY_STANDALONE_WIN
112
+ #if UNITY_STANDALONE_WIN
111
113
  [DllImport("user32.dll", EntryPoint = "SetWindowPos")]
112
114
  private static extern bool SetWindowPos(
113
115
  IntPtr hWnd,
@@ -143,7 +145,7 @@
143
145
  uint Msg,
144
146
  IntPtr wParam,
145
147
  IntPtr lParam);
146
- #endif
148
+ #endif
147
149
  }
148
150
  }
149
151
  ```

1

コードを一部修正

2019/05/21 22:55

投稿

Bongo
Bongo

スコア10816

answer CHANGED
@@ -104,8 +104,7 @@
104
104
  {
105
105
  [MarshalAs(UnmanagedType.ByValArray, SizeConst = 3)]
106
106
  public readonly RECT[] rgrc;
107
-
108
- public readonly WINDOWPOS lppos;
107
+ public WINDOWPOS lppos;
109
108
  }
110
109
 
111
110
  #if UNITY_STANDALONE_WIN