|
これではどうでしょうか。
まるっきり新規のフォームに以下のコードを貼り付けて、うまくいったら
実際に使用するフォームに組み込んでみてください。
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" _
(ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Declare Function SetWindowPos Lib "user32" _
(ByVal hwnd As Long, ByVal hWndInsertAfter As Long, ByVal X As Long, _
ByVal Y As Long, ByVal cx As Long, ByVal cy As Long, _
ByVal wFlags As Long) As Long
Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" _
(ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
Const GWL_HWNDPARENT = -8&
Private Sub UserForm_Initialize()
Dim hwnd As Long, Ret As Long
hwnd = FindWindow(vbNullString, Me.Caption)
Ret = SetWindowPos(hwnd, -1, 0, 0, 0, 0, &H40 Or &H1 Or &H2)
Ret = SetWindowLong(hwnd, GWL_HWNDPARENT, 0)
End Sub
|
|