Possible to do this with Borland C++?

L

laredotornado

Hi,

I just downloaded a free Borland C++ compiler from

http://www.codegear.com/downloads/free/cppbuilder

I want to write a simple program for Windows platforms that
- launches a program that opens a specific page on a web browser
- has a custom .ico file that appears on the desktop
- requries no setup program (much like PuTty)

My question is, is it possible (and how), would I add a custom .ico
file to my Borland C++ program?

Thanks, - Dave
 
V

Victor Bazarov

laredotornado said:
[..]
My question is, is it possible (and how), would I add a custom .ico
file to my Borland C++ program?

Yes, it is possible. How? Ask in the newsgroup dealing with Borland.
They used to be 'borland.public.cpp*'. Also consider that your question
has more to do with Windows than with C++, and there are Windows
programming newsgroups out there, go seek 'em out.

V
 
R

Ross A. Finlayson

Hi,

I just downloaded a free Borland C++ compiler from

http://www.codegear.com/downloads/free/cppbuilder

I want to write a simple program for Windows platforms that
- launches a program that opens a specific page on a web browser
- has a custom .ico file that appears on the desktop
- requries no setup program (much like PuTty)

My question is, is it possible (and how), would I add a custom .ico
file to my Borland C++ program?

Thanks, - Dave

Oh, this is a C++ group only about C++. You are talking about
resource files. The files have resources attached to them, think
about the Macintosh files with the resources. They are called the
forks of the file. There's a stream fork on the Macintosh file. On
Windows a file name is all the file, but in the Win32 file system.
So, you want to put an icon on the file and load it into the dialog
you build from coordinates. You put the coordinate of the dialog into
the dialog remplate file. It is an rc file, .rc, the resource
compiler file. Sometimes people name them rc2 so the compiler doesn't
think it's a compiler file. The point is that the resource compiler
rc.exe that Borland probably distributes with its C++ compiler, or it
could be their own rc.exe with even whatever file name they want,
Borland made the Turbo C++ compiler which was and is very good.

http://en.wikipedia.org/wiki/Resource_fork
http://en.wikipedia.org/wiki/Resource_(Windows)

You can write programs in C++ to load the dialogs that you can make
with the resource compiler language. It is not difficult to parse,
the resource compiler language. The dialog builders in Visual Studio
make them automatically, saving them as RC files. By default in
Visual Studio resource files are loaded in the resource editor,
renaming them to rc2 sees then they are built as part of the project,
configured in that way, with the text editor.

Then, there are the Win32 functions of a Windows program. For
example, to handle the Windows events from the Dialog, you install
your functions in the windows message processing loop of the Win32
program. For each message that your application gets from Windows, or
however it is so defined, the functions in the message processing loop
are handling the messages from Windows, so that they know what Windows
is doing and Windows knows that the application responds to the
message.

The messages have the two variables after the message type tag. A
Windows message is the code of the tag and two integer variables.
There are differences in the variables in that they are the same
variables for 16, 32, and 64 bit. So, the Windows functions to work
with the Windows messages from windowsx.h should be used, for example
the Message Crackers, and the macros for the message handlers.

http://www.google.com/search?hl=en&source=hp&q=windowsx.h

You'll notice that windows.h is included in every C and C++ file that
is calling the functions of Windows. The tags that identify the
messages are in the file. For example, all the Windows Messages begin
with WM_. That helps to find them in the file, because hundreds of
items in the file have WM_ to indicate that they are tags for Windows
Messages.

When a Win32 program is called, generally the programmer needs
something like global variables for their function as the Win32
application. So, in the function, there's a method to get the
"private" variable, user data, as they call it, that is the pointer.
Otherwise they might just use static variables. In C, that means the
program has all the variables maintaining the state. Modern day
Windows also has key/value string mapping for the private variable,
besides just using one pointer to the struct that has all the data for
the application to run, the parameters, but applications before that
use GetWindowsLong function to get the context struct.


typedef tagstruct CONTEXT
{

}
CONTEXT;

and also sometimes the structure is defined there with it's pointer
name also, why not

struct CONTEXT
{

}
Borland has their own windows.h file which probably exactly matches
the information that Borland supports using the Win32 API, where Win32
is the generic name for much of the Windows API, the application
programming interface. Also Watcom had a very good C++ compiler.
Also the lcc Win32 compiler of Jacob Navia compiles source to DLL's
that Windows can use, and uses Windows DLLs.

I have a C++ project it makes a copy/paste buffer.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,954
Messages
2,570,116
Members
46,704
Latest member
BernadineF

Latest Threads

Top