Twitter iPhone pliant OnePlus 11 PS5 Disney+ Orange Livebox Windows 11

Enlever et remettre une barre de titre d'une fenêtre

6 réponses
Avatar
Michael
Bonsoir,

j'ai un petit souci lorsque je veux mettre une fenêtre en plein écran.

Quand je la mets en plein écran, j'enlève la barre de titre, ainsi que
les bords de la fenêtre:

SetWindowLong(Handle, GWL_STYLE, GetWindowLong(Handle,GWL_STYLE)
&~WS_CAPTION);
SetWindowLong(Handle, GWL_STYLE, GetWindowLong(Handle,GWL_STYLE)
&~WS_THICKFRAME);
SetWindowLong(Handle, GWL_STYLE, GetWindowLong(Handle,GWL_STYLE)
&~WS_EX_CLIENTEDGE);

int nX = GetSystemMetrics( SM_CXSCREEN );
int nY = GetSystemMetrics( SM_CYSCREEN );

SetWindowPos(Handle, HWND_TOP, 0, 0, nX, nY, 0 );

Quand je veux remettre la fenêtre à sa position initiale:

//On remet la fenêtre à sa place
SetWindowPos(Handle,HWND_TOP,
taille_video.position.left,
taille_video.position.top,
taille_video.position.right,
taille_video.position.bottom,NULL);

SetWindowLong(Handle, GWL_STYLE, GetWindowLong(Handle,GWL_STYLE)
&~WS_CAPTION);
SetWindowLong(Handle, GWL_STYLE, GetWindowLong(Handle,GWL_STYLE)
&~WS_THICKFRAME);
SetWindowLong(Handle, GWL_STYLE, GetWindowLong(Handle,GWL_STYLE)
&~WS_EX_CLIENTEDGE);

RedrawWindow(Handle,NULL, 0, RDW_INVALIDATE | RDW_FRAME | RDW_UPDATENOW);

Seulement les SetWindowLong pour le basculement en fenêtre normale ne
fonctionnent pas...

J'ai essayé SetWindowLong(Handle, GWL_STYLE,WS_CAPTION) sans succès
également.

Comment je peux faire ça?

Merci d'avance

Mike

6 réponses

Avatar
Michael
Bon je viens de trouver (comme d'hab, c'est après avoir posé la question qu'on trouve tout seul la réponse)

SetWindowLong(Handle, GWL_STYLE, GetWindowLong(Handle,GWL_STYLE) | WS_CAPTION);
SetWindowLong(Handle, GWL_STYLE, GetWindowLong(Handle,GWL_STYLE) | WS_THICKFRAME);
SetWindowLong(Handle, GWL_STYLE, GetWindowLong(Handle,GWL_STYLE) | WS_EX_CLIENTEDGE);

RedrawWindow(Handle,NULL, 0, RDW_INVALIDATE | RDW_FRAME | RDW_UPDATENOW);
Avatar
Christian ASTOR
Michael a écrit :

Bon je viens de trouver (comme d'hab, c'est après avoir posé la quest ion qu'on trouve tout seul la réponse)

SetWindowLong(Handle, GWL_STYLE, GetWindowLong(Handle,GWL_STYLE) | WS_CAP TION);
SetWindowLong(Handle, GWL_STYLE, GetWindowLong(Handle,GWL_STYLE) | WS_THI CKFRAME);
SetWindowLong(Handle, GWL_STYLE, GetWindowLong(Handle,GWL_STYLE) | WS_EX_ CLIENTEDGE);



BTW, ce n'est pas la peine d'appeler 3 fois la fonction...
Avatar
Christian ASTOR
Christian ASTOR a écrit :

> SetWindowLong(Handle, GWL_STYLE, GetWindowLong(Handle,GWL_STYLE) | WS_E X_CLIENTEDGE);



... et GWL_EXSTYLE
Avatar
Arnold McDonald \(AMcD\)
Christian ASTOR wrote:

BTW, ce n'est pas la peine d'appeler 3 fois la fonction...



Ton style télégraphique te perdra :-). Détaille pour nos amis débutants...

SetWindowLong(Handle, GWL_STYLE, GetWindowLong(Handle,GWL_STYLE)
|(WS_CAPTION|WS_THICKFRAME|WS_EX_CLIENTEDGE));

--
Arnold McDonald (AMcD) - Help #44/2006

http://arnold.mcdonald.free.fr/
Avatar
Arnold McDonald \(AMcD\)
Plutôt :

SetWindowLong(Handle, GWL_STYLE, GetWindowLong(Handle,GWL_STYLE)
(WS_CAPTION|WS_THICKFRAME|WS_EX_CLIENTEDGE));

PS : Mort à OE-Quotefix

--
Arnold McDonald (AMcD)

http://arnold.mcdonald.free.fr/
Avatar
Michael
Merci à tous les deux pour vos réponses :)