OVH Cloud OVH Cloud

A propos de ma procedure

1 réponse
Avatar
Gilles
Bonjour,

j'ai un petit soucis, ma commande SetWindowText(lblhWnd1, "Source du fichier
Eml"); ne fonctionne pas dans WM_CREATE

/* This function is called by the Windows function DispatchMessage( ) */
LRESULT CALLBACK WindowProcedure (HWND hwnd, UINT message, WPARAM wParam,
LPARAM lParam)
{
switch (message)
/* handle the messages */
{
case WM_CREATE:
SetWindowText(lblhWnd1, "Source du fichier Eml");
break;

mais si je le mets dans :

case WM_COMMAND: /*
Commande du menu principal */
switch(wParam)
{
case IDM_FICHIER_OUVRIR:
SetWindowText(lblhWnd1, "Source du fichier
Eml");

Ca marche, je comprends pas pourquoi ?

Gilles

1 réponse

Avatar
Patrick Philippot
Gilles wrote:
j'ai un petit soucis, ma commande SetWindowText(lblhWnd1, "Source du
fichier Eml"); ne fonctionne pas dans WM_CREATE

/* This function is called by the Windows function DispatchMessage( )
*/ LRESULT CALLBACK WindowProcedure (HWND hwnd, UINT message, WPARAM
wParam, LPARAM lParam)
{
switch (message)
/* handle the messages */
{
case WM_CREATE:
SetWindowText(lblhWnd1, "Source du fichier Eml");
break;

mais si je le mets dans :

case WM_COMMAND:
/* Commande du menu principal */
switch(wParam)
{
case IDM_FICHIER_OUVRIR:
SetWindowText(lblhWnd1, "Source du
fichier Eml");

Ca marche, je comprends pas pourquoi ?



Si la fenêtre lblhWnd1 est une child window de la fenêtre pour laquelle
vous traitez WM_CREATE (et WM_COMMAND, d'ailleurs), comment cette
variable peut-elle être déjà initialisée avec un handle valide à ce
moment là? A quel moment calculez vous ce handle?

--
Patrick Philippot - Microsoft MVP [.Net]
MainSoft Consulting Services
www.mainsoft.xx
(remplacez .xx par .fr si vous répondez par e-mail)