( Index )

Brief Information about the March 2007 CSIG Meeting

Safer Browser - an Internet browser with safety features.

by Bruce Arnold

3rd Tuesday of the month. 7:30PM - C/C++ Group, SPRS

Safer Browser Snapshot Safer Browser Logo

Welcome to the CSIG, a Special Interest Group of the ACGNJ. This group is a "Special Interest Group" of the ACGNJ devoted to discussing programming languages in general and C, C++, and C++ for Windows programming in particular. Each month a small but hopefully useful program (complete with source code) is presented for discussion.

This application program demonstrates the ability of the Visual Studio software to include an Internet browser window inside a standard C++ program. It allows creating a custom browser with special features.

Here are the details ...

This application is designed to partially duplicate the functioning of a standard Internet browser. It may be used whenever diagnostics and/or extra safety is required.

In order to go to a web site, just type the name in the Address bar at the top. A shortcut with that name as an argument may also be used.

The Back Arrow (upper left) allows stepping backwards to sites already visited.

Whenever a new address is provided, or the site code tries to jump to another site, a prompt message appears which allows the user to decide whether to proceed or not. The parachute logo represents the fact that you have much more control over your browsing. You will probable find it surprising that familiar web pages are so complicated. Often going to one page launches 5 others in the background without your realization. Tip: for safe web sites, just hit the Space Bar.

Standard Hot Keys are provided:
Ctrl-P for printing,
Ctrl-C for copying,
Ctrl-A for selecting all, and
Ctrl-F for finding.

Here's an example of what you might see ...

Safer Browser Logo

The program may be compiled using the C++ .Net compiler included with Visual Studio 2005 as well as the free (!!!) C++ Express compiler. Additionally, since C++ has many similarities with C# or C-Sharp, these compilers may also be used with modifications to the source files. Microsoft provides a C-Sharp compiler with Visual Studio 2005 as well as the free (!!!) C-Sharp Express compiler. Be sure to bring questions about the code and the language.

The programs are normally quite small, about 100 KB, but require a Windows computer that has the following software installed:

Microsoft .NET Framework Version 2.0

This is a large package, about 24 Megs. Most people running updated versions of WinXP will already have it on their computer. If not, it may be downloaded from Microsoft.

Here's the download address for the Microsoft Framework:
Microsoft Software
Or, just look for: Microsoft .NET Framework Version 2.0 Redistributable Package (x86)

There are a number of ways to refer to this compiler and code.

Here's what Wikipedia says about CLI:

The Common Language Infrastructure (CLI) is an open specification developed by Microsoft that describes the executable code and runtime environment that form the core of the Microsoft .NET Framework. The specification defines an environment that allows multiple high-level languages to be used on different computer platforms without being rewritten for specific architectures.

At the meeting on Tuesday night we will be discussing these items and more.

Sample Code - VC7

Sample Code
    private: System::Void web1_Navigated(System::Object^  sender, System::Windows::Forms::WebBrowserNavigatedEventArgs^  e) {
                 Address1->Text = e->Url->ToString();       // put web address on top of form.
                 History_push(e->Url->ToString());          // put web address on History stack.
                 if (History_count() > 1)
                     Backup->Enabled = true;

    private: System::Void Address1_KeyDown(System::Object^  sender, System::Windows::Forms::KeyEventArgs^  e) {
                 if ( e->KeyCode == System::Windows::Forms::Keys::Enter &&  !Address1->Text->Equals( "" ) )
                     web1->Navigate(Address1->Text );

    private: System::Void web1_Navigating(System::Object^  sender, System::Windows::Forms::WebBrowserNavigatingEventArgs^  e) {
                 // Prompt user for permission to proceed.
                 if (System::Windows::Forms::DialogResult::OK != MessageBox::Show(e->Url->OriginalString,
                     "By Your Command",MessageBoxButtons::OKCancel, MessageBoxIcon::Question))
                     e->Cancel = true;
                     if (BackupFlag)
                         BackupFlag = false;
                         Backup->Enabled = true;
                 pictureBox1->Visible = false;      // Turn off splash
                 IntroMsg->Visible = false;         // Ditto

"Random Access" questions start at 7:30 Tuesday night. See you there.


Source Code Files

For help, email me at b a r n o l d @ i e e e . o r g
Back to C++ Main Page