[win32] Premier plan sans focus

Résolu
Isoth0p Messages postés 42 Date d'inscription jeudi 17 juin 2004 Statut Membre Dernière intervention 15 septembre 2005 - 10 juin 2005 à 18:58
Isoth0p Messages postés 42 Date d'inscription jeudi 17 juin 2004 Statut Membre Dernière intervention 15 septembre 2005 - 10 juin 2005 à 19:55
Bonjour, je voudrais savoir comment faudrait-il faire pour placer au premier plan une application SANS qu'elle prenne le focus. Existe-t-il une fonction ? Si non, comment faire ?

6 réponses

vecchio56 Messages postés 6535 Date d'inscription lundi 16 décembre 2002 Statut Membre Dernière intervention 22 août 2010 14
10 juin 2005 à 19:29
Il existe un truc pour ca, il suffit de mettre le style étendu WS_EX_TOPMOST

Tu créer ta fenêtre comme ca:

CreateWindow(WS_EX_TOPMOST, ...le reste ne change pas
3
Isoth0p Messages postés 42 Date d'inscription jeudi 17 juin 2004 Statut Membre Dernière intervention 15 septembre 2005
10 juin 2005 à 19:55
Merci !

Petite précision, il s'agit de CreateWindowEx( WS_EX_TOPMOST, ...
3
vecchio56 Messages postés 6535 Date d'inscription lundi 16 décembre 2002 Statut Membre Dernière intervention 22 août 2010 14
10 juin 2005 à 19:14
Au hasard:

SetWindowPos(hWnd, HWND_TOP, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE); <link href="../../../../../css/ie4.css" type="text/css" rel="stylesheet"><!-- @ --><link href="../../../../../css/inetsdk.css" type="text/css" rel="stylesheet"><!-- @ --><style type="text/css">
PRE.clsCode { font-size:110%; }
PRE.clsSyntax { font-size:100%; }
TD DIV.clsBeta { display:none;}

A:link { color:#0000ff; text-decoration:underline;}
A:visited { color:#0000ff; text-decoration:underline;}
A:hover { color:#3366ff; text-decoration:underline;}
MSHelp\:link {
color:#0000ff;
text-decoration:underline;
cursor:hand;
hoverColor:#3366ff;
filterString: ;}
</style><link href="ms-help://Hx/HxRuntime/HxLink.css" type="text/css" rel="stylesheet"><XML id="_topicdata" pagetype="function" proj="WinUIHXS" name="SetWindowPos" pubpath="/WinUI/WindowsUserInterface/Windowing/Windows/WindowReference/WindowFunctions/SetWindowPos.htm"><!-- topic data --><root></root></XML><xml xmlns:mshelp="http://msdn.microsoft.com/mshelp"></xml>
<dd><dl><dd><dl><dt>
</dd></dl></dd></dl>
0
Isoth0p Messages postés 42 Date d'inscription jeudi 17 juin 2004 Statut Membre Dernière intervention 15 septembre 2005
10 juin 2005 à 19:19
Merci mais... ça marche pas, ou du moins je ne sais pas le faire marcher !

J'ai fait ceci :

LRESULT CALLBACK WindowProcedure( HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam )

{

HDC hdc;



switch ( message )

{

case WM_KILLFOCUS:

SetWindowPos(
hwnd, HWND_TOP, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE );

break;



case WM_DESTROY:

PostQuitMessage (0);

break;



default:

return DefWindowProc( hwnd, message, wParam, lParam );

}



return 0;

}


Peut eutre que je ne devrais alors pas le
placer dans WM_KILLFOCUS, mais j'ai rien trouvé d'autre... Si quelqu'un
aurait la réponse ...
0

Vous n’avez pas trouvé la réponse que vous recherchez ?

Posez votre question
vecchio56 Messages postés 6535 Date d'inscription lundi 16 décembre 2002 Statut Membre Dernière intervention 22 août 2010 14
10 juin 2005 à 19:23
Qu'est ce que tu recherches comme comportement exactement?
0
Isoth0p Messages postés 42 Date d'inscription jeudi 17 juin 2004 Statut Membre Dernière intervention 15 septembre 2005
10 juin 2005 à 19:27
Je cherche à faire en sorte que la fenêtre se comporte comme le Gestionnaire des tâches de Windows (Ctrl+Alt+Suppr).
0
Rejoignez-nous