Redimensionner et repositionner Windows Explorer

Résolu
Hijesse Messages postés 11 Date d'inscription samedi 2 août 2003 Statut Membre Dernière intervention 26 octobre 2010 - 10 mars 2005 à 15:10
Hijesse Messages postés 11 Date d'inscription samedi 2 août 2003 Statut Membre Dernière intervention 26 octobre 2010 - 11 mars 2005 à 09:00
Bonjour à tous,

je souhaiterais connaître comment après 2 ouvertures de Windows Explorer, la 1er fenêtre
se positionne à gauche avec une dimension de moyen de l'écran et le 2eme fenêtre à droite avec la même dimension.

merçi d'avance
Hijesse

2 réponses

retaks666 Messages postés 286 Date d'inscription jeudi 2 janvier 2003 Statut Membre Dernière intervention 16 juillet 2007
10 mars 2005 à 16:26
il faut utiliser la fonction setwindowpos:

BOOL SetWindowPos(

HWND hWnd,
HWND hWndInsertAfter,
int X,
int Y,
int cx,
int cy,
UINT uFlags
);




* hWnd :
[in] Handle to the window. * hWndInsertAfter :
[in] Handle to the window to precede the positioned window in the Z
order. This parameter must be a window handle or one of the following
values.<dl> * :

<dl> * : HWND_BOTTOM<dd>Places the window at the bottom of the Z order. If the hWnd parameter identifies a topmost window, the window loses its topmost status and is placed at the bottom of all other windows. * : HWND_NOTOPMOST<dd>Places
the window above all non-topmost windows (that is, behind all topmost
windows). This flag has no effect if the window is already a
non-topmost window. * : HWND_TOP<dd>Places the window at the top of the Z order. * : HWND_TOPMOST<dd>Places the window above all non-topmost windows. The window maintains its topmost position even when it is deactivated.
</dd><dt>

</dt><dd>For more information about how this parameter is used, see the following Remarks section.</dd></dl></dd><dt>X</dt><dd>
[in] Specifies the new position of the left side of the window, in client coordinates. </dd><dt>Y</dt><dd>
[in] Specifies the new position of the top of the window, in client coordinates. </dd><dt>cx</dt><dd>
[in] Specifies the new width of the window, in pixels. </dd><dt>cy</dt><dd>
[in] Specifies the new height of the window, in pixels. </dd><dt>uFlags</dt><dd>
[in] Specifies the window sizing and positioning flags. This parameter can be a combination of the following values. * : SWP_ASYNCWINDOWPOSIf
the calling thread and the thread that owns the window are attached to
different input queues, the system posts the request to the thread that
owns the window. This prevents the calling thread from blocking its
execution while other threads process the request. * : SWP_DEFERERASEPrevents generation of the WM_SYNCPAINT message. * : SWP_DRAWFRAME<dd>Draws a frame (defined in the window's class description) around the window. * : SWP_FRAMECHANGED<dd>Applies new frame styles set using the SetWindowLong function. Sends a WM_NCCALCSIZE message to the window, even if the window's size is not being changed. If this flag is not specified, WM_NCCALCSIZE is sent only when the window's size is being changed. * : SWP_HIDEWINDOW<dd>Hides the window. * : SWP_NOACTIVATE<dd>Does
not activate the window. If this flag is not set, the window is
activated and moved to the top of either the topmost or non-topmost
group (depending on the setting of the hWndInsertAfter parameter). * : SWP_NOCOPYBITSDiscards
the entire contents of the client area. If this flag is not specified,
the valid contents of the client area are saved and copied back into
the client area after the window is sized or repositioned. * : SWP_NOMOVERetains the current position (ignores X and Y parameters). * : SWP_NOOWNERZORDER<dd>Does not change the owner window's position in the Z order. * : SWP_NOREDRAW<dd>Does
not redraw changes. If this flag is set, no repainting of any kind
occurs. This applies to the client area, the nonclient area (including
the title bar and scroll bars), and any part of the parent window
uncovered as a result of the window being moved. When this flag is set,
the application must explicitly invalidate or redraw any parts of the
window and parent window that need redrawing. * : SWP_NOREPOSITION<dd>Same as the SWP_NOOWNERZORDER flag. * : SWP_NOSENDCHANGING<dd>Prevents the window from receiving the WM_WINDOWPOSCHANGING message. * : SWP_NOSIZE<dd>Retains the current size (ignores the cx and cy parameters). * : SWP_NOZORDER<dd>Retains the current Z order (ignores the hWndInsertAfter parameter). * : SWP_SHOWWINDOW<dd>Displays the window.
</dd></dl>


exemple:
SetWindowPos(handle, Hwnd_NoTopmost, Left, Top, Width, Height,0);






Plus d'infos ici:



http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winui/winui/windowsuserinterface/windowing/windows/windowreference/windowfunctions/setwindowpos.asp
3
Hijesse Messages postés 11 Date d'inscription samedi 2 août 2003 Statut Membre Dernière intervention 26 octobre 2010
11 mars 2005 à 09:00
Merçi pour ton aide

Hijesse
0
Rejoignez-nous