|
未テストですが、こんな感じでしょーか ?
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 Const HWND_TOPMOST = (-1)
Private Const SWP_NOSIZE = &H1&
Private Const SWP_NOMOVE = &H2&
Sub Test_Window()
Dim AppCap As String
Dim hwnd As Long, ret As Long
AppCap = Application.Caption
hwnd = FindWindow("XLMAIN", AppCap)
ret = SetWindowPos(hwnd, HWND_TOPMOST, _
0, 0, 0, 0, SWP_NOMOVE Or SWP_NOSIZE)
End Sub
|
|