回答編集履歴
1
フォームのスタイル変更用プロシージャ追記
test
CHANGED
@@ -215,3 +215,83 @@
|
|
215
215
|
End Sub
|
216
216
|
|
217
217
|
```
|
218
|
+
|
219
|
+
|
220
|
+
|
221
|
+
---
|
222
|
+
|
223
|
+
|
224
|
+
|
225
|
+
191128 20:22 追記
|
226
|
+
|
227
|
+
|
228
|
+
|
229
|
+
```vba
|
230
|
+
|
231
|
+
Public Sub ChangeUserFormStyle(inFormCaption As String)
|
232
|
+
|
233
|
+
Const ClassNameOfVBAUserFrom = "ThunderDFrame"
|
234
|
+
|
235
|
+
'このフォームのハンドルを取得。
|
236
|
+
|
237
|
+
Dim hWnd As LongPtr
|
238
|
+
|
239
|
+
hWnd = FindWindow(ClassNameOfVBAUserFrom, inFormCaption)
|
240
|
+
|
241
|
+
If hWnd = 0 Then
|
242
|
+
|
243
|
+
'取得できていない
|
244
|
+
|
245
|
+
Stop
|
246
|
+
|
247
|
+
End If
|
248
|
+
|
249
|
+
|
250
|
+
|
251
|
+
Dim wStyle As LongPtr
|
252
|
+
|
253
|
+
wStyle = GetWindowLongPtr(hWnd, GWL_STYLE)
|
254
|
+
|
255
|
+
'リサイズ可能・最大化・最小化ボタンフラグを立てる
|
256
|
+
|
257
|
+
wStyle = (wStyle Or WS_THICKFRAME Or WS_MAXIMIZEBOX Or WS_MINIMIZEBOX)
|
258
|
+
|
259
|
+
Call SetWindowLongPtr(hWnd, GWL_STYLE, wStyle)
|
260
|
+
|
261
|
+
|
262
|
+
|
263
|
+
Dim hMenu As LongPtr
|
264
|
+
|
265
|
+
hMenu = GetSystemMenu(hWnd, 0&)
|
266
|
+
|
267
|
+
Dim rClose As API_BOOL
|
268
|
+
|
269
|
+
rClose = DeleteMenu(hMenu, SC_CLOSE, MF_BYCOMMAND)
|
270
|
+
|
271
|
+
If rClose <> apiTrue Then
|
272
|
+
|
273
|
+
'何か失敗している
|
274
|
+
|
275
|
+
Stop
|
276
|
+
|
277
|
+
End If
|
278
|
+
|
279
|
+
|
280
|
+
|
281
|
+
Dim wRet As API_BOOL
|
282
|
+
|
283
|
+
wRet = DrawMenuBar(hWnd)
|
284
|
+
|
285
|
+
If wRet <> apiTrue Then
|
286
|
+
|
287
|
+
'何か失敗している
|
288
|
+
|
289
|
+
Stop
|
290
|
+
|
291
|
+
End If
|
292
|
+
|
293
|
+
|
294
|
+
|
295
|
+
End Sub
|
296
|
+
|
297
|
+
```
|