Thread: Transparent Static Controls, Non-MFC

  1. #1
    Registered User
    Join Date
    Aug 2003
    Posts
    288

    Transparent Static Controls, Non-MFC

    Well i used the WM_CTLCOLORSTATIC Message to make my static controls transparent, and it works fine if i set the controls parent to the hWnd of the window, but if the statics control's parent was a groupbox, it doesnt work.. i thought maybe i should subclass the actuall groupbox and handle each message myself, but im not sure.. could any1 please help me out, its an urgent matter, i have a presentation in a couple of days

    any help would be greatly appreciated

    thanx

    X PaYnE X

  2. #2
    Registered User
    Join Date
    Aug 2003
    Posts
    288
    umm doesnt any1 out there know? err its a simple question really, ill rephrase it:

    does a static control within a groupbox receive the WM_STLCOLORSTATIC Message?

    an even simpler way of putting it:

    how do i make my static controls static if its in a groupbox?

    someone please help

    thanx

  3. #3
    erstwhile
    Join Date
    Jan 2002
    Posts
    2,227
    Please don't bump your threads.

    >> i thought maybe i should subclass the actuall groupbox and handle each message myself, but im not sure<<

    Did you try this in the 24 hours since you posted your question?

    The answer to your question is wrapped up inside your question; a swift review of WM_CTLCOLORSTATIC should resolve any doubts.

    >>err its a simple question really<<

    Indeed it is - as is the answer.
    CProgramming FAQ
    Caution: this person may be a carrier of the misinformation virus.

  4. #4
    train spotter
    Join Date
    Aug 2001
    Location
    near a computer
    Posts
    3,868
    AFSIK static controls don't send msg's to their parent, so can't be subclassed in the way you want.

    >>and it works fine if i set the controls parent to the hWnd of the window, but if the statics control's parent was a groupbox,<<

    All child windows msg's are routed to the callback of their parent. If you set the parent to a static then the static would have to ahve its own callback. This can be set with GetWindowLong() or GetWindowLongPtr() and then set with SetWindowLong() or SetWindowLongPtr()

    Code:
    lpfnOriginalWndProc = (WNDPROC)GetWindowLong(hWndControl , GWL_WNDPROC);
    SetWindowLong(hWndControl , GWL_WNDPROC, (LONG) NewWndProc);
    "Man alone suffers so excruciatingly in the world that he was compelled to invent laughter."
    Friedrich Nietzsche

    "I spent a lot of my money on booze, birds and fast cars......the rest I squandered."
    George Best

    "If you are going through hell....keep going."
    Winston Churchill

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Seg Fault in Compare Function
    By tytelizgal in forum C Programming
    Replies: 1
    Last Post: 10-25-2008, 03:06 PM
  2. seg fault at vectornew
    By tytelizgal in forum C Programming
    Replies: 2
    Last Post: 10-25-2008, 01:22 PM
  3. LNK2001 ERROR!!! need help
    By lifeafterdeath in forum C++ Programming
    Replies: 7
    Last Post: 05-27-2008, 05:05 PM
  4. get keyboard and mouse events
    By ratte in forum Linux Programming
    Replies: 10
    Last Post: 11-17-2007, 05:42 PM
  5. Tab Controls - API
    By -KEN- in forum Windows Programming
    Replies: 7
    Last Post: 06-02-2002, 09:44 AM