Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 484
  • Last Modified:

Software Patcher

Hey guys,

I need to build a patcher for an application of mine... it's a pc game. I don't want to add any pre-requisites to the game install so i want to use c++ (MFC should be ok).

The GUI requirements that i have been given are somewhat beyond my knowledge (at least in c++).

The main question i have is what would be the best libraries/apis to use so that this application will have web browser support and further, macromedia flash support.

My secondary question is if i want to make the GUI have a shape other than a square (think curved borders)... what would be the best way to achieve that?

p.s. As DirectX is a requirement of the game, using that is certainly an option.

Thanks in advance!

Bob
0
bobbit31
Asked:
bobbit31
  • 2
1 Solution
 
AxterCommented:
>>My secondary question is if i want to make the GUI have a shape other than a square (think curved borders)... what would be the best way to achieve that?

Check out the following link:

http://codeguru.earthweb.com/dialog/IrrBmpDlg.html
0
 
AxterCommented:
Here's an example of the bitmap method for odd shape windows:
http://codeguru.earthweb.com/misc/TransparentWindow.shtml

Here's a modified version of the SetupRegion that was used in the TransparentWindow application in CodeGuru.
void CTransparentWnd::SetupRegion(CDC *pDC, unsigned short MaskID)
{
    CDC                         memDC;
    CBitmap               cBitmap;
    CBitmap*          pOldMemBmp = NULL;
    COLORREF          col;
    CRect                    cRect;
    int                         x, y;
    CMyRgn                    rgnTemp;
    CMyRgn                    *pwndRgn;
    CMyRgn                    wndRgn;
    GetWindowRect(&cRect);
    char pFileName[]="c:\\predefineCRgn.bin";
    CFile f;
    if(f.Open( pFileName, CFile::modeRead))
    {
         CArchive ar( &f, CArchive::load);
         wndRgn.Serialize(ar);
         ar.Close();
         f.Close();
    }
    else
    {
         cBitmap.LoadBitmap(MaskID);
         memDC.CreateCompatibleDC(pDC);
         pOldMemBmp = memDC.SelectObject(&cBitmap);
         wndRgn.CreateRectRgn(0, 0, cRect.Width(), cRect.Height());
         for(x=0; x<=cRect.Width(); x++)
         {
              for(y=0; y<=cRect.Height(); y++)
              {
                   col = memDC.GetPixel(x, y);
                   if(col == 0)
                   {
                        rgnTemp.CreateRectRgn(x, y, x+1, y+1);
                        wndRgn.CombineRgn(&wndRgn, &rgnTemp, RGN_XOR);
                        rgnTemp.DeleteObject();    
                   }
              }
         }
         if (pOldMemBmp) memDC.SelectObject(pOldMemBmp);
         if(f.Open( pFileName, CFile::modeCreate | CFile::modeWrite ) )
         {
              CArchive ar( &f, CArchive::store);
              wndRgn.Serialize(ar);
              ar.Close();
              f.Close();
         }
    }
    SetWindowRgn((HRGN)wndRgn, TRUE);
}

Open in new window

0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now