CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Page 2 of 2 FirstFirst 12
Results 16 to 27 of 27
  1. #16
    Join Date
    Nov 2005
    Location
    India, Kerala, Trivandrum
    Posts
    37

    Re: set bitmap as background wallpaper

    You can type in of course.

    ON_WM_ERASEBKGND

    BOOL CMyDlg::OnEraseBkgnd(CDC* pDC)
    {
    CRect rc;
    GetClientRect(&rc);
    pDC->FillSolidRect(rc, RGB(255,120,100));
    return TRUE;
    }

    This is for changing background color
    Last edited by thomas_nibu; January 24th, 2006 at 01:42 AM.

  2. #17
    Join Date
    Feb 2005
    Posts
    568

    Re: set bitmap as background wallpaper

    Quote Originally Posted by sunny_sz
    Maybe this link below is what u want ????

    http://www.codeproject.com/bitmap/picturewindow.asp


    Hope that helps.
    i follow the step... but i got application error when i click run.... something wrong with atlwin.h

  3. #18
    Join Date
    May 2005
    Posts
    4,954

    Re: set bitmap as background wallpaper

    Quote Originally Posted by lsy
    i follow the step... but i got application error when i click run.... something wrong with atlwin.h
    Did you check in debugger where and why it happening? Did you use "Call Stack" to see which line cause the error?

    Cheers
    If a post helped you dont forget to "Rate This Post"

    My Article: Capturing Windows Regardless of Their Z-Order

    Cheers

  4. #19
    Join Date
    Feb 2005
    Posts
    568

    Re: set bitmap as background wallpaper

    Did there have any easy way to get it??

  5. #20
    Join Date
    Jul 2005
    Location
    E: 120°.6, N: 31°.3′
    Posts
    795

    Re: set bitmap as background wallpaper

    Can u print out what error u met ??

  6. #21
    Join Date
    Feb 2005
    Posts
    568

    Re: set bitmap as background wallpaper

    Quote Originally Posted by sunny_sz
    Can u print out what error u met ??
    attached is the application error that i encounter...
    Attached Images Attached Images  

  7. #22
    Join Date
    Jul 2005
    Location
    E: 120°.6, N: 31°.3′
    Posts
    795

    Re: set bitmap as background wallpaper

    Well, Could u pls. attach ur project without Debug/Release folder here ? so that everyone can fast fix ur case .

  8. #23
    Join Date
    Feb 2005
    Posts
    568

    Re: set bitmap as background wallpaper

    Quote Originally Posted by sunny_sz
    Well, Could u pls. attach ur project without Debug/Release folder here ? so that everyone can fast fix ur case .
    i just folow what this website written... i did not add in my project yet as i haven't tested..
    http://www.codeproject.com/bitmap/picturewindow.asp

  9. #24
    Join Date
    Jul 2005
    Location
    E: 120°.6, N: 31°.3′
    Posts
    795

    Re: set bitmap as background wallpaper

    That's one head file , so you have to import this file to ur project and include that , Note:

    All that you need to do is insert two new lines in your stdafx.h:
    Code:
    #include < atlbase.h > ;
    extern CComModule _Module;
    Also , The class is used by subclassing another window. So if you want to change the background of one of your dialogs or a control, all that you need is to add a new member of CPictureWindow in the object, and then subclass the object with your new member.

    For instance, if you want to set the background image in a dialog, you would add a member variable m_PictureWindow to your dialog, and in the OnInitDialog call the function m_PictureWindow.SubclassWindow(m_hWnd ); where m_hWnd is the window handle of the dialog.

    Hope that helps.
    Last edited by sunny_sz; January 25th, 2006 at 03:06 AM.

  10. #25
    Join Date
    Feb 2005
    Posts
    568

    Re: set bitmap as background wallpaper

    Quote Originally Posted by sunny_sz
    That's one head file , so you have to import this file to ur project and include that , Note:

    All that you need to do is insert two new lines in your stdafx.h:
    Code:
    #include < atlbase.h > ;
    extern CComModule _Module;
    Also , The class is used by subclassing another window. So if you want to change the background of one of your dialogs or a control, all that you need is to add a new member of CPictureWindow in the object, and then subclass the object with your new member.

    For instance, if you want to set the background image in a dialog, you would add a member variable m_PictureWindow to your dialog, and in the OnInitDialog call the function m_PictureWindow.SubclassWindow(m_hWnd ); where m_hWnd is the window handle of the dialog.

    Hope that helps.
    thanks... my application error is solve.... but when i run it my bitmap does not appear...

  11. #26
    Join Date
    Jul 2005
    Location
    E: 120°.6, N: 31°.3′
    Posts
    795

    Re: set bitmap as background wallpaper

    Do not forget to use UpdateData(TRUE) or Invalidate(TRUE).

  12. #27
    Join Date
    Feb 2005
    Posts
    568

    Re: set bitmap as background wallpaper

    Quote Originally Posted by sunny_sz
    Do not forget to use UpdateData(TRUE) or Invalidate(TRUE).
    where to put this?

Page 2 of 2 FirstFirst 12

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

Featured