Thread: Gui questions

  1. #1
    Registered User
    Join Date
    Oct 2006
    Location
    UK/Norway
    Posts
    485

    Gui questions

    Hallo,

    I am trying to use a picture as the background for my windows program but cant seem to find any resources on it.

    Does anyone have any experience with it?

    Regards,

  2. #2
    Registered User
    Join Date
    Jul 2008
    Posts
    67
    There are many ways to realize this.

    You can do it in this way ...
    Code:
        WNDCLASSEX  WndClass ;
    
        WndClass.style         = CS_HREDRAW | CS_VREDRAW | 0x00020000 ;
        WndClass.hInstance     = hInstance ;
        WndClass.lpfnWndProc   = WindowProc ;
        WndClass.cbSize        = sizeof (WNDCLASSEX) ;
        WndClass.cbClsExtra    = 0 ;
        WndClass.cbWndExtra    = 0 ;
        WndClass.hIcon         = LoadIcon   (NULL, IDI_APPLICATION) ;
        WndClass.hIconSm       = LoadIcon   (NULL, IDI_APPLICATION) ;
        WndClass.hCursor       = LoadCursor (NULL, IDC_ARROW) ;
        WndClass.lpszMenuName  = NULL ;
        // The Background Picture
        WndClass.hbrBackground = (HBRUSH) CreatePatternBrush((HBITMAP)LoadImage(NULL, TEXT("backpic.bmp"),
    																			IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE)) ;
        WndClass.lpszClassName = szClassName ;
    
        if (!RegisterClassEx (&WndClass))
            return 0 ;
    Or you can handle it in the WM_PAINT of the window proc ...

    EDIT:
    http://www.c-plusplus.de/forum/viewt...ntergrund.html



    Greetz
    Last edited by Greenhorn__; 08-05-2008 at 01:55 AM.

  3. #3
    Registered User
    Join Date
    Oct 2006
    Location
    UK/Norway
    Posts
    485
    That worked great. Thank you

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Questions about GUI and search of new ideas
    By cemmy in forum Windows Programming
    Replies: 1
    Last Post: 05-31-2009, 01:53 PM
  2. Simple GUI questions
    By spadez in forum C Programming
    Replies: 1
    Last Post: 02-20-2009, 05:02 PM
  3. A very long list of questions... maybe to long...
    By Ravens'sWrath in forum C Programming
    Replies: 16
    Last Post: 05-16-2007, 05:36 AM
  4. GUI Programming :: C++ Exclusive
    By kuphryn in forum C++ Programming
    Replies: 5
    Last Post: 01-25-2002, 03:22 PM
  5. C++: Reference Book, GUI, Networking & Beyond
    By kuphryn in forum C++ Programming
    Replies: 4
    Last Post: 11-10-2001, 08:03 PM