Don't is shown in figure 1 below, the effect of outline map 2.
Figure 1:
Figure 2:
Because customer service program to occupy A part of the interface of B to save space, so don't want to let other software window accidentally inserted in between the two shows that would be A rare amateur, hasn't been successful with set-top method, give advice or comments please
The sample code below, after the operation I don't know where is line window
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Declare Function SetParent Lib "user32" (ByVal hWndChild As Long, ByVal hWndNewParent As Long) As Long
Private Declare Function GetParent Lib "user32" (ByVal hWnd) As Long As Long
Private Type the RECT
Left As Long
Top As Long
Right As Long
Bottom As Long
End Type
Private Declare Function GetWindowRect Lib "user32" (ByVal hWnd As Long, lpRect As the RECT) As Long
Dim OriPHwnd
'//let just fill the client area of the notepad application form
Private Sub Cmd open notepad _Click ()
Notepad. Exe "Shell", vbNormalFocus' open notepad
End Sub
Private Sub Cmd cover _Click ()
'//parent window variable
Dim pHwnd As Long
Dim pRect As the RECT
Dim pHeight As Long
Dim pWidth As Long
Me. Cls
PHwnd=FindWindow (vbNullString, Text1. Text)
If pHwnd=0 Then
MsgBox "no form" "
The Else
GetWindowRect pHwnd, pRect
PHeight=pRect. Bottom - pRect. Top
PWidth=pRect. Right - pRect. Left
Me. Print "parent window wide high:"
Me. Print "width=" & amp; PWidth
Me. Print "height=" & amp; PHeight
Me. Print "parent window coordinates:
"Me. Print "left, top=(" & amp; PRect. Left & amp; ", "& amp; PRect. Top & amp;
")"Me. Print "right, top=(" & amp; PRect. Right & amp; ", "& amp; PRect. Top & amp;
")"Me. Print "right, bottom=(" & amp; PRect. Right & amp; ", "& amp; PRect. Bottom & amp;
")"Me. Print "left, bottom=(" & amp; PRect. Left & amp; ", "& amp; PRect. Bottom & amp;
")"
OriPHwnd=SetParent (hWnd. Me., pHwnd) 'set the target window as the parent window
Me. Top=pRect. Top
Me. Left=pRect. Left
Me. Width=pWidth
Me. Height=pHeight
End the If
End Sub
Private Sub Cmd restore _Click ()
SetParent npad oParent, 'the relationships window to restore the original
End Sub
The following interface
CodePudding user response:
Under the roof to see ~ ~