[WinAPI] Ce este o fereastra "owned"?

Folosire Windows API in programe C/C++ (forum moderat)
Post Reply
User avatar
Ovidiu Cucu
Fondator
Fondator
Posts: 3776
Joined: 11 Jul 2007, 16:10
Judet: Iaşi
Location: Iasi
Contact:

[WinAPI] Ce este o fereastra "owned"?

Post by Ovidiu Cucu » 27 Jan 2010, 10:56

Q: Ce este o fereastra owned?

A: O fereastra owned este o fereastra top-level care depinde de o alta fereastra numita owner.
Ea are urmatoarele proprietati:
  • fiind o fereastra top-level, poate fi afisata oriunde in ecran, indiferent de fereastra owner;
  • sta tot timpul in fata owner-ului.
  • este ascunsa atunci cand owner-ul este ascuns sau minimizat.
  • este distrusa atunci cand owner-ul este distrus;
Note
  • O fereastra owned este creata pasand un handle la owner ca parametru hWndParent in functia CreateWindow(Ex);
  • stilul WS_CHILD nu trebuie setat, altfel rezulta o fereastra child (copil) si nu o fereastra top-level.
Exemplu

Code: Select all

// create an owned top-level window
HWND hWnd = CreateWindow(szWindowClass, szTitle, 
              WS_OVERLAPPED, // WS_CHILD style is not set
              CW_USEDEFAULT, 0, CW_USEDEFAULT, 0, 
              hWndParent,    // handle to the OWNER window
              NULL, hInstance, NULL);

<< Back to Windows API Index



Post Reply