Background "skin" wont apply to my program

This is a discussion on Background "skin" wont apply to my program within the Windows Programming forums, part of the Platform Specific Boards category; So when i use the AnimateWindow function when opening the program, the background image of the main program doesn't get ...

  1. #1
    Shibby willc0de4food's Avatar
    Join Date
    Mar 2005
    Location
    MI
    Posts
    378

    Background "skin" wont apply to my program

    So when i use the AnimateWindow function when opening the program, the background image of the main program doesn't get displayed until the user has some interaction with the program, such as starting a new game.
    Also, I'm trying to use WM_CTLCOLORSTATIC to make the static controls background transparent so i just have the text on top of the background image but when i try to execute it nothing happens (and by nothing, i mean it doesn't set the background color of the controls to transparent.)

    Code:
    for (i = 600; i <= 622; i++)
                {
                    StaticDC = GetDC(GetDlgItem(hwnd, i));
                    SendMessage(hwnd, WM_CTLCOLORSTATIC, (WPARAM)StaticDC, (LPARAM)i);
                }
    ...
            break;
    ...
            case WM_CTLCOLORSTATIC:
            {
                 HDC hdc = (HDC)wParam;
                 SetBkMode(hdc, TRANSPARENT);
                 SetTextColor(hdc, RGB(0, 0, 0));
                 return (LONG)g_hbrBackground;
            }
    what am i doing wrong now? lol thanks
    Last edited by willc0de4food; 11-06-2006 at 02:19 AM.
    Registered Linux User #380033. Be counted: http://counter.li.org

  2. #2
    Shibby willc0de4food's Avatar
    Join Date
    Mar 2005
    Location
    MI
    Posts
    378
    oooh yay :]

    the code in this post worked for the static controls
    Registered Linux User #380033. Be counted: http://counter.li.org

  3. #3
    Reverse Engineer maxorator's Avatar
    Join Date
    Aug 2005
    Location
    Estonia
    Posts
    2,318
    Code:
    for (i = 600; i <= 622; i++)
                {
                    StaticDC = GetDC(GetDlgItem(hwnd, i));
                    SendMessage(hwnd, WM_CTLCOLORSTATIC, (WPARAM)StaticDC, (LPARAM)i);
                }
    You don't need to call the WM_CTLCOLORSTATIC. It doesn't do anything good (probably it is even bad). Windows calls WM_CTLCOLORSTATIC itself.
    "The Internet treats censorship as damage and routes around it." - John Gilmore

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Running my program in the background
    By shoobsie in forum Windows Programming
    Replies: 4
    Last Post: 10-09-2005, 03:38 AM
  2. I need some help with my program please.
    By agentxx04 in forum C Programming
    Replies: 9
    Last Post: 09-26-2004, 08:51 AM
  3. forcing a program to run in the background?
    By Geo-Fry in forum Tech Board
    Replies: 4
    Last Post: 10-27-2003, 08:11 PM
  4. Mdm background program from VS
    By WebSnozz in forum A Brief History of Cprogramming.com
    Replies: 0
    Last Post: 11-23-2001, 07:18 PM
  5. Running program on background?
    By Couhilin in forum A Brief History of Cprogramming.com
    Replies: 1
    Last Post: 11-03-2001, 07:50 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21