• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 477
  • Last Modified:

create a win32 program in borland c++

I have recently downloaded the free version of borland c++ form www.inprise.com and I don't know how to make a Windows program. Could someone please tell me the basic princips in creating a windows application in borland c++ (which headers to include, the WinMain function, how to create windows/forms etc.) I would also like an URL.
1 Solution
Probably the best place to start is the book, Programming Windows" by Charles Petzold.  This is, in my opinion, the most fundamental Windows programming text and contains a wealth of information and background.

The examples are very abundant and the explanations are excellent.
I would definitely definitely agree with jhance.  Your question requires about 200 pages of text to answer.  Obviously we aren't going to type them all and fortunately they have already been typed and bound for you and are available at your local bookstore.  After you read a good book or two (or maybe during) ask questions for what you don't understand or couldn't find.  That would be a much more "reasonable sized" question.  

I'll paste a sample starter windows program, but it really is meaninless without the 200 pages of accompanyment.


// Basic window procedure.  This is where you will do most
// of your work to "customize" the window to do what you want.
LRESULT                                          // Result.  Interpretation depends on the        //
                                                           // message being handled.
CALLBACK WndPrc(HWND   WndHnd,                   // >> window.
                UINT   Msg,                      // Message to be handled.
                WPARAM WrdPrm,                   // Word parameter.  Interpretation depends on    
                                                 // message being handled.
                LPARAM LngPrm)                   // Long parameter.  Interpretation depends on
                                                 // message being handled.
   BOOL    Handled = TRUE;                       // Was message handled by this routine?
   LRESULT RetVal  = 0;                          // Value to be returned.                         //

   switch (Msg)                                  // Branch based on message.
   case WM_DESTROY:                              // If this is a destroy window message, then    
      // Make application quite when window is closed.
      PostQuitMessage(0);                        // Post a quite message.
      Handled = FALSE;                           // Indicate message was not handled.
   default:                                      // otherwise, if any other message, then         //
      Handled = FALSE;                           // Indicate message was not handled.             //

   if (!Handled)                                 // If message was not handled, then
      RetVal = DefWindowProc(WndHnd,Msg,WrdPrm,LngPrm);
   return RetVal;                                // Return the return value.  
// Procedure to register the window class.
   HCURSOR    ArwCrs = LoadCursor(NULL,IDC_ARROW);  // Default cursor.
   HBRUSH     GryBrh = GetStockObject(LTGRAY_BRUSH); // Background brush.
   WNDCLASSEX WndCls = {sizeof(WNDCLASSEX),   // Create window class parameter block.
   RegisterClassEx(&WndCls);                     // Try to register the class.
// Procedure to create a window.
HWND  // >> window created.
CrtWnd(char *Ttl) // Window title.
   return CreateWindow("QWnd",Ttl,
                       WS_OVERLAPPEDWINDOW | WS_VISIBLE,
int WINAPI WinMain(HINSTANCE hInstance,HINSTANCE hPrevInstance,LPSTR lpCmdLine,
                   int nShowCmd)
   RegWndCls(); // Register the window class.

   MSG      WndMsg;
   HWND WndHnd = CrtWnd("Window Title"); // Create a window.

   // Process messages until a quit message.
   while (GetMessage(&WndMsg,NULL,0,0))
   return WndMsg.wParam;
What version of BC you download?
In 3.1 you can't make 32b Windows apps.
In 4.52 can, but with problems.
Really you can make 32b Windows apps
only with BC 5.x
Many examples you can find in you bc5\examples directory.
7 new features that'll make your work life better

It’s our mission to create a product that solves the huge challenges you face at work every day. In case you missed it, here are 7 delightful things we've added recently to monday to make it even more awesome.

It seems that Borland->Inprise->Corel has made the basic compiler of C++Builder 5 available for free download at:


The package doesn't seem to support Windows programming, as the headers and libs are not there. You have to buy the C++Builder 5 package for that, which also provides easier use for non-expert Windows programmers.

If you are really interrested in Windows programming the mentioned book is the basis of it all.
hypereng ???
hypereng, wee need you reaction !
May be this demand you to react.
An i repete my proposal: Borland examples of Window programming.

To nietod and msmits:
If i get PTS for this Q, i'll send you
same summ.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

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