[win32] - transparent and opacy - Page 3
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Page 3 of 3 FirstFirst 123
Results 31 to 39 of 39

Thread: [win32] - transparent and opacy

  1. #31
    Join Date
    Apr 2009
    Posts
    625

    Re: [win32] - transparent and opacy

    Quote Originally Posted by 2kaud View Post
    You have checked, haven't you, that GetSize() and GetPosition() are returning the expected values?
    yes.. i have tested now:
    Code:
    struct Position
    {
    	int X;
    	int Y;
    };
    
    struct Size
    {
    	int Width;
    	int Height;
    };
    
    Position GetPosition()
        {
            RECT LabelSize;
            GetWindowRect(hwnd,&LabelSize);
            Position crdSize = {LabelSize.left,LabelSize.top};
            return crdSize;
        }
    
    Size GetSize()
        {
            RECT LabelSize;
            GetWindowRect(hwnd,&LabelSize);
            Size crdSize = {LabelSize.right-LabelSize.left,LabelSize.bottom-LabelSize.top};
            return crdSize;
        }

  2. #32
    Join Date
    Dec 2012
    Location
    England
    Posts
    2,312

    Re: [win32] - transparent and opacy

    ...and clrBackColor is set where?
    All advice is offered in good faith only. You are ultimately responsible for effects of your programs and the integrity of the machines they run on.

  3. #33
    Join Date
    Apr 2009
    Posts
    625

    Re: [win32] - transparent and opacy

    Quote Originally Posted by 2kaud View Post
    ...and clrBackColor is set where?
    Code:
    void SetBackColor(COLORREF color)
        {
            clrBackColor=color;
            ShowWindow(hwnd,SW_HIDE);
            ShowWindow(hwnd,SW_SHOW);
        }
    
        color GetBackColor()
        {
            return clrBackColor;
        }

  4. #34
    Join Date
    Dec 2012
    Location
    England
    Posts
    2,312

    Re: [win32] - transparent and opacy

    ...and SetBackColor() is called from where? And is it called before the WM_ERASEBKGND message is received?
    All advice is offered in good faith only. You are ultimately responsible for effects of your programs and the integrity of the machines they run on.

  5. #35
    Join Date
    Apr 2009
    Posts
    625

    Re: [win32] - transparent and opacy

    Quote Originally Posted by 2kaud View Post
    ...and SetBackColor() is called from where? And is it called before the WM_ERASEBKGND message is received?
    it's a class member... the ShowWindow() helps me do the control update

  6. #36
    Join Date
    Dec 2012
    Location
    England
    Posts
    2,312

    Re: [win32] - transparent and opacy

    But have you checked that SetBackColor() is called before the WM_ERASEBKGND message is recieved? If it is called after, then clrBackColor won't have been set before it's used in the message process code.
    All advice is offered in good faith only. You are ultimately responsible for effects of your programs and the integrity of the machines they run on.

  7. #37
    Join Date
    Apr 2009
    Posts
    625

    Re: [win32] - transparent and opacy

    Quote Originally Posted by 2kaud View Post
    But have you checked that SetBackColor() is called before the WM_ERASEBKGND message is recieved? If it is called after, then clrBackColor won't have been set before it's used in the message process code.
    you came 1st?
    WM_CTLCOLORSTATIC or WM_ERASEBKGND?

  8. #38
    Join Date
    Dec 2012
    Location
    England
    Posts
    2,312

    Re: [win32] - transparent and opacy

    Output the received msg codes to a file or a debug window and see. It's for this sort of thing that I had the msg codes output to a file in an earlier example I posted.
    All advice is offered in good faith only. You are ultimately responsible for effects of your programs and the integrity of the machines they run on.

  9. #39
    Join Date
    Apr 2009
    Posts
    625

    Re: [win32] - transparent and opacy

    Quote Originally Posted by 2kaud View Post
    Output the received msg codes to a file or a debug window and see. It's for this sort of thing that I had the msg codes output to a file in an earlier example I posted.
    it's the WM_ERASEBKGND message.. is the 1st. and then cames the WM_CTLCOLORSTATIC message

Page 3 of 3 FirstFirst 123

Posting Permissions

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


Azure Activities Information Page

Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center