IdentifiantMot de passe
Loading...
Mot de passe oubli� ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les r�ponses en temps r�el, voter pour les messages, poser vos propres questions et recevoir la newsletter

MFC Discussion :

[MFC] Comment et o� sp�cifier la taille de ma fen�tre ?


Sujet :

MFC

Vue hybride

Message pr�c�dent Message pr�c�dent   Message suivant Message suivant
  1. #1
    Membre averti
    Inscrit en
    Ao�t 2002
    Messages
    31
    D�tails du profil
    Informations forums :
    Inscription : Ao�t 2002
    Messages : 31
    Par d�faut [MFC] Comment et o� sp�cifier la taille de ma fen�tre ?
    Bonjour

    Je souhaite sp�cifier la taille de ma fen�tre lorsque mon appli se lance.
    Si vous savez quelle m�thode appeller et o� l'appeller, merci de laisser un post !

  2. #2
    R�dacteur
    Avatar de nico-pyright(c)
    Profil pro
    Inscrit en
    Octobre 2003
    Messages
    6 414
    D�tails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Octobre 2003
    Messages : 6 414
    Par d�faut
    Salut, apr�s sa cr�ation :
    Code : S�lectionner tout - Visualiser dans une fen�tre � part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    SetWindowPos
    The SetWindowPos function changes the size, position, and Z order of a child, pop-up, or top-level window. Child, pop-up, and top-level windows are ordered according to their appearance on the screen. The topmost window receives the highest rank and is the first window in the Z order. 
     
    BOOL SetWindowPos(
      HWND hWnd,             // handle to window
      HWND hWndInsertAfter,  // placement-order handle
      int X,                 // horizontal position
      int Y,                 // vertical position
      int cx,                // width
      int cy,                // height
      UINT uFlags            // window-positioning options
    );

  3. #3
    R�dacteur
    Avatar de farscape
    Homme Profil pro
    D�veloppeur informatique
    Inscrit en
    Novembre 2003
    Messages
    9 055
    D�tails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Alpes Maritimes (Provence Alpes C�te d'Azur)

    Informations professionnelles :
    Activit� : D�veloppeur informatique
    Secteur : High Tech - �diteur de logiciels

    Informations forums :
    Inscription : Novembre 2003
    Messages : 9 055
    Par d�faut
    voir post it sur la faq:
    http://www.developpez.net/forums/vie...095234#1095234
    le traitement est identique.

  4. #4
    Membre averti
    Inscrit en
    Ao�t 2002
    Messages
    31
    D�tails du profil
    Informations forums :
    Inscription : Ao�t 2002
    Messages : 31
    Par d�faut
    Citation Envoy� par nicolashilaire
    Salut, apr�s sa cr�ation :
    Code : S�lectionner tout - Visualiser dans une fen�tre � part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    SetWindowPos
    The SetWindowPos function changes the size, position, and Z order of a child, pop-up, or top-level window. Child, pop-up, and top-level windows are ordered according to their appearance on the screen. The topmost window receives the highest rank and is the first window in the Z order. 
     
    BOOL SetWindowPos(
      HWND hWnd,             // handle to window
      HWND hWndInsertAfter,  // placement-order handle
      int X,                 // horizontal position
      int Y,                 // vertical position
      int cx,                // width
      int cy,                // height
      UINT uFlags            // window-positioning options
    );
    Merci pour la m�thode.
    Par contre, cet appel intervient au niveau de quelle m�thode ? OnCreate ? OnInit ? une autre ?

  5. #5
    R�dacteur
    Avatar de bigboomshakala
    Homme Profil pro
    Consultant Web .NET
    Inscrit en
    Avril 2004
    Messages
    2 077
    D�tails du profil
    Informations personnelles :
    Sexe : Homme
    �ge : 45
    Localisation : France, Val de Marne (�le de France)

    Informations professionnelles :
    Activit� : Consultant Web .NET
    Secteur : Finance

    Informations forums :
    Inscription : Avril 2004
    Messages : 2 077
    Par d�faut
    Citation Envoy� par nicolashilaire
    Salut, apr�s sa cr�ation [...]
    donc pas dans OnCreate

  6. #6
    Membre confirm�
    Inscrit en
    Juillet 2003
    Messages
    196
    D�tails du profil
    Informations forums :
    Inscription : Juillet 2003
    Messages : 196
    Par d�faut
    Slt


    Code : S�lectionner tout - Visualiser dans une fen�tre � part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs)
    {
    	if( !CFrameWnd::PreCreateWindow(cs) )
    		return FALSE;
    	// TODO: Modify the Window class or styles here by modifying
    	//  the CREATESTRUCT cs
     
                   cs.cx = 640;
                   cs.cy = 480
     
    	return TRUE;
    }

  7. #7
    Membre averti
    Inscrit en
    Ao�t 2002
    Messages
    31
    D�tails du profil
    Informations forums :
    Inscription : Ao�t 2002
    Messages : 31
    Par d�faut
    Citation Envoy� par LDDL
    Slt


    Code : S�lectionner tout - Visualiser dans une fen�tre � part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs)
    {
    	if( !CFrameWnd::PreCreateWindow(cs) )
    		return FALSE;
    	// TODO: Modify the Window class or styles here by modifying
    	//  the CREATESTRUCT cs
     
                   cs.cx = 640;
                   cs.cy = 480
     
    	return TRUE;
    }
    nickel �a marche bien !
    Pour sp�cifier le contenu d'une Liste Box, je fais �a au m�me endroit ?

  8. #8
    R�dacteur
    Avatar de farscape
    Homme Profil pro
    D�veloppeur informatique
    Inscrit en
    Novembre 2003
    Messages
    9 055
    D�tails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Alpes Maritimes (Provence Alpes C�te d'Azur)

    Informations professionnelles :
    Activit� : D�veloppeur informatique
    Secteur : High Tech - �diteur de logiciels

    Informations forums :
    Inscription : Novembre 2003
    Messages : 9 055
    Par d�faut
    non ,
    dans la fonction OninitialUpdate de la view.

+ R�pondre � la discussion
Cette discussion est r�solue.

Discussions similaires

  1. R�ponses: 4
    Dernier message: 19/06/2008, 15h30
  2. R�ponses: 2
    Dernier message: 14/09/2005, 23h11
  3. R�ponses: 4
    Dernier message: 14/06/2004, 09h29
  4. R�ponses: 2
    Dernier message: 30/01/2004, 14h07
  5. comment r�duire une image jpeg (taille x*y)
    Par don-diego dans le forum C
    R�ponses: 4
    Dernier message: 14/07/2002, 20h06

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo