Précédent   Forum du club des développeurs et IT Pro > Dotnet > Développement Windows
Développement Windows Forum d'entraide sur les technologies d'interface Windows de Microsoft (Winforms, Windows Presentation Foundation, etc.).
Partagez cette discussion sur d'autres réseaux sociaux : Viadeo Twitter Google Facebook Digg Delicious MySpace Yahoo
Réponse
 
Outils de la discussion
Publicité
'
Vieux 15/12/2011, 12h13   #1
raggnic
Invité de passage
 
Inscription : novembre 2008
Messages : 5
Détails du profil
Informations forums :
Inscription : novembre 2008
Messages : 5
Points : 0
Points : 0
Par défaut Mode plein écran pour une application

Bonjour

J'espère que j'ai choisi la bonne catégorie
J'ai un mode plein écran pour une application sur laquelle je bosse (une sorte de SIG). ça marche bien, sauf si la fenêtre est maximisee, là la fenetre n'est pas en plein écran il reste la barre des taches.
Ma solution est d'enlever le mode maximisé avec un ShowWindow(..., SW_RESTORE), mais du coup on voit la fenêtre bouger ce n'est pas très joli, meme avec le HIDE/SHOW.

Y a t'il un autre moyen de procéder? J'ai aussi essayé un LockWindowUpdate mais ça n'apporte rien

Code :
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
 
void
    FenetreSrv::SwitchFullScreen(void)
    {
 
      HWND hwnd = (HWND)getSystemView();
 
 
    //Si la fenetre est maximisee on la reduit
   ::ShowWindow(hwnd, SW_RESTORE);
 
      //on commence par cacher la fenetre
      ::ShowWindow(hwnd, SW_HIDE);
 
      long style = ::GetWindowLong(hwnd, GWL_STYLE);
 
      if(_fullScreen)
      {
 
	updatePanes(IlTrue);
 
 
    	//restaure le style par defaut
      	style &= ~WS_POPUP;
      	style |= WS_OVERLAPPEDWINDOW;
 
      	::SetWindowLong(hwnd,GWL_STYLE,style);
 
      	//restaure la position sauvegardee
      	::SetWindowPos(hwnd,
      			HWND_TOP,
      			_previousRect.left,
      			_previousRect.top,
      			_previousRect.right-_previousRect.left,
      			_previousRect.bottom-_previousRect.top,
      			SWP_FRAMECHANGED);
 
 
      }
      else
      {
 
 
    	  //sauve la taille actuelle.
    	  ::GetWindowRect(hwnd,&_previousRect);
 
    	  //passe en style popup, et degage la barre de titre
    	  style &= ~WS_OVERLAPPEDWINDOW;
    	  style |= WS_POPUP;
 
 
	  //  prise en compte du multi écran
    	  //occupe la totalite de l'ecran courant (ou par defaut le 1er)
	  HMONITOR monitor;
	  monitor =  MonitorFromWindow( hwnd, MONITOR_DEFAULTTOPRIMARY);
 
	  MONITORINFO monitorInfo;
 
	  monitorInfo.cbSize = sizeof(MONITORINFO); //obligatoire de fixer la valeur avant l'appel à GetMonitorInfo
 
	  ::GetMonitorInfo(monitor,  // handle to display monitor
			   &monitorInfo );  // display monitor information 
 
	  int mx = monitorInfo.rcMonitor.left; 
	  int my = monitorInfo.rcMonitor.top; 
	  int mw = monitorInfo.rcMonitor.right; 
	  int mh = monitorInfo.rcMonitor.bottom; 
 
 
 
 
	  //ne pas employer le style topmost, qui va creer des problemes avec les boites de dialogue
	  //::SetWindowPos(hwnd,HWND_TOPMOST,0,0,mx,my,SWP_FRAMECHANGED);
 
 
	  ::SetWindowPos(hwnd,HWND_TOP,mx,my,mw-mx,mh-my,SWP_ASYNCWINDOWPOS);
 
 
 
	  ::SetWindowLong(hwnd,GWL_STYLE,style);
      }
 
 
      _fullScreen = !_fullScreen;
 
 
     ::ShowWindow(hwnd, SW_SHOW);
 
 
 
    }
raggnic est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 05/11/2012, 10h35   #2
Piet
Membre régulier
 
Avatar de Piet
 
Pierre Liétar
Inscription : décembre 2004
Messages : 111
Détails du profil
Informations personnelles :
Nom : Pierre Liétar
Âge : 30

Informations forums :
Inscription : décembre 2004
Messages : 111
Points : 91
Points : 91
Bonjour,

Avez-vous déjà testé ceci au niveau de la form :

Code :
1
2
this.Bounds = Screen.PrimaryScreen.Bounds;
this.TopMost = true;
Elle devrait passer au dessus de la barre des tâches et être en véritable plein écran.

Bonne journée.

EDIT : Je pense que la fenêtre ne doit pas être dans un état maximisé pour que ce soit fonctionnel.
__________________
Piet
Piet est déconnecté   Envoyer un message privé Réponse avec citation 00
Réponse
Outils de la discussion

Navigation rapide


Fuseau horaire GMT +2. Il est actuellement 12h35.


 
 
 
 
Partenaires

Hébergement Web