Solved

Software Patcher

Posted on 2007-11-27
2
472 Views
Last Modified: 2013-11-20
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
Comment
Question by:bobbit31
  • 2
2 Comments
 
LVL 30

Expert Comment

by:Axter
ID: 20362748
>>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
 
LVL 30

Accepted Solution

by:
Axter earned 500 total points
ID: 20362761
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
countEvens challenge 2 76
has22 challenge 11 80
only14 challenge 19 68
Can not remove SSL certificate on iPhone 6 - iOS10.2 12 259
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.

910 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now