Désolé c'est un peu long à lire, j'ai une fenêtre nommé PR qui contient 3 listbox (1,2,3) et Deux boutons ok et Annuler, je souhaite que lorsque je clique sur mécanique l'application affiche dans le listbox 2 "10 Moteur"....

variables membres classe CPR:

Cstring m_strList1
CListBox m_ctlList1
Cstring m_strList2
CListBox m_ctlList2
Cstring m_strList3
CListBox m_ctlList3

Le code ci dessous fonctionne mais j'affiche en cliquant sur mécanique à la fois la mécanique, la carrosserie, la sellerie. dans la listbox 2

La dexiéme question: Comment afficher une fenêtre avant le lancement de l'application pendant quelque secondes comme lorque l'on lance Adobe Acrobat par exemple.


Merci par avance pour Aide

Chris

Code : Sélectionner tout - Visualiser dans une fenêtre à part
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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
BOOL CPR::OnInitDialog() 
{
	CListBox* pLB = (CListBox*)GetDlgItem(IDC_LISTPR1);
	pLB->InsertString(-1,"Mécanique");
	pLB->InsertString(-1,"Carrosserie");
	pLB->InsertString(-1,"Sellerie et Electricité");
 
	return CDialog::OnInitDialog();
	              // EXCEPTION: OCX Property Pages should return FALSE
}
 
void CPR::OnSelchangeListpr1() 
{
	if(m_strList1="Mécanique")
	{
		CListBox* pLBm = (CListBox*)GetDlgItem(IDC_LISTPR2);
		pLBm->InsertString(-1,"10 Moteur");
		pLBm->InsertString(-1,"11 Haut moteur");
		pLBm->InsertString(-1,"12 Carburation");
		pLBm->InsertString(-1,"13 Alimentation");
		pLBm->InsertString(-1,"14 Antipollution");
		pLBm->InsertString(-1,"16 Démarrage Charge");
		pLBm->InsertString(-1,"17 Allumage");
		pLBm->InsertString(-1,"19 Refroidissement -  Reservoirs -  Echappement - Support moteur");
		pLBm->InsertString(-1,"20 Embrayage");
		pLBm->InsertString(-1,"21 Boite de vitesses  mécanique");
		pLBm->InsertString(-1,"29 Transmission");
		pLBm->InsertString(-1,"31 Elements porteurs avant");
		pLBm->InsertString(-1,"32 Elements non porteurs avant");
		pLBm->InsertString(-1,"33 Elements porteurs arriere");
		pLBm->InsertString(-1,"34 Element non porteurs arriere");
		pLBm->InsertString(-1,"35 Roues Pneumatiques");
		pLBm->InsertString(-1,"36 Direction");
		pLBm->InsertString(-1,"37 Commandes aux pieds");
		pLBm->InsertString(-1,"38 Commandes à main");
		pLBm->InsertString(-1,"90 Cric Petites fournitures");
	}
	if(m_strList1="Carrosserie")
	{
		CListBox* pLBm = (CListBox*)GetDlgItem(IDC_LISTPR2);
		pLBm->InsertString(-1,"40 Gros units carrosserie");
		pLBm->InsertString(-1,"41 Units inférieurs");
		pLBm->InsertString(-1,"42 Units intérieurs avant");
		pLBm->InsertString(-1,"43 Units latéraux fixes");
		pLBm->InsertString(-1,"44 Units intérieurs arrière");
		pLBm->InsertString(-1,"45 Units supérieurs");
		pLBm->InsertString(-1,"46 Ailes et carters protection");
		pLBm->InsertString(-1,"47 Ouvrant latéraux");
		pLBm->InsertString(-1,"48 Ouvrant non latéraux");
		pLBm->InsertString(-1,"50 Mécanismes");
		pLBm->InsertString(-1,"52 Equilibreurs de porte hayon ou coffre");
		pLBm->InsertString(-1,"53 Barillet de serrure");
		pLBm->InsertString(-1,"54 Vitres");
		pLBm->InsertString(-1,"55 Protection - Enjoliveurs extérieurs");
		pLBm->InsertString(-1,"56 Accessoires extérieurs divers");
	}	
}
 
void CPR::OnSelchangeListpr2() 
{
	if(m_strList2="10Moteur")
	{
		CListBox* pLBm = (CListBox*)GetDlgItem(IDC_LISTPR3);
		pLBm->InsertString(-1,"01Moteur complet");
		pLBm->InsertString(-1,"02Joints moteur");
		pLBm->InsertString(-1,"03Chemises pistons");
		pLBm->InsertString(-1,"04Coussinets - Paliers");
		pLBm->InsertString(-1,"05Carter cylindres");
		pLBm->InsertString(-1,"06Carter d'huile");
		pLBm->InsertString(-1,"07Vilebrequin");
		pLBm->InsertString(-1,"08Pompe a huile");
		pLBm->InsertString(-1,"09Filtre a huile");
	}
	if(m_strList2="11Haut moteur")
	{
		CListBox* pLBm = (CListBox*)GetDlgItem(IDC_LISTPR3);
		pLBm->InsertString(-1,"01Distribution");
		pLBm->InsertString(-1,"02Pompe a eau");
		pLBm->InsertString(-1,"03Cache culbuteurs -  Culasse");
	}
	if(m_strList2="12Carburation")
	{
		CListBox* pLBm = (CListBox*)GetDlgItem(IDC_LISTPR3);
		pLBm->InsertString(-1,"01Collecteur");
		pLBm->InsertString(-1,"02Carburateur");
		pLBm->InsertString(-1,"03Rechauffage - Refroidissement huile ou carburant");
		pLBm->InsertString(-1,"04Refroidissement carburateur");
	}
	if(m_strList2="13Alimentation")
	{
		CListBox* pLBm = (CListBox*)GetDlgItem(IDC_LISTPR3);
		pLBm->InsertString(-1,"01Pompe a essence");
		pLBm->InsertString(-1,"02Filtre a air");
		pLBm->InsertString(-1,"03Tuyauterie filtre à air");
		pLBm->InsertString(-1,"04Turbo");
	}
	if(m_strList2="14Antipollution")
	{
		CListBox* pLBm = (CListBox*)GetDlgItem(IDC_LISTPR3);
		pLBm->InsertString(-1,"01Antipollution");
	}
	if(m_strList2="16Démarrage Charge")
	{
		CListBox* pLBm = (CListBox*)GetDlgItem(IDC_LISTPR3);
		pLBm->InsertString(-1,"01Alternateur - Demarreur");
	}
	if(m_strList2="17Allumage")
	{
		CListBox* pLBm = (CListBox*)GetDlgItem(IDC_LISTPR3);
		pLBm->InsertString(-1,"01Allumeur");
		pLBm->InsertString(-1,"02Bobine d'allumage");
		pLBm->InsertString(-1,"03Bougies");
	}
	if(m_strList2="19Refroidissement -  Reservoirs -  Echappement - Support moteur")
	{
		CListBox* pLBm = (CListBox*)GetDlgItem(IDC_LISTPR3);
		pLBm->InsertString(-1,"01Radiateur d'eau");
		pLBm->InsertString(-1,"02Tuyauterie radiateur");
		pLBm->InsertString(-1,"03Reservoir carburant");
		pLBm->InsertString(-1,"04Echappement");
		pLBm->InsertString(-1,"05Support moteur");
	}
	if(m_strList2="20Embrayage")
	{
		CListBox* pLBm = (CListBox*)GetDlgItem(IDC_LISTPR3);
		pLBm->InsertString(-1,"01Embrayage");
	}
	if(m_strList2="21Boite de vitesses  mécanique")
	{
		CListBox* pLBm = (CListBox*)GetDlgItem(IDC_LISTPR3);
		pLBm->InsertString(-1,"01Boite de vitesses mecanique");
		pLBm->InsertString(-1,"02Carters de boite de vitesses");
		pLBm->InsertString(-1,"03Pignons de boite de vitesses");
		pLBm->InsertString(-1,"04Differentiel");
		pLBm->InsertString(-1,"05Fourchette de boite de vitesses");
	}
	if(m_strList2="29Transmission")
	{
		CListBox* pLBm = (CListBox*)GetDlgItem(IDC_LISTPR3);
		pLBm->InsertString(-1,"01Transmission latérale");
	}
	if(m_strList2="31Elements porteurs avant")
	{
		CListBox* pLBm = (CListBox*)GetDlgItem(IDC_LISTPR3);
		pLBm->InsertString(-1,"01Train avant");
		pLBm->InsertString(-1,"02Fusée - Disque");
	}
	if(m_strList2="32Elements non porteurs avant")
	{
		CListBox* pLBm = (CListBox*)GetDlgItem(IDC_LISTPR3);
		pLBm->InsertString(-1,"01Amortisseur");
		pLBm->InsertString(-1,"02Barre stabilisatrice");
		pLBm->InsertString(-1,"03Etriers de frein");
	}
	if(m_strList2="33Elements porteurs arriere")
	{
		CListBox* pLBm = (CListBox*)GetDlgItem(IDC_LISTPR3);
		pLBm->InsertString(-1,"01Fusee - Disque");
		pLBm->InsertString(-1,"02Barre de torsion");
		pLBm->InsertString(-1,"03Train arriere");
	}
	if(m_strList2="34Element non porteurs arriere")
	{
		CListBox* pLBm = (CListBox*)GetDlgItem(IDC_LISTPR3);
		pLBm->InsertString(-1,"01Amortisseur");
		pLBm->InsertString(-1,"02Etriers de frein");
	}
	if(m_strList2="35Roues Pneumatiques")
	{
		CListBox* pLBm = (CListBox*)GetDlgItem(IDC_LISTPR3);
		pLBm->InsertString(-1,"01Roues");
	}
	if(m_strList2="36Direction")
	{
		CListBox* pLBm = (CListBox*)GetDlgItem(IDC_LISTPR3);
		pLBm->InsertString(-1,"01Direction");
		pLBm->InsertString(-1,"02Volant de direction");
	}
	if(m_strList2="37Commandes aux pieds")
	{
		CListBox* pLBm = (CListBox*)GetDlgItem(IDC_LISTPR3);
		pLBm->InsertString(-1,"01Pedalier");
		pLBm->InsertString(-1,"02Maitre cylindre de frein");
		pLBm->InsertString(-1,"03Assistance de Freinage");
		pLBm->InsertString(-1,"04Repartiteur de freinage");
		pLBm->InsertString(-1,"05Agrafes");
		pLBm->InsertString(-1,"06Tuyauterie de frein");
	}
	if(m_strList2="38Commandes à main")
	{
		CListBox* pLBm = (CListBox*)GetDlgItem(IDC_LISTPR3);
		pLBm->InsertString(-1,"01Frein a main");
		pLBm->InsertString(-1,"02Vitesses mecanique");
		pLBm->InsertString(-1,"03Starter");
	}
	if(m_strList2="90Cric Petites fournitures")
	{
		CListBox* pLBm = (CListBox*)GetDlgItem(IDC_LISTPR3);
		pLBm->InsertString(-1,"01Cric");
	}
 
 
}
[/code]