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

  1. #1
    Membre à l'essai
    Inscrit en
    Août 2002
    Messages
    31
    Détails du profil
    Informations forums :
    Inscription : Août 2002
    Messages : 31
    Points : 24
    Points
    24
    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
    Points : 16 075
    Points
    16 075
    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
    Points : 17 323
    Points
    17 323
    Par défaut
    voir post it sur la faq:
    http://www.developpez.net/forums/vie...095234#1095234
    le traitement est identique.

  4. #4
    Membre à l'essai
    Inscrit en
    Août 2002
    Messages
    31
    Détails du profil
    Informations forums :
    Inscription : Août 2002
    Messages : 31
    Points : 24
    Points
    24
    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 : 44
    Localisation : France, Val de Marne (Île de France)

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

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

  6. #6
    Membre habitué
    Inscrit en
    Juillet 2003
    Messages
    196
    Détails du profil
    Informations forums :
    Inscription : Juillet 2003
    Messages : 196
    Points : 165
    Points
    165
    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 à l'essai
    Inscrit en
    Août 2002
    Messages
    31
    Détails du profil
    Informations forums :
    Inscription : Août 2002
    Messages : 31
    Points : 24
    Points
    24
    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
    Points : 17 323
    Points
    17 323
    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