Preparing your source project to take screenshots in runtime mode

Add reference to the cnethelp.Screenshots.dll using Project->Add Reference... menu to open Add Reference dialog and Browse... button to locate cnethelp.Screenshots.dll in the installation folder of the Help Generator for Visual Studio.NET: 

Click OK button and reference will be added to your source project.

Add custom code to your source project. First of all add Imports directive (VB.NET) or its equivalents in other VS.NET languages supporting Windows forms projects: Then add call to cnethelp.Screeshots.Init function to initialize and to activate Help Generator Screenshot Tool on runtime. It is usually called in your application main form's Load event procedure:

Add Load event procedure stub by using Windows Forms designer: adding stub code shown below by copy and paste will not work because Load event procedure activation will be absent in Windows Form's  initialization code. When stub code added by Windows Forms designer, manually add code to call cnethelp.Screeshots.Init as in the following code snippets:

VB.NET

Imports cnethelp
...
Private Sub YourMainForm_Load( ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load
    cnethelp.Screenshots.Init("C:\Test\VB.NET\
CHM\VBNetHelpDemo.hgp ")
    ...
End
Sub

C#

using cnethelp;
...
private
void YourMainForm_Load( object sender, System.EventArgs e) 
{
    cnethelp.Screenshots.Init(@"C:\Test\CS\CHM\
CS HelpDemo .hgp");
    ...
}

J#

import cnethelp.*;
...
private
void YourMainForm_Load (Object sender, System.EventArgs e)
{
    cnethelp.Screenshots.Init("C:\\Test\\JS\\CHM\\JS
HelpDemo .hgp");
    ...
}

Managed C++

using namespace cnethelp;
...
private
: System::Void YourMainForm_Load(System::Object * sender, System::EventArgs * e)
{
    cnethelp::Screenshots::Init("C:\\Test\\CPP\\CHM\\CPP
HelpDemo .hgp");
    ...
}

cnethelp.Screeshots.Init function has one optional parameter, which specifies fullpath to the generated Help Generator Project corresponding to your source application's project. When this parameter is specified then Help Generator Screenshot Tool preloads Help Generator Project during initialization. When this parameter is omitted then fullpath to the Help Generator Project can be entered manually in Help Generator Screenshot Tool's form. (When omitted in C#, J# or Managed C++ instead of this parameter an empty string should be used - "").

When your main form gets closed or your application is quitting cnethelp.Screeshots.Dispose function should be called, for example:

VB.NET

Private Sub YourMainForm_Closed( ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load
    cnethelp.Screenshots.Dispose()
    ...
End
Sub

C#

private void YourMainForm_Closed( object sender, System.EventArgs e) 
{
    cnethelp.Screenshots.Dispose();
    ...
}

J#

private void YourMainForm_Closed (Object sender, System.EventArgs e)
{
    cnethelp.Screenshots.Dispose();
    ...
}

Managed C++

private : System::Void YourMainForm_Closed(System::Object * sender, System::EventArgs * e)
{
    cnethelp::Screenshots::Dispose();
    ...
}

That's all you need to do with your source project to activate and dispose Help Generator Screenshot Tool on runtime.