Round Corners/Holey Windows batman!

This is a discussion on Round Corners/Holey Windows batman! within the Windows Programming forums, part of the Platform Specific Boards category; This program demonstrates using a bitmap as your dialog. Whatever part of your dialog you color with the color you ...

  1. #1
    Magically delicious LuckY's Avatar
    Join Date
    Oct 2001
    Posts
    856

    Lightbulb Round Corners/Holey Windows batman!

    This program demonstrates using a bitmap as your dialog.
    Whatever part of your dialog you color with the color you define will be transparent (creating the rounded corners and holes in the window). And also it simplifies the changing of colors/bitmaps on buttons when you put the mouse over it and when it has focus, etc with the BtnSt class. Just run the program if that doesn't make any sense.
    No credit belongs to me. The BtnSt class and the function that actually does all the bitmap/region work (DIBToRgn()) is stuff I found on CodeGuru.
    I figure it could help somebody. It helped me.

    War,
    *LuckY*
    Attached Files Attached Files

  2. #2
    Guest Sebastiani's Avatar
    Join Date
    Aug 2001
    Location
    Waterloo, Texas
    Posts
    5,638
    First of all, the program requires the mfc42d.dll to run! Second, that is a useless MFC wizard written program that does not in any way give details on how that might be done with win32.

    Are you new to programming and/or windows? Do yourself a favor. Delete that garbage and forget about MFC. Didn't you notice that you cannot edit lot's of that code? If VC++ was a REAL "visual" compiler, it would not hide such things from you!!
    Code:
    if( numeric_limits< byte >::digits != bits_per_byte )
        error( "program requires bits_per_byte-bit bytes" );
    24bbs.cpp

  3. #3
    Magically delicious LuckY's Avatar
    Join Date
    Oct 2001
    Posts
    856
    The MFC wizard created the dialog and all, no ........... I am not demonstrating how to write a win32 program. I never stated that I was. I said I was demonstrating how to set the region of your window to that of a bitmap.

    If you simply add a member:
    Code:
    HRGN m_hWndRgn;
    and call in your constructor or OnInitDialog() func:
    Code:
    m_hWndRgn=DIBToRgn(m_hBmp,0xff00ff,FALSE);
    then call in OnInitDialog():
    Code:
    SetWindowRgn(m_hWndRgn,TRUE);
    You will have quite simply set the region for your window to the specified bitmap. All you need to do is copy the DibToRgn() function into your dialog's class. Perhaps I should have elaborated a bit more, but I didn't know there were such stupid ..........s on this board. I guess I should have just posted the one function and told you to go figure out for yourself what to do with it, huh?
    I very obviously placed
    Code:
    //*****************
    wherever I added code to the program. All that a genius such as yourself need worry about is copying the parts that fit your needs and compile.

  4. #4
    Guest Sebastiani's Avatar
    Join Date
    Aug 2001
    Location
    Waterloo, Texas
    Posts
    5,638
    And what's your problem? I simply asked if you were new to Windows, and if so, to ditch MFC.
    MFC is bad. So what's the point of using it, or even mucking up this board with it, jughead?
    Code:
    if( numeric_limits< byte >::digits != bits_per_byte )
        error( "program requires bits_per_byte-bit bytes" );
    24bbs.cpp

  5. #5
    Registered User
    Join Date
    Jan 2002
    Posts
    387
    >> I figure it could help somebody. It helped me.

    He doesnt seem to have a problem, i think its you that has a problem mr Sabastard.
    "There are three kinds of people in the world...
    Those that can count and those that can't."

  6. #6
    Banned master5001's Avatar
    Join Date
    Aug 2001
    Location
    Visalia, CA, USA
    Posts
    3,685
    I don't see a problem here--or anything else for that matter (putting the dll in wouldn't have killed you). MFC isn't "bad" per se. I would agree that probably 80% of the programs written using MFC don't benefit from it. However, its also not like every program on the boards is some commercial product/professional project. I say keep using MFC, but please put the DLL in your zip's for us non-VC++ folks.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Anyone using Windows 7?
    By Sharke in forum General Discussions
    Replies: 60
    Last Post: 07-12-2009, 08:05 AM
  2. Just starting Windows Programming, School me!
    By Shamino in forum Windows Programming
    Replies: 17
    Last Post: 02-22-2008, 07:14 AM
  3. dual boot Win XP, win 2000
    By Micko in forum Tech Board
    Replies: 6
    Last Post: 05-30-2005, 02:55 PM
  4. SDL and Windows
    By nickname_changed in forum Windows Programming
    Replies: 14
    Last Post: 10-24-2003, 12:19 AM
  5. IE 6 status bar
    By DavidP in forum Tech Board
    Replies: 15
    Last Post: 10-23-2002, 05:31 PM

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