|
안녕하세요 ist공원님^^
일반적인 방법으로는 불가능해보이는군요 ㅎㅎ;;
이건 WIN32API함수를 사용해야될것 같습니다.
아래코드를 보시면 pptEnable프로시져와 Test프로시져가 있습니다.
Test프로시저를 실행시키면 2번째 프리젠테이션을 숨기기&사용불가능으로 설정합니다.
궁굼하신점이 있으시면 말씀해주세요.
그럼 좋은 하루되세요^^
Option Explicit
Public Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Public Declare Function FindWindowEx Lib "user32" Alias "FindWindowExA" (ByVal hWnd1 As Long, ByVal hWnd2 As Long, ByVal lpsz1 As String, ByVal lpsz2 As String) As Long
Public Declare Function EnableWindow Lib "user32" (ByVal hWnd As Long, ByVal fEnable As Long) As Long
Public Declare Function IsWindowEnabled Lib "user32" (ByVal hWnd As Long) As Long
Public Declare Function LockWindowUpdate Lib "user32" (ByVal hwndLock As Long) As Long
Sub Test()
pptEnable Presentations(2), False
End Sub
Sub pptEnable(Pres As Presentation, Enabled As Boolean)
Dim hWnd As Long, hMDIClient As Long
hWnd = FindWindow("PP11FrameClass", vbNullString)
hMDIClient = FindWindowEx(hWnd, ByVal 0&, "MDIClient", vbNullString)
LockWindowUpdate hWnd
Dim Win As DocumentWindow
For Each Win In Pres.Windows
hWnd = FindWindowEx(hMDIClient, ByVal 0&, "mdiClass", Win.Caption)
EnableWindow hWnd, Enabled
Win.WindowState = ppWindowMinimized
Next
For Each Win In Windows
If IsWindowEnabled(FindWindowEx(hMDIClient, ByVal 0&, "mdiClass", Win.Caption)) > 0 Then
Win.WindowState = ppWindowMaximized
Exit For
End If
Next
LockWindowUpdate 0
End Sub |
|