IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Windows Discussion :

Comment empêcher que les textout se chevauchent ?


Sujet :

Windows

  1. #21
    Membre régulier Avatar de kidpaddle2
    Inscrit en
    Avril 2006
    Messages
    430
    Détails du profil
    Informations forums :
    Inscription : Avril 2006
    Messages : 430
    Points : 95
    Points
    95
    Par défaut
    Exact je ne sais pas pourquoi je l'avais oublié ... shame on me !
    Bref cela ne marche toujours pas ... SetWindowText ne modifie pas le contenu du Static ... Je pense que cette fonction modifie le titre (if(!(WS_CHILD))), mais pas le contenu. Qu'en pense tu ?

    Petite précision : De toute façon ce n'est à mon avis pas une bonne méthode puisque même quand on affiche du texte (c'est le texte de départ ... 2eme parametre de createwindow()), il n'est pas affecté par la couleur du static ... une zone blanche est quand même présent autour de celui ci. (j'ai essayé avec un simple (dans le CTLCOLORSTATIC) return (LRESULT)hStaticBrush.
    Vive l'embarqué.

  2. #22
    Expert éminent sénior
    Avatar de Médinoc
    Homme Profil pro
    Développeur informatique
    Inscrit en
    Septembre 2005
    Messages
    27 369
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 40
    Localisation : France

    Informations professionnelles :
    Activité : Développeur informatique
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Septembre 2005
    Messages : 27 369
    Points : 41 518
    Points
    41 518
    Par défaut
    Hum... Je ne peux pas vraiment aider quand je n'ai pas une vue d'ensemble...
    Tu pourrais mettre à jour ton code dans le post #17 ?
    SVP, pas de questions techniques par MP. Surtout si je ne vous ai jamais parlé avant.

    "Aw, come on, who would be so stupid as to insert a cast to make an error go away without actually fixing the error?"
    Apparently everyone.
    -- Raymond Chen.
    Traduction obligatoire: "Oh, voyons, qui serait assez stupide pour mettre un cast pour faire disparaitre un message d'erreur sans vraiment corriger l'erreur?" - Apparemment, tout le monde. -- Raymond Chen.

  3. #23
    Membre régulier Avatar de kidpaddle2
    Inscrit en
    Avril 2006
    Messages
    430
    Détails du profil
    Informations forums :
    Inscription : Avril 2006
    Messages : 430
    Points : 95
    Points
    95
    Par défaut
    Bon alors si tu as le temps ... je vais te poster mon code entier. Tu pourras de ce fait avoir toutes les informations dont tu as besoin.
    (Bien sûr il s'agit du code de la fenêtre conçernée)
    J'ai particulièrement du mal avec les contextes de périphériques ... j'ai dû bricoler pas mal mais il est complètement stable maintenant.
    Le voici :
    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
    204
    205
    206
    207
    208
    209
    210
    211
    212
    213
    214
    215
    216
    217
    218
    219
    220
    221
    222
    223
    224
    225
    226
    227
    228
    229
    230
    231
    232
    233
    234
    235
    236
    237
    238
    239
    240
    241
    242
    243
    244
    245
    246
    247
    248
    249
    250
    251
    252
    253
    254
    255
    256
    257
    258
    259
    260
    261
    262
    263
    264
    265
    266
    267
    268
    269
    270
    271
    272
    273
    274
    275
    276
    277
    278
    279
    280
    281
    282
    283
    284
    285
    286
    287
    288
    289
    290
    291
    292
    293
    294
    295
    296
    297
    298
    299
    300
    301
    302
    303
    304
    305
    306
    307
    308
    309
    310
    311
    312
    313
    314
    315
    316
    317
    318
    319
    320
    321
    322
    323
    324
    325
    326
    327
    328
    329
    330
    331
    332
    333
    334
    335
    336
    337
    338
    339
    340
    341
    342
    343
    344
    345
    346
    347
    348
    349
    350
    351
    352
    353
    354
    355
    356
    357
    358
    359
    360
    361
    362
    363
    364
    365
    366
    367
    368
    369
    370
    371
    372
    373
    374
    375
    376
    377
    378
    379
    380
    381
    382
    383
    384
    385
    386
    387
    388
    389
    390
    391
    392
    393
    394
    395
    396
    397
    398
    399
    400
    401
    402
    403
    404
    #include <windows.h>
    #include <time.h>
    #include <stdio.h>
    #include <fmod/fmod.h>
    
    #include "Utils.h"
    #include "Draw.h"
    #include "constants.h"
    #include "Structures.h"
    
    
    /* Yuck ! Global-variables ! You have to avoid these declarations. Me, I had to
    because I don't know (I'm sure we cannot) how to pass parameters to different
    window procedures. */
    
    HBITMAP hBmp;
    HINSTANCE hInst;
    HWND hPlaylistDialog;
    bool loaded = false;
    HWND hwnd;
    MUSICDATA data = {0,0,0,0,0,255,1,0,0,0,0,0};
    
    int WINAPI WinMain (HINSTANCE hThisInstance,
                         HINSTANCE hPrevInstance,
                         LPSTR lpszArgument,
                         int nFunsterStil)
    {
        HRGN region;
        MSG messages;
        WNDCLASSEX wincl;
        char szClassName[ ] = "Mp3Player";
    
        hInst = hThisInstance;
    
        /* The Window structure */
        wincl.hInstance = hThisInstance;
        wincl.lpszClassName = szClassName;
        wincl.lpfnWndProc = WindowProcedure;
        wincl.style = CS_DBLCLKS;
        wincl.cbSize = sizeof (WNDCLASSEX);
    
        /* Use default icon and mouse-pointer */
        wincl.hIcon = LoadIcon (hInst, "icone");
        wincl.hIconSm = LoadIcon (hInst, "icone");
        wincl.hCursor = LoadCursor (NULL, IDC_ARROW);
        wincl.lpszMenuName = NULL;
        wincl.cbClsExtra = 0;
        wincl.cbWndExtra = 0;
        wincl.hbrBackground=(HBRUSH)GetStockObject(NULL_BRUSH);
        wincl.style=CS_HREDRAW|CS_VREDRAW;
    
        if (!RegisterClassEx (&wincl))
           return 0;
    
          hBmp=(HBITMAP)LoadImage(NULL,"Skins/Skin3.bmp",IMAGE_BITMAP,0,0,LR_LOADFROMFILE);
    
          hwnd=CreateWindowEx(0,szClassName,szClassName,
    		      DS_CENTER|WS_POPUP,1024-540,768-120,520,100,HWND_DESKTOP,NULL,hThisInstance,NULL);
    
            region = BmpToRgn(hBmp,RGB(22,22,22));
            SetWindowRgn(hwnd,region,TRUE);
    
         ShowWindow(hwnd,SW_SHOW);
    
        FSOUND_Init(44100, 32, 0);
        FSOUND_SetOutput(FSOUND_OUTPUT_DSOUND);
        FSOUND_SetDriver(0);
        srand(time(NULL));
    
        while (GetMessage (&messages, NULL, 0, 0))
        {
    
            TranslateMessage(&messages);
            DispatchMessage(&messages);
        }
    
        return messages.wParam;
    }
    
    
    LRESULT CALLBACK WindowProcedure (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
    {
        static bool holding = false;
        static FSOUND_STREAM *music = NULL;
        static NOTIFYICONDATA TrayIcon;
        static RECT rc;
        static POINT lp;
        static int dx = 0,dy = 0;
        static HDC hdc, hdcBis;
        static HFONT Blank=CreateFont(15,0,0,0,FW_NORMAL,FALSE,FALSE,FALSE,
    		       DEFAULT_CHARSET,OUT_DEFAULT_PRECIS,CLIP_DEFAULT_PRECIS,
    		       PROOF_QUALITY,FF_ROMAN,"Arial Black");
        static HWND hTags;
    
        switch (message)
        {
            case WM_CREATE:
                data.playing = 0;
                SetTimer(hwnd,0,0,(TIMERPROC)NULL);
                hdc=GetDC(hwnd);
                hdcBis=CreateCompatibleDC(hdc);
                strcpy(data.tag[0], "Artist : ");
                strcpy(data.tag[1], "Title : ");
                hTags = CreateWindow("STATIC", "", SS_LEFT, 5,23, 353, 53, hwnd, NULL, hInst, NULL);
                break;
    
            case WM_PAINT :
                {
                  holding = false;
                  HDC hdc;
                  PAINTSTRUCT ps;
                  HBITMAP hbmTmp;
                  BITMAP bmpi;
                  HDC hdcMem;
    
                  hdcMem = CreateCompatibleDC(NULL);
                  hbmTmp = (HBITMAP)SelectObject(hdcMem,hBmp);
                  GetObject(hBmp,sizeof(bmpi),&bmpi);
    
                  hdc = BeginPaint(hwnd, &ps);
                  BitBlt(hdc,0,0,bmpi.bmWidth,bmpi.bmHeight,hdcMem,0,0,SRCCOPY);
                  EndPaint(hwnd, &ps);
    
                  SelectObject(hdcMem,hbmTmp);
                  DeleteDC(hdcMem);
                }
            break;
    
            case WM_CTLCOLORSTATIC:
            {
                HDC hdc = reinterpret_cast< HDC >(wParam);
                HWND hStatic = reinterpret_cast< HWND >(lParam);
    
                if(hStatic != hTags)
                {
                         return DefWindowProc (hwnd, message, wParam, lParam);
                }
                SetBkMode(hdc, TRANSPARENT); //Pour le texte
                RECT r, rClient;
    
                //Retrouver les coordonnées du contrôle dans la fenêtre
                GetClientRect(hStatic, &rClient);
                GetWindowRect(hStatic, &r);
                MapWindowPoints(HWND_DESKTOP, hwnd, reinterpret_cast< LPPOINT >(&r), 2);
    
                //Copier la portion du bitmap dans le contrôle:
                BitBlt(hdc, 0, 0, rClient.right, rClient.bottom, hdcBis, r.left, r.top, SRCCOPY);
                HBRUSH hBrush = ((HBRUSH)(GetStockObject(NULL_BRUSH)));
    
                return reinterpret_cast< LRESULT >(hBrush);
            }
    
            case WM_ERASEBKGND:
                {
                  holding = false;
                  HDC hdc;
                  PAINTSTRUCT ps;
                  HBITMAP hbmTmp;
                  BITMAP bmpi;
                  HDC hdcMem;
    
                  hdcMem = CreateCompatibleDC(NULL);
                  hbmTmp = (HBITMAP)SelectObject(hdcMem,hBmp);
                  GetObject(hBmp,sizeof(bmpi),&bmpi);
    
                  hdc = BeginPaint(hwnd, &ps);
                  BitBlt(hdc,0,0,bmpi.bmWidth,bmpi.bmHeight,hdcMem,0,0,SRCCOPY);
                  EndPaint(hwnd, &ps);
    
                  SelectObject(hdcMem,hbmTmp);
                  DeleteDC(hdcMem);
                  break;
                }
    
            case WM_LBUTTONUP:
                if((dx >= 480) && (dy >= 7) && (dx <= 499) && (dy <= 19))
                    SendMessage(hwnd,WM_DESTROY,0,0);
                if((dx >= 407) && (dy >= 35) && (dx <= 429) && (dy <= 58))
                    SendMessage(hwnd,WM_COMMAND,ASKPLAYLIST,0);
                if((dx >= 430) && (dy >= 35) && (dx <= 451) && (dy <= 58))
                    SendMessage(hwnd,WM_COMMAND,MODE,0);
                if((dx >= 497) && (dy >= 20) && (dx <= 515) && (dy <= 77))
                    SendMessage(hwnd,WM_COMMAND,BROWSE,0);
                if((dx >= 408) && (dy >= 60) && (dx <= 457) && (dy <= 92))
                    SendMessage(hwnd,WM_COMMAND,STOP,0);
                if((dx >= 355) && (dy >= 29) && (dx <= 404) && (dy <= 66))
                    SendMessage(hwnd,WM_COMMAND,PREVIOUS,0);
                if((dx >= 460) && (dy >= 29) && (dx <= 496) && (dy <= 66))
                    SendMessage(hwnd,WM_COMMAND,NEXT,0);
                if((dx >= 404) && (dy >= 5) && (dx <= 457) && (dy <= 29))
                    SendMessage(hwnd,WM_COMMAND,PLAY,0);
                if((dx >= 475) && (dy >= 80) && (dx <= 500) && (dy <= 89))
                    SendMessage(hwnd,WM_COMMAND,MINIMIZE,0);
    
                break;
            case WM_RBUTTONDOWN:
                holding = true;
                break;
    
            case WM_RBUTTONUP:
                if(holding)
                    holding = false;
                break;
    
            case WM_MOUSEMOVE:
                GetWindowRect(hwnd,&rc);
                GetCursorPos(&lp);
                if(holding)
                    SetWindowPos(hwnd,HWND_TOP,lp.x-dx,lp.y-dy,520,100,SWP_SHOWWINDOW);
                break;
    
            case WM_TIMER:
                GetWindowRect(hwnd,&rc);
                GetCursorPos(&lp);
                dx=lp.x-rc.left;
                dy=lp.y-rc.top;
    
                if(everyTimer(hwnd,&data,music)==0)
                 {}/*SetWindowText(hTags, allT);*/
                break;
    
             case REFRESHTEXTS:
                SetWindowText(hTags, "Salut ca boume ?");
                break;
    
            case WM_DESTROY:
                DeleteObject(hBmp);
                quit(hwnd);
                break;
    
            case MY_WM_NOTIFYICON:
            {
                if(lParam == WM_LBUTTONUP)
                    SendMessage(hwnd,WM_COMMAND,RESTORE,0);
    
                if(lParam == WM_RBUTTONUP)
                {
                  HMENU menu;
                  POINT pos;
                  GetCursorPos(&pos);
                  menu = GetSubMenu(LoadMenu(hInst,"TrayMainMenu"), 0);
                  SetForegroundWindow(hwnd);
                  TrackPopupMenuEx(menu, 0, pos.x, pos.y, hwnd, NULL);
                 }
            }
            break;
    
    
            case WM_COMMAND:
                switch(LOWORD(wParam))
                {
                    case ID_QUIT:
                        Shell_NotifyIcon(NIM_DELETE,&TrayIcon);
                        SendMessage(hwnd,WM_CLOSE,0,0);
                        break;
    
                    case MODE:
                    {
                        HMENU hpopup;
                        hpopup = GetSubMenu(LoadMenu(hInst,"Mode"), 0);
    
                        TrackPopupMenuEx(hpopup, 0, 292, 50, hwnd, NULL);
    
                        //Suite dans WM_COMMAND
    
                        break;
                    }
                    case SHUFFLE_MODE:
                       /* CheckMenuItem(hmenu, NORMAL_MODE, MF_UNCHECKED |MF_BYCOMMAND);
                        CheckMenuItem(hmenu, SHUFFLE_MODE, MF_CHECKED | MF_BYCOMMAND);*/
                    if(data.mode != SHUFFLE)
                        data.mode = SHUFFLE;
                       break;
    
                    case NORMAL_MODE:
                       /* CheckMenuItem(hmenu, SHUFFLE_MODE, MF_UNCHECKED |MF_BYCOMMAND);
                        CheckMenuItem(hmenu, NORMAL_MODE, MF_CHECKED | MF_BYCOMMAND);*/
                        if(data.mode != NORMAL)
                            data.mode = NORMAL;
                        break;
    
                    case ASKPLAYLIST:
                        if(!(loaded))
                        {
                            loaded = true;
                            hPlaylistDialog = CreateDialog(hInst,"Playlist",hwnd,(DLGPROC)PlaylistProc);
                            ShowWindow(hPlaylistDialog, TRUE);
                        }
                        break;
    
                    case NEXT:
                        if(data.mode == SHUFFLE)
                            data.playing = (rand() % (data.numberItems - 0 + 1)) + 0;
                        else
                        {
                            if(data.playing != data.numberItems)
                                data.playing += 1;
                        }
    
                        SendMessage(hwnd,WM_COMMAND,PLAY,0);
                        break;
    
                    case MINIMIZE:
                        ShowWindow(hwnd,SW_HIDE);
                        TrayIcon.cbSize = sizeof( NOTIFYICONDATA );
                        TrayIcon.hWnd = hwnd;
                        TrayIcon.uID = 0;
                        TrayIcon.hIcon = LoadIcon(hInst,"icone");
                        TrayIcon.uCallbackMessage = MY_WM_NOTIFYICON;
                        TrayIcon.uFlags = NIF_ICON | NIF_MESSAGE | NIF_TIP;
                        strcpy(TrayIcon.szTip, "Mp3Player");
                        Shell_NotifyIcon(NIM_ADD,&TrayIcon);
                        break;
    
                    case RESTORE:
                        ShowWindow(hwnd,SW_SHOW);
                        Shell_NotifyIcon(NIM_DELETE,&TrayIcon);
                        break;
    
                    case PREVIOUS:
                        if(data.mode == SHUFFLE)
                            data.playing = (rand() % (data.numberItems - 0 + 1)) + 0;
                        else
                        {
                            if(data.playing != 0)
                                data.playing -= 1;
                        }
    
                        SendMessage(hwnd,WM_COMMAND,PLAY,0);
                        break;
    
                    case PLAY:
                        if(data.numberItems == 0)
                            break;
    
                        music = FSOUND_Stream_Open(data.path[data.playing], 0, 0, 0);
                        data.elapsedT = 0;
                        FSOUND_Stream_Play(0, music);
                        FSOUND_SetVolume(0, 255);
                        strcpy(data.tag[0], "Artist : ");
                        strcpy(data.tag[1], "Title : ");
                        data.totalT = (FSOUND_Stream_GetLengthMs(music))/1000;
                        SendMessage(hwnd,REFRESHTEXTS,0,0);
    
                        if(loaded)
                            SendMessage(GetDlgItem(hPlaylistDialog,ID_PLAYLIST),LB_SETCURSEL,data.playing-1,0);
                        break;
    
                    case STOP:
                        FSOUND_StopSound(0);
                        strcpy(data.status,"Stopped");
                            SendMessage(hwnd,REFRESHTEXTS,0,0);
                        break;
    
                    case BROWSE:
                    {
                        OPENFILENAME ofn;
                        CHAR szFile[5000]={0};
    
                        ZeroMemory(&ofn, sizeof(OPENFILENAME));
                        ofn.lStructSize = sizeof(OPENFILENAME);
                        ofn.hwndOwner = hwnd;
                        ofn.lpstrFile = szFile;
                        ofn.nMaxFile = 2998;
                        ofn.lpstrFilter = "Mpeg layer 3\0*.mp3\0";
                        ofn.nFilterIndex = 1;
                        ofn.Flags = OFN_PATHMUSTEXIST | OFN_FILEMUSTEXIST | OFN_ALLOWMULTISELECT | OFN_EXPLORER;
    
                        if (GetOpenFileName(&ofn)==TRUE)
                        {
                                loadSongs(&data, szFile);
                                ReconizeTag(hwnd, &data);
                                SendMessage(hPlaylistDialog,REFRESHPLAYLIST,0,0);
                        }
    
                         holding = false;
    
    
                          HDC hdc;
                          PAINTSTRUCT ps;
                          HBITMAP hbmTmp;
                          BITMAP bmpi;
                          HDC hdcMem;
    
                          hdcMem = CreateCompatibleDC(NULL);
                          hbmTmp = (HBITMAP)SelectObject(hdcMem,hBmp);
                          GetObject(hBmp,sizeof(bmpi),&bmpi);
    
                          hdc = BeginPaint(hwnd, &ps);
                          BitBlt(hdc,0,0,bmpi.bmWidth,bmpi.bmHeight,hdcMem,0,0,SRCCOPY);
                          EndPaint(hwnd, &ps);
    
                          SelectObject(hdcMem,hbmTmp);
                          DeleteDC(hdcMem);
                        break;
                    }
                }
    
            default:
                return DefWindowProc (hwnd, message, wParam, lParam);
        }
    
        return 0;
    }
    Mon organisation est assez "bordélique" mais ce programme n'était pas censé être aussi "gros" (façon de parler) Je le convertirais même en C++ quand je n'aurais plus ces problèmes. Je préfère.
    (Il n'y a pas le code du fameux static puisque c'est simple à imaginer :
    Création - UpdateWindow(FENETRE_PARENT) - SetWindowText - CTLCOLORSTATIC Et cela ne marche pas)

    Je pense que je vais me résoudre à plutôt faire un fillrect avant d'afficher les textout ... mais cela fera très moche. Tant pis à force de m'arracher les cheveux je vais devenir chauve
    Vive l'embarqué.

  4. #24
    Expert éminent sénior
    Avatar de Médinoc
    Homme Profil pro
    Développeur informatique
    Inscrit en
    Septembre 2005
    Messages
    27 369
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 40
    Localisation : France

    Informations professionnelles :
    Activité : Développeur informatique
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Septembre 2005
    Messages : 27 369
    Points : 41 518
    Points
    41 518
    Par défaut
    Euh... Pourquoi ton static n'a toujours pas le style WS_CHILD ?
    (je n'ai pas eu le courage d'aller beaucoup plus loin...)
    SVP, pas de questions techniques par MP. Surtout si je ne vous ai jamais parlé avant.

    "Aw, come on, who would be so stupid as to insert a cast to make an error go away without actually fixing the error?"
    Apparently everyone.
    -- Raymond Chen.
    Traduction obligatoire: "Oh, voyons, qui serait assez stupide pour mettre un cast pour faire disparaitre un message d'erreur sans vraiment corriger l'erreur?" - Apparemment, tout le monde. -- Raymond Chen.

  5. #25
    Membre régulier Avatar de kidpaddle2
    Inscrit en
    Avril 2006
    Messages
    430
    Détails du profil
    Informations forums :
    Inscription : Avril 2006
    Messages : 430
    Points : 95
    Points
    95
    Par défaut
    Je t'ai dit que j'avais fait ce test dans un autre projet. Encore faut il qu'il marche dans un projet le plus minimal possible non ?
    Vive l'embarqué.

  6. #26
    Expert éminent sénior
    Avatar de Médinoc
    Homme Profil pro
    Développeur informatique
    Inscrit en
    Septembre 2005
    Messages
    27 369
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 40
    Localisation : France

    Informations professionnelles :
    Activité : Développeur informatique
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Septembre 2005
    Messages : 27 369
    Points : 41 518
    Points
    41 518
    Par défaut
    Mais c'est ainsi que ça doit être.
    Les common controls ne sont pas supposés être indépendants : Ils ont beaucoup plus de chances de foirer ainsi qu'en WS_CHILD.

    De plus, WM_CTLCOLORXXX n'est envoyé qu'à la parent window, pas à l'owner window...
    GetDlgItem() et tout ce qui va avec ne marche qu'avec les child window.
    SVP, pas de questions techniques par MP. Surtout si je ne vous ai jamais parlé avant.

    "Aw, come on, who would be so stupid as to insert a cast to make an error go away without actually fixing the error?"
    Apparently everyone.
    -- Raymond Chen.
    Traduction obligatoire: "Oh, voyons, qui serait assez stupide pour mettre un cast pour faire disparaitre un message d'erreur sans vraiment corriger l'erreur?" - Apparemment, tout le monde. -- Raymond Chen.

  7. #27
    Membre régulier Avatar de kidpaddle2
    Inscrit en
    Avril 2006
    Messages
    430
    Détails du profil
    Informations forums :
    Inscription : Avril 2006
    Messages : 430
    Points : 95
    Points
    95
    Par défaut
    Je ne te comprends pas ... le code que je viens de te donner conçerne la parent window ... de plus on peut intercepter le message CTLCOLORXXXX dans l'owner window puisque c'est ce que j'ai fait avec la dialog box (la playlist) : j'ai pu ainsi colorer ma playlist e nbleu marine...
    Vive l'embarqué.

  8. #28
    Expert éminent sénior
    Avatar de Médinoc
    Homme Profil pro
    Développeur informatique
    Inscrit en
    Septembre 2005
    Messages
    27 369
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 40
    Localisation : France

    Informations professionnelles :
    Activité : Développeur informatique
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Septembre 2005
    Messages : 27 369
    Points : 41 518
    Points
    41 518
    Par défaut
    Citation Envoyé par kidpaddle2
    Je ne te comprends pas ... le code que je viens de te donner conçerne la parent window
    Une fenêtre (ou un controle) sans WM_CHILD n'a pas de parent window... Il/elle n'a qu'une owner window.
    Quoi qu'il en soit, les common controls sont des contrôles, ils DOIVENT donc être en WS_CHILD de préférence. Ils ne sont pas garantis marcher en indépendants.

    Citation Envoyé par kidpaddle2
    de plus on peut intercepter le message CTLCOLORXXXX dans l'owner window puisque c'est ce que j'ai fait avec la dialog box (la playlist) : j'ai pu ainsi colorer ma playlist e nbleu marine...
    Je dois avouer que je n'ai pas testé, mais j'ai quelques doutes.
    SVP, pas de questions techniques par MP. Surtout si je ne vous ai jamais parlé avant.

    "Aw, come on, who would be so stupid as to insert a cast to make an error go away without actually fixing the error?"
    Apparently everyone.
    -- Raymond Chen.
    Traduction obligatoire: "Oh, voyons, qui serait assez stupide pour mettre un cast pour faire disparaitre un message d'erreur sans vraiment corriger l'erreur?" - Apparemment, tout le monde. -- Raymond Chen.

  9. #29
    Membre régulier Avatar de kidpaddle2
    Inscrit en
    Avril 2006
    Messages
    430
    Détails du profil
    Informations forums :
    Inscription : Avril 2006
    Messages : 430
    Points : 95
    Points
    95
    Par défaut
    Moi j'en ai pas, puisque ça marche Quoiqu'il en soit, les questions de parent window, ownerwindow etc ne concernent pas ce code .... en fait il me faudrait une fonction permettant d'afficher du texte en effaçant et affichant la portion de bitmap conçernée avant d'écrire le texte ... j'avais pris modèle pour quelques éléments (comme la reconnaissance des tags) sur une source trouvée. Si cela peut t'aider, tu peux y jeter un coup d'oeil, moi je ne suis pas arrivé à l'adapter à mon code. Il s'appelle MyPlayer.
    Vive l'embarqué.

  10. #30
    Expert éminent sénior
    Avatar de Médinoc
    Homme Profil pro
    Développeur informatique
    Inscrit en
    Septembre 2005
    Messages
    27 369
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 40
    Localisation : France

    Informations professionnelles :
    Activité : Développeur informatique
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Septembre 2005
    Messages : 27 369
    Points : 41 518
    Points
    41 518
    Par défaut
    Ecoute, j'ai fait mes tests (qui marchaient sur un static et pas sur un slider) sur un code C++ qui utilise des classes perso pour les fenêtres.
    Je peux te montrer la windowproc attachée avec un static text qui marche parfaitement bien, avec même un timer qui fait changer le static pour s'assurer que l'arrière-plan en bitmap est bien redessiné derrière.

    Et devine quoi, le code est celui que je t'ai montré au début.
    Code C++ : WindowProc simplifiée : 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
    #define TESTING_WM_CTLCOLORSOMETHING
    #define TESTING_TIMER
    #define CONTROL_ID	2000
    
    
    /* Procédure de fenêtre
       -------------------- */
    //[override (declared virtual in CFenetre)]
    LRESULT CControleCouleur::VWindowProc(UINT uMessage, WPARAM wParam, LPARAM lParam)
    {
    LRESULT lrRetour = 0;
    
    switch(uMessage)
    	{
    	case WM_CREATE:
    		{
    		CREATESTRUCT const * pt_cs = reinterpret_cast< CREATESTRUCT const * >(lParam);
    		HDC hdc = GetDC(m_hWnd);
    		m_hDCMemoire = CreateCompatibleDC(hdc);
    		ReleaseDC(m_hWnd, hdc);
    		
    		MoveWindow(m_hWnd, pt_cs->x, pt_cs->y, GetLargeurPourClient(LARGEUR), pt_cs->cy, FALSE);		
    		
    		#ifdef TESTING_WM_CTLCOLORSOMETHING
    		HWND hCtl = CreateWindowEx(
    		 0, 
    		 TEXT("STATIC"),
    		 pt_cs->lpszName,
    		 WS_CHILD| SS_LEFT | SS_NOPREFIX | WS_VISIBLE,
    		 0, 0, LARGEUR/2, 16, 
    		 m_hWnd, reinterpret_cast< HMENU >(CONTROL_ID), NULL, NULL
    		 );
    		SendMessage(hCtl, WM_SETFONT,
    		 reinterpret_cast< WPARAM >(GetStockFont(DEFAULT_GUI_FONT)), FALSE);
    		#ifdef TESTING_TIMER
    		SetTimer(m_hWnd, 0, 500, NULL);
    		#endif
    		#endif
    		}
    		break;
    		
    	#ifdef TESTING_TIMER
    	case WM_TIMER:
    		{
    		TCHAR szBuf[40];
    		GetDlgItemText(m_hWnd, CONTROL_ID, szBuf, 40-1);
    		size_t i = _tcslen(szBuf);
    		szBuf[i] = szBuf[0];
    		szBuf[i+1] = _T('\0');
    		SetDlgItemText(m_hWnd, CONTROL_ID, szBuf+1);
    		}
    		break;
    	#endif
    	
    	#if 1 && defined(TESTING_WM_CTLCOLORSOMETHING)
    	case WM_CTLCOLORSTATIC:
    		{
    		HDC hdc = reinterpret_cast< HDC >(wParam);
    		HBRUSH hBrush = GetStockBrush(NULL_BRUSH);
    		SetBkMode(hdc, TRANSPARENT);
    		RECT r, rClient;
    		HWND hCtl = reinterpret_cast< HWND >(lParam);
    		GetClientRect(hCtl, &rClient);
    		GetWindowRect(hCtl, &r);
    		MapWindowPoints(HWND_DESKTOP, m_hWnd, reinterpret_cast< LPPOINT >(&r), 2);
    		BitBlt(hdc, 0, 0, rClient.right, rClient.bottom, m_hDCMemoire, r.left, r.top, SRCCOPY);
    		lrRetour = reinterpret_cast< LRESULT >(hBrush);
    		}
    		break;
    	#endif
    		
    	case WM_DESTROY:
    		//Librérer le bitmap
    		if(m_hAncienBitmap)
    			{
    			assert(m_hDCMemoire);
    			HBITMAP hBitmapADetruire = static_cast< HBITMAP >(SelectObject(m_hDCMemoire, m_hAncienBitmap));
    			DeleteObject(hBitmapADetruire);
    			DeleteDC(m_hDCMemoire);
    			m_hAncienBitmap = NULL;
    			m_hDCMemoire = NULL;
    			}
    		break;
    	
    		
    	case WM_PAINT:
    		{
    		PAINTSTRUCT ps;
    		HDC hdc = BeginPaint(m_hWnd, &ps);
    		RECT r;
    		GetClientRect(m_hWnd, &r);
    
    		//DebugMessageBox(
    		// m_hWnd,
    		// _T("hWnd:%p wParam:%d hdc:%p top:%d bottom:%d left:%d right:%d error:%d"),
    		// _T("WM_PAINT"),
    		// m_hWnd, wParam, hdc, r.top, r.bottom, r.left, r.right, 0
    		// );
    		
    		//Cree le bitmap si la taille de la fenêtre a changé
    		if(GetBitmapPourTailleFenetre())
    			{
    			BitBlt(hdc, 0, 0, r.right, r.bottom, m_hDCMemoire, 0, 0, SRCCOPY);
    			}
    		else
    			{
    			HBRUSH hBrush = CreateSolidBrush(RGB(255, 0, 0));
    			FillRect(hdc, &r, hBrush);
    			DeleteObject(hBrush);
    			}				
    		EndPaint(m_hWnd, &ps);
    		}
    		break;
    		
    	default:
    		//lrRetour = DefWindowProc(m_hWnd, uMessage, wParam, lParam);
    		lrRetour = CControle::VWindowProc(uMessage, wParam, lParam);
    	}//switch
    return lrRetour;
    }
    Je n'ai pas testé ce code épuré (j'ai retiré des trucs qui n'avaient rien à voir) et tu ne pourras pas le compiler puisque tu n'as pas les en-têtes, mais le fonctionnement du static marche parfaitement.
    Comme tu peux le voir, le code crée un static (en WS_CHILD) et modifie son contenu tous les demi-secondes, et le static est affiché avec le bitmap en-dessous...

    Comme tu peux aussi le voir, le controle/fenetre CControleCouleur est la parent window du static.
    SVP, pas de questions techniques par MP. Surtout si je ne vous ai jamais parlé avant.

    "Aw, come on, who would be so stupid as to insert a cast to make an error go away without actually fixing the error?"
    Apparently everyone.
    -- Raymond Chen.
    Traduction obligatoire: "Oh, voyons, qui serait assez stupide pour mettre un cast pour faire disparaitre un message d'erreur sans vraiment corriger l'erreur?" - Apparemment, tout le monde. -- Raymond Chen.

  11. #31
    Membre régulier Avatar de kidpaddle2
    Inscrit en
    Avril 2006
    Messages
    430
    Détails du profil
    Informations forums :
    Inscription : Avril 2006
    Messages : 430
    Points : 95
    Points
    95
    Par défaut
    Cela viendrait il du fait que SetWindowText() ait un effet différent de SetDgItemText() sur la fenêtre principale ?
    Vive l'embarqué.

  12. #32
    Expert éminent sénior
    Avatar de Médinoc
    Homme Profil pro
    Développeur informatique
    Inscrit en
    Septembre 2005
    Messages
    27 369
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 40
    Localisation : France

    Informations professionnelles :
    Activité : Développeur informatique
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Septembre 2005
    Messages : 27 369
    Points : 41 518
    Points
    41 518
    Par défaut
    Il est fort possible que des problèmes viennent d'un SetWindowText, car un contrôle n'est pas supposé avoir une barre de titre.

    SetWindowText sur un static child a pour effet de régler le texte qu'il affiche. Sur un static non-child, je ne sais pas, je n'ai jamais essayé.
    Sur un edit, pareil.

    Et SetDlgItemText() ne marche à mon avis que sur les fenêtres filles, car les fenêtres owned n'ont pas d'ID (On ne peut pas leur en mettre un à la création, en tout cas).
    Et comme SetDlgItemText demande un ID...
    SVP, pas de questions techniques par MP. Surtout si je ne vous ai jamais parlé avant.

    "Aw, come on, who would be so stupid as to insert a cast to make an error go away without actually fixing the error?"
    Apparently everyone.
    -- Raymond Chen.
    Traduction obligatoire: "Oh, voyons, qui serait assez stupide pour mettre un cast pour faire disparaitre un message d'erreur sans vraiment corriger l'erreur?" - Apparemment, tout le monde. -- Raymond Chen.

  13. #33
    Membre régulier Avatar de kidpaddle2
    Inscrit en
    Avril 2006
    Messages
    430
    Détails du profil
    Informations forums :
    Inscription : Avril 2006
    Messages : 430
    Points : 95
    Points
    95
    Par défaut
    Le problème c'est que j'ai déjà essayé un SetWindowText sur un static WM_CHILD et ça n'a pas marché ... Bon puisque je tourne en rond, cette amélioration (ainsi que les sliders transparents) apparaitront dans la version 2.0 de mon Mp3. Et donc, comment pourrais-je faire avec un Fillrect ? J'ai du mal à comprendre les contextes de périphériques... il faut utiliser hdc dans ce cas ci non ?
    Vive l'embarqué.

  14. #34
    Expert éminent sénior
    Avatar de Médinoc
    Homme Profil pro
    Développeur informatique
    Inscrit en
    Septembre 2005
    Messages
    27 369
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 40
    Localisation : France

    Informations professionnelles :
    Activité : Développeur informatique
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Septembre 2005
    Messages : 27 369
    Points : 41 518
    Points
    41 518
    Par défaut
    Toutes les opérations graphiques se font sur un HDC.
    Les DCs les plus courants sont les screen DC (comme ceux des fenêtres) et les memory DC qui contiennent un bitmap.

    Citation Envoyé par kidpaddle2
    Le problème c'est que j'ai déjà essayé un SetWindowText sur un static WM_CHILD et ça n'a pas marché
    Ben je ne comprends pas, chez moi ça marche toujours...
    Tu es sûr que le static est visible, au moins ?
    À la création, il affiche le texte donné dans le paramètre lpszWindowName...

    Tu as essayé un static avec les styles que je lui donne ?
    (WS_CHILD| SS_LEFT | SS_NOPREFIX | WS_VISIBLE)
    SVP, pas de questions techniques par MP. Surtout si je ne vous ai jamais parlé avant.

    "Aw, come on, who would be so stupid as to insert a cast to make an error go away without actually fixing the error?"
    Apparently everyone.
    -- Raymond Chen.
    Traduction obligatoire: "Oh, voyons, qui serait assez stupide pour mettre un cast pour faire disparaitre un message d'erreur sans vraiment corriger l'erreur?" - Apparemment, tout le monde. -- Raymond Chen.

  15. #35
    mat.M
    Invité(e)
    Par défaut
    Non tu te trompes totalement
    case WM_PAINT :
    {
    hdcMem = CreateCompatibleDC(NULL);
    hdc = BeginPaint(hwnd, &ps);
    BitBlt(hdc,0,0,bmpi.bmWidth,bmpi.bmHeight,hdcMem,0,0,SRCCOPY);
    hdcMem doit être PERSISTANT ( c'est à dire en global ou membre d'une classe initialisé au démarratge ) et non recrée à chaque message WM_PAINT !
    A chaque modif de l'affichage il faut dessiner dans un HDC en mémoire puis à chaque WM_PAINT ce hdcMem envoyé vers le HDC courant avec BitBlt ou StretchBlt puis affiché à l'écran.
    La gestion des autres messages est inutile ( WM_ERASEBCKGND... )

  16. #36
    mat.M
    Invité(e)
    Par défaut
    C'est le même principe du dessin dans des tampons hors-écran puis copie de ces tampons vers le tampon de l'écran

  17. #37
    Membre régulier Avatar de kidpaddle2
    Inscrit en
    Avril 2006
    Messages
    430
    Détails du profil
    Informations forums :
    Inscription : Avril 2006
    Messages : 430
    Points : 95
    Points
    95
    Par défaut
    Médinoc -> Oui c'est ce que j'ai fait ... Tu peux même vérifier, bien que cela fasse quand même beaucoup de code à vérifier j'en suis conscient.
    Mat M -> Tu parles du code de Médinoc ? Car je ne reconnais pas le mien dans ta citation... Aurais tu une idée à mon problème alors ?
    (Tu dis que ERASEBGND est superflu mais j'ai remarqué que sans, une partie du bitmap était effacée [toujours la même, et au même moment : apres un browse])

    Voici le code tout bête généré par code::blocks et un peu modifié pour le static :
    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
    #include <windows.h>
    
    /*  Declare Windows procedure  */
    HWND hTags;
    HINSTANCE hInst;
    LRESULT CALLBACK WindowProcedure (HWND, UINT, WPARAM, LPARAM);
    
    /*  Make the class name into a global variable  */
    char szClassName[ ] = "test";
    
    int WINAPI WinMain (HINSTANCE hThisInstance,
                         HINSTANCE hPrevInstance,
                         LPSTR lpszArgument,
                         int nFunsterStil)
    {
        HWND hwnd;               /* This is the handle for our window */
        MSG messages;            /* Here messages to the application are saved */
        WNDCLASSEX wincl;        /* Data structure for the windowclass */
    
        hInst = hThisInstance;
    
        /* The Window structure */
        wincl.hInstance = hThisInstance;
        wincl.lpszClassName = szClassName;
        wincl.lpfnWndProc = WindowProcedure;      /* This function is called by windows */
        wincl.style = CS_DBLCLKS;                 /* Catch double-clicks */
        wincl.cbSize = sizeof (WNDCLASSEX);
    
        /* Use default icon and mouse-pointer */
        wincl.hIcon = LoadIcon (NULL, IDI_APPLICATION);
        wincl.hIconSm = LoadIcon (NULL, IDI_APPLICATION);
        wincl.hCursor = LoadCursor (NULL, IDC_ARROW);
        wincl.lpszMenuName = NULL;                 /* No menu */
        wincl.cbClsExtra = 0;                      /* No extra bytes after the window class */
        wincl.cbWndExtra = 0;                      /* structure or the window instance */
        /* Use Windows's default color as the background of the window */
        wincl.hbrBackground = (HBRUSH) COLOR_BACKGROUND;
    
        /* Register the window class, and if it fails quit the program */
        if (!RegisterClassEx (&wincl))
            return 0;
    
        /* The class is registered, let's create the program*/
        hwnd = CreateWindowEx (
               0,                   /* Extended possibilites for variation */
               szClassName,         /* Classname */
               "test",       /* Title Text */
               WS_OVERLAPPEDWINDOW, /* default window */
               CW_USEDEFAULT,       /* Windows decides the position */
               CW_USEDEFAULT,       /* where the window ends up on the screen */
               544,                 /* The programs width */
               375,                 /* and height in pixels */
               HWND_DESKTOP,        /* The window is a child-window to desktop */
               NULL,                /* No menu */
               hThisInstance,       /* Program Instance handler */
               NULL                 /* No Window Creation data */
               );
    
            hTags = CreateWindow("STATIC", "", SS_LEFT | SS_NOPREFIX | WS_CHILD | WS_VISIBLE, 50,50, 353, 53, hwnd, NULL, hInst, NULL);
    
        /* Make the window visible on the screen */
        ShowWindow (hwnd, nFunsterStil);
        ShowWindow (hTags, TRUE);
    
        /* Run the message loop. It will run until GetMessage() returns 0 */
        while (GetMessage (&messages, NULL, 0, 0))
        {
            /* Translate virtual-key messages into character messages */
            TranslateMessage(&messages);
            /* Send message to WindowProcedure */
            DispatchMessage(&messages);
        }
    
        /* The program return-value is 0 - The value that PostQuitMessage() gave */
        return messages.wParam;
    }
    
    
    /*  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(hTags, "salut tout le monde !");
                UpdateWindow(hTags);
                break;
            case WM_CTLCOLORSTATIC:
                return (LRESULT)CreateSolidBrush(RGB(178,178,178));
    
            case WM_DESTROY:
                PostQuitMessage (0);       /* send a WM_QUIT to the message queue */
                break;
            default:                      /* for messages that we don't deal with */
                return DefWindowProc (hwnd, message, wParam, lParam);
        }
    
        return 0;
    }
    Vive l'embarqué.

  18. #38
    Expert éminent sénior
    Avatar de Médinoc
    Homme Profil pro
    Développeur informatique
    Inscrit en
    Septembre 2005
    Messages
    27 369
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 40
    Localisation : France

    Informations professionnelles :
    Activité : Développeur informatique
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Septembre 2005
    Messages : 27 369
    Points : 41 518
    Points
    41 518
    Par défaut
    kidpaddle2:
    1. Je croyais t'avoir dit que la brush retournée par WM_CTLCOLORSTATIC devait être persistante et non pas être créée à chaque fois...
    2. Attention : On n'utilise pas TRUE pour ShowWindow() mais SW_SHOW (même si ça ne devrait pas vraiment causer de problème, puisque TRUE correspond à SW_SHOWNORMAL)
    3. Tu vérifies bien que hTags n'est pas NULL? Et au passage, pas la peine de le créer avec un text vide: Tu verras mieux si son text n'est pas vide à la création
    4. hTags n'existe pas encore lorsque WM_CREATE est traité: La fenêtre reçoit ce message-là avant que CreateWindow() ne retourne...
      ----> Conclusion : Tu crées un static vide et tu ne le remplis pas (car tu le remplis avant qu'il n'existe) --> C'est normal que tu ne voies rien, le static est vide...
    5. Quand quelque chose foire, on commence petit: Est-ce que le static marche quand tu ne joues pas avec WM_CTLCOLORSTATIC ?


    Mat.M : Le Memory DC peut être persistant ou non, ça ne change pas grand-chose ici (sauf question parformance) du moment que le bitmap lui-même est persistant.
    SVP, pas de questions techniques par MP. Surtout si je ne vous ai jamais parlé avant.

    "Aw, come on, who would be so stupid as to insert a cast to make an error go away without actually fixing the error?"
    Apparently everyone.
    -- Raymond Chen.
    Traduction obligatoire: "Oh, voyons, qui serait assez stupide pour mettre un cast pour faire disparaitre un message d'erreur sans vraiment corriger l'erreur?" - Apparemment, tout le monde. -- Raymond Chen.

  19. #39
    Membre régulier Avatar de kidpaddle2
    Inscrit en
    Avril 2006
    Messages
    430
    Détails du profil
    Informations forums :
    Inscription : Avril 2006
    Messages : 430
    Points : 95
    Points
    95
    Par défaut
    Exact c'était le fait qu'il n'existe pas Je suis vraiment stupide parfois ...
    Mais de toute façon le texte possède un fond blanc... même après un ctlcolorstatic. Donc cela ne m'aide pas beaucoup...
    Vive l'embarqué.

  20. #40
    Expert éminent sénior
    Avatar de Médinoc
    Homme Profil pro
    Développeur informatique
    Inscrit en
    Septembre 2005
    Messages
    27 369
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 40
    Localisation : France

    Informations professionnelles :
    Activité : Développeur informatique
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Septembre 2005
    Messages : 27 369
    Points : 41 518
    Points
    41 518
    Par défaut
    C'est normal, il faut régler le HDC en TRANSPARENT
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    SetBkMode(hdc, TRANSPARENT);
    Tu constatera le même phénomène si tu écris directement dans un DC avec DrawText()...
    SVP, pas de questions techniques par MP. Surtout si je ne vous ai jamais parlé avant.

    "Aw, come on, who would be so stupid as to insert a cast to make an error go away without actually fixing the error?"
    Apparently everyone.
    -- Raymond Chen.
    Traduction obligatoire: "Oh, voyons, qui serait assez stupide pour mettre un cast pour faire disparaitre un message d'erreur sans vraiment corriger l'erreur?" - Apparemment, tout le monde. -- Raymond Chen.

Discussions similaires

  1. Comment sélectionner que les lignes doublons
    Par Inconnu_du_69 dans le forum Langage SQL
    Réponses: 20
    Dernier message: 12/02/2009, 16h18
  2. Réponses: 14
    Dernier message: 11/01/2009, 17h27
  3. Comment empêcher un menu CSS de chevaucher un tableau?
    Par dudule0 dans le forum Mise en page CSS
    Réponses: 7
    Dernier message: 17/11/2008, 21h08
  4. Réponses: 4
    Dernier message: 22/05/2007, 09h22
  5. [Math] Comment empêcher que les fractions rapetissent ?
    Par sekiryou dans le forum Mathématiques - Sciences
    Réponses: 3
    Dernier message: 19/08/2006, 05h29

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo