, , , .
, ( ), , , .
, , . .
API Win32 :
INT_PTR DialogBox(
HINSTANCE hInstance,
LPCTSTR lpTemplate,
HWND hWndParent, /* this is the owner */
DLGPROC lpDialogFunc
);
int MessageBox(
HWND hWnd, /* this is the owner */
LPCTSTR lpText,
LPCTSTR lpCaption,
UINT uType
);
Similary, .NET WinForms, :
public DialogResult ShowDialog(
IWin32Window owner
)
public static DialogResult Show(
IWin32Window owner,
string text
)
, WinForms :
public void Show(
IWin32Window owner,
)
, :
form.Owner = this;
form.Show();
WinAPI :
HWND CreateWindow(
LPCTSTR lpClassName,
LPCTSTR lpWindowName,
DWORD dwStyle,
int x,
int y,
int nWidth,
int nHeight,
HWND hWndParent, /* this is the owner if dwStyle does not contain WS_CHILD */
HMENU hMenu,
HINSTANCE hInstance,
LPVOID lpParam
);
:
SetWindowLong(hWndPopup, GWL_HWNDPARENT, (LONG)hWndOwner);
(64- )
SetWindowLongPtr(hWndPopup, GWLP_HWNDPARENT, (LONG_PTR)hWndOwner);
, MSDN : SetWindowLong [Ptr]:
SetWindowLongPtr GWLP_HWNDPARENT, . SetParent.
, , -, , . . SetParent ( WS_CHILD), . - .