Public Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hWnd As Integer, ByVal nIndex As Integer, ByVal dwNewLong As Integer) As Integer Public Declare Function GetParent Lib "user32" (ByVal hWnd As Integer) As Integer Public Const GWL_HWNDPARENT = -8 'ArcMapの最上位にフォームを表示してタスクバー切り替えをArcMapに追従 Sub ShowWindowOnTopOfArcMap() Dim pApplication As IApplication Set pApplication = m_hook '特定のウィンドウハンドルの親ウィンドウハンドルを取得(Engineの場合) Dim pToolbarControl As IToolbarControl Set pToolbarControl = m_hookHelper.hook Dim intParent As Integer intParent = GetParent(pToolbarControl.hWnd) '親フォームのウィンドウハンドルと関連付け Dim intOriginal As Integer intOriginal = SetWindowLong(OriginalForm.hWnd, GWL_HWNDPARENT, pApplication.hWnd) OriginalForm.Show ' '元のウィンドウハンドルを返す場合 ' SetWindowLong OriginalForm.hWnd, GWL_HWNDPARENT, intOriginal End Sub 'Dim pGeometricNetwork As IGeometricNetwork 'Set pGeometricNetwork = pNetworkAnalysisExt.CurrentNetwork 'Dim pNetwork As INetwork 'Set pNetwork = pGeometricNetwork.Network ' 'Dim pNetElements As INetElements 'Set pNetElements = pNetwork ' ' 'Dim UserClassID As Long 'Dim UserID As Long 'Dim UserSubID As Long ' 'pNetElements.QueryIDs 0, esriETNone, UserClassID, UserID, UserSubID ' 'Debug.Print UserClassID, UserID, UserSubID
コマンドから表示するフォームをアプリケーションの最上位に設定する方法
2016/9/1 (木)