Click here to Skip to main content
15,867,488 members
Articles / Programming Languages / C#

Vista logo certification for applications using C++ and C#

Rate me:
Please Sign up or sign in to vote.
4.71/5 (14 votes)
6 Apr 2009CPOL1 min read 25.6K   107   29   4
This library provides the Vista logo API implementation for TC8, 9, and 30. It also describe about TC1 and TC32.

Introduction

There are so many articles on Vista Logo certification. But I think I have something more to write about it. Here, I have provided a DLL that covers almost everything from the implementation point of view related to Vista Logo certification. The package contains: libvl.zip, the DLL source, libvl.dll-Document.zip, the document for how to use, HelloLogoC#.rar, the example using the DLL in C#, and HelloLogoC++.zip, an example for using the DLL in C++. Please follow the document to learn to use this DLL.

Background

We know there are 32 test cases in Vista Logo. To obtain the Vista Logo certification, the application has to pass all the test cases. Don't worry, it is not so hard to get the logo. The application only needs to implement the following test cases: TC1, TC2, TC3, TC8, TC9, TC30, TC31, and TC32. The remaining test cases are related to the installer. Actually, you need to implement only TC1, TC8, TC9, and TC30 by code. This DLL will cover this for you. This code has already been tested and implemented.

Using the code

Please follow the document for better understanding. Only two method needs to be called from the DLL: isSuccess(…) and isRestartMessage (…). Here I will only show how to use the DLL in a C# application.

C#
[DllImport("libvl.dll", CharSet = CharSet.Auto)]
public static extern int isSuccess( string aExeName, 
               string aWndText, 
               string aCmdLine, 
               bool aSupportConcurrentUser, 
               bool aSupportRemoteDesktop);
[DllImport("libvl.dll", CharSet = CharSet.Auto)]
 
static void Main(string[] argv)
{
    try
    {
        if (!File.Exists("Libvl.dll"))
        {
            MessageBox.Show("The following Libvl.dll is missing " + 
                            "please reinstall the application");
            return;
        }
        runMain(argv);
    }
    catch (Exception ex)
    {
        throw; //*** DON'T "Throw ex" here! *** FOR TC 32
    }
}

//
static void runMain(string[] argv)
{
    String lStrWndTxt = "HelloLogo";//This is the title of the
    if (isSuccess("HelloLogo.exe",lStrWndTxt, 
             "CommandLine",false,true) != 0) 
        return;
    //
    Application.EnableVisualStyles();
    Application.SetCompatibleTextRenderingDefault(false);
    Application.Run(new HelloLogo());
}

[DllImport("libvl.dll", CharSet = CharSet.Auto)]
public static extern int isRestartMessage(int aMessage, IntPtr lParam);

//WINDOW MESSAGE HANDLER
protected override void WndProc(ref Message m)
{
    base.WndProc(ref m);        // call default p
    if (isRestartMessage(m.Msg, m.LParam) > -1)//TC 30
    {
        //This application is about to be shut down, so save state...
        if (this.InvokeRequired)
            this.BeginInvoke(new MethodInvoker(this.saveState));
        else
            this.saveState();
    }
}

private void saveState()
{
    //Write code in here to save the state
    //of the application just  before a restart
    Process.GetCurrentProcess().Kill();
    return;
}

History

No updates done yet.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Bangladesh Bangladesh
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions

 
GeneralMy vote of 1 Pin
togga5-Aug-09 2:31
togga5-Aug-09 2:31 
This is not an article. Just a snippet of code with some zip-file attached...
GeneralNice article Pin
fatihaalam8-Apr-09 0:36
fatihaalam8-Apr-09 0:36 
Generaloff-topic question Pin
Jasper4C#6-Apr-09 3:30
Jasper4C#6-Apr-09 3:30 
GeneralRe: off-topic question Pin
saiful_vonair6-Apr-09 3:59
saiful_vonair6-Apr-09 3:59 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.