Forum |  HardWare.fr | News | Articles | PC | S'identifier | S'inscrire | Shop Recherche
500 connectés 

  FORUM HardWare.fr
  Programmation

  nedded aide en vc++ et API windows

 


 Mot :   Pseudo :  
 
Bas de page
Auteur Sujet :

nedded aide en vc++ et API windows

n°100247
bouteilled​o
Posté le 14-02-2002 à 11:55:09  profilanswer
 

(c pour un copin à moi):
voila ce que je doit faire :
 
appeller la fonction SetSysColors de user32.dll dans un programme C/C++ (si
possible sans fenetre apparente)...
 
En VB ca donne ca:
 
 
Private Declare Function SetSysColors Lib "user32.dll" (ByVal cElements As
Long, lpaElements As Long, lpaRgbValues As Long) As Long
 
Const COLOR_3DHILIGHT = 20
Const COLOR_3DLIGHT = 21
Const COLOR_3DSHADOW = 16
Const COLOR_GRAYTEXT = 17
--------------------------------------------------
--------------------------
-----------------
Private Sub Command1_Click()
    Dim retval As Long
    retval = SetSysColors(1, COLOR_GRAYTEXT, RGB(0, 0, 0))
    retval = SetSysColors(1, COLOR_3DSHADOW, RGB(50, 50, 50))
    retval = SetSysColors(1, COLOR_3DLIGHT, RGB(150, 150, 150))
    retval = SetSysColors(1, COLOR_3DHILIGHT, RGB(240, 240, 240))
End Sub
 
 
 
MAis comme on a pas les licences VB comment appeler cette api a partir cd vc++ ?
Merci d'avance

mood
Publicité
Posté le 14-02-2002 à 11:55:09  profilanswer
 

n°100276
Carbon_14
Posté le 14-02-2002 à 13:02:20  profilanswer
 

Les API, elles s'appellent directement, il me semble (je suis comme Mr Jourdain, j'utilise les API sans me questionner).
 
BOOL WINAPI SetSysColors(
    int cElements, // number of elements to change  
    CONST INT *lpaElements, // address of array of elements  
    CONST COLORREF *lpaRgbValues  // address of array of RGB values  
   );
 
La valeur de retour ne semblerait pas être un long (mais ça gène pas trop car null si succès, non nul si échec de la fonction).
 
Il semble qu'il faudrait ajouter  
#include <winuser.h>
 
// Utilisation
 
  BOOL retval;  
   retval = SetSysColors(1, COLOR_GRAYTEXT, RGB(0, 0, 0));  
   retval = SetSysColors(1, COLOR_3DSHADOW, RGB(50, 50, 50));  
   retval = SetSysColors(1, COLOR_3DLIGHT, RGB(150, 150, 150));  
   retval = SetSysColors(1, COLOR_3DHILIGHT, RGB(240, 240, 240));  
 
Si les constantes ne sont pas définies par Windows
#define COLOR_3DHILIGHT 20  
#define COLOR_3DLIGHT 21  
#define COLOR_3DSHADOW 16  
#define COLOR_GRAYTEXT 17

n°100288
bouteilled​o
Posté le 14-02-2002 à 13:17:48  profilanswer
 

merci bcp pour ton aide. Je lui transmet tout ca..


Aller à :
Ajouter une réponse
  FORUM HardWare.fr
  Programmation

  nedded aide en vc++ et API windows

 

Sujets relatifs
petite aide souhaitée: sur un script vb outlook (no piracy)SNMP API?
besoin d aide pour un codebesoin d aide pour access!!!!!!!!!!
[PERL] Faire du PERL avec Windows Xp[PHP] Aide d'un novice!
[VB6] Détection Windows XP 2000 NT / Windows Me 98 95[ API ] structure DCB ???port serie
aide sur objet CFileFind[Java] Exception in thread "main" sous Windows et pas sous linux ???
Plus de sujets relatifs à : nedded aide en vc++ et API windows


Copyright © 1997-2022 Hardware.fr SARL (Signaler un contenu illicite / Données personnelles) / Groupe LDLC / Shop HFR