Click here to Skip to main content
Click here to Skip to main content

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

, 6 Apr 2009
Rate this:
Please Sign up or sign in to vote.
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.

[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)

Share

About the Author

saiful_vonair

Bangladesh Bangladesh
No Biography provided

Comments and Discussions

 
GeneralMy vote of 1 Pinmembertogga5-Aug-09 2:31 
GeneralNice article Pinmemberfatihaalam8-Apr-09 0:36 
Generaloff-topic question PinmemberJasper4C#6-Apr-09 3:30 
GeneralRe: off-topic question Pinmembersaiful_vonair6-Apr-09 3:59 

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

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

| Advertise | Privacy | Mobile
Web02 | 2.8.140821.2 | Last Updated 6 Apr 2009
Article Copyright 2009 by saiful_vonair
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid