Results 1 to 3 of 3

Thread: Changing background color...

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Aug 2001
    Posts
    109

    Changing background color...

    I'm using all dialog templates for my windows..... Is there any way to set background colors at design time?

    And at runtime... is there anything else besides SetBKColor ?

  2. #2
    PowerPoster Chris's Avatar
    Join Date
    Jan 1999
    Location
    K-PAX
    Posts
    3,238
    how about this?

    PHP Code:

    HBRUSH    hBrush1
    =NULL;

    LRESULT CALLBACK DlgProc(HWND hWndUINT messageWPARAM wParamLPARAM lParam)
    {
        switch (
    message
        {
            case 
    WM_INITDIALOG:
                
    // Create a red color solid brush for the dialouge use
                
    hBrush1 CreateSolidBrush(RGB(25500));
                return 
    true;
            case 
    WM_CTLCOLORDLG:
                
    // Change the dialog box background color
                // Ref.
                // wParam - handle to DC (HDC)
                // lParam - handle to dialog box (HWND)

                // Return the new craeted brush
                
    return (long)hBrush1;
            case 
    WM_CLOSE:
            case 
    WM_DESTROY:
                
    // Destroy the created brush
                
    DeleteObject(hBrush1);
                
    //
                
    PostQuitMessage(0);
                break;
       }
       return 
    0;


  3. #3
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    it should be
    static HBRUSH...
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width