C# と VB.NET の質問掲示板

ASP.NET、C++/CLI、Java 何でもどうぞ

ログ内検索
  • キーワードを複数指定する場合は 半角スペース で区切ってください。
  • 検索条件は、(AND)=[A かつ B] (OR)=[A または B] となっています。
  • [返信]をクリックすると返信ページへ移動します。
キーワード/ 検索条件 /
検索範囲/ 強調表示/ ON (自動リンクOFF)
結果表示件数/ 記事No検索/ ON
大文字と小文字を区別する

No.88449 の関連記事表示

<< 0 >>
■88449  Re[8]: 子ウインドウのフォームがWin7になる
□投稿者/ ソニン -(2018/09/01(Sat) 20:19:56)
    >魔界の仮面弁士 さん
    
    
    > 通常の SDI における「子.Show(親)」で表示させる方法ではなく、
    > あくまでも親のクライアント領域内に子を表示させる画面構成でしょうか。
    
    これはどういう画面構成のことをさしていますか?
    自分としては、
    通常の MDI における「子.Show(親)」で表示させる方法を使うつもりですので
    異なる方法でしょうか?
    
    
    
    >とっちゃん さん
    
    検索して調べたところ、恐らくこの方法を使えばいけると思います。
    
    https://detail.chiebukuro.yahoo.co.jp/qa/question_detail/q1475227379
    
    翻訳サイトを使ってVBに変換したのですが
    
                InitializeComponent()
                Dim hwnd As IntPtr = Form1.GetWindow(Me.Handle, GW_CHILD)
                        Me.wpd = New WndProcDelegate(NewWndProc)
    
    
    の三カ所でエラーが出てしまいます。
    
    
    一体どのように修正すればよろしいでしょうか?
    
    
            Private Declare Function GetWindow Lib "user32.dll" (ByVal hWnd As IntPtr, ByVal uCmd As Integer) As IntPtr
    
            Private Declare Function GetClassName Lib "user32.dll" (ByVal hWnd As IntPtr, ByVal lpClassName As StringBuilder, ByVal nMaxCount As Integer) As Integer
    
            Private Declare Function SetWindowLong Lib "user32.dll" (ByVal hWnd As IntPtr, ByVal nIndex As Integer, ByVal NewWndProc As WndProcDelegate) As IntPtr
    
            Private Declare Function SetWindowLongPtr Lib "user32.dll" (ByVal hWnd As IntPtr, ByVal nIndex As Integer, ByVal NewWndProc As WndProcDelegate) As IntPtr
    
            Private Declare Function CallWindowProc Lib "user32.dll" (ByVal lpPrevWndFunc As IntPtr, ByVal hWnd As IntPtr, ByVal Msg As UInteger, ByVal wParam As Integer, ByVal lParam As Integer) As Integer
    
            Private Const GW_HWNDNEXT As Integer = 2
    
            Private Const GW_CHILD As Integer = 5
    
            Private Const WM_NCCALCSIZE As Integer = 131
    
            Private Const GWL_WNDPROC As Integer = -4
    
            Private PrevWndProc As IntPtr
    
            Public Delegate Function WndProcDelegate(ByVal hWnd As IntPtr, ByVal uMsg As UInteger, ByVal wParam As Integer, ByVal lParam As Integer) As Integer
    
            Private wpd As WndProcDelegate
    
            Public Sub New()
                MyBase.New
                InitializeComponent()
            End Sub
    
            Private Sub Form1_Load(ByVal sender As Object, ByVal e As EventArgs)
                Dim sb As StringBuilder = New StringBuilder(100)
                Dim hwnd As IntPtr = Form1.GetWindow(Me.Handle, GW_CHILD)
    
                While (hwnd <> IntPtr.Zero)
                    Form1.GetClassName(hwnd, sb, sb.Capacity)
                    If (sb.ToString.IndexOf("MDICLIENT") <> -1) Then
                        Me.wpd = New WndProcDelegate(NewWndProc)
                        If (IntPtr.Size = 4) Then
                            Me.PrevWndProc = Form1.SetWindowLong(hwnd, GWL_WNDPROC, Me.wpd)
                        Else
                            Me.PrevWndProc = Form1.SetWindowLongPtr(hwnd, GWL_WNDPROC, Me.wpd)
                        End If
    
                        Return
                    End If
    
                    hwnd = Form1.GetWindow(hwnd, GW_HWNDNEXT)
    
                End While
    
            End Sub
    
            Private Function NewWndProc(ByVal hWnd As IntPtr, ByVal uMsg As UInteger, ByVal wParam As Integer, ByVal lParam As Integer) As Integer
                If (uMsg = WM_NCCALCSIZE) Then
                    Return 0
                End If
    
                Return Form1.CallWindowProc(Me.PrevWndProc, hWnd, uMsg, wParam, lParam)
            End Function
        End Class
    
    
    
記事No.88393 のレス /過去ログ152より / 関連記事表示
削除チェック/



<< 0 >>

パスワード/

- Child Tree -