in

Matt’s Blog

May 2009 - Posts

  • Windows 7 Sticky Notes

    Today, I'm going to deviate from my typical technical discussions about code or SDKs.   Why?  I just found a new feature in Windows 7 that I'm really liking.   Has your monitor ever started to look like a giant pastel flower because of all the sticky notes adorning the edges?  Then you will love Windows 7 Sticky Notes.

    To check this feature out,  click the Start Menu and click "Sticky Notes"

    This will create a new sticky note on your screen.  Simply click the note with your mouse and begin typing the text for your note.  Your note might look like this.

    By clicking the '+' icon you can create a new note.  Clicking the 'x' in the right corner deletes your note.  You can click and drag the lower right corner to resize your note.  Click an drag the top of the note to put it anywhere you want on your desktop.

    If you prefer green sticky notes to yellow, just right click your note and select green or whatever your favorite color might be.

    My favorite thing about the new Windows 7 Sticky Notes is that the feature is simple, useful, and easy to use.

    Posted May 22 2009, 04:56 PM by mbohn with no comments
    Filed under:
  • Setting up the Windows 7 SDK Beta Virtual Light Sensor

    In my previous, post Windows 7 Sensor and Location API I spoke at a very high level on what the Sensor and Location APIs bring into Windows 7.   Now I'd like to delve a little deeper and show how to setup the Virtual Light Sensor that comes with the Windows 7 SDK Beta.  If you don't have existing hardware sensors on you computer the Virtual Light Sensor is a good way to experiment with the APIs.   Given that one of my favorite programming languages is C#, I'd like to be able to setup a sensor and use C# and the .NET framework to interact with it. 

    I can do just that using the Windows 7 Sensor and Location Interop Sample Library, which includes a simple wrapper for a few sensor and location APIs and objects.  It also includes two sample applications, a version of an MSDN reader that adjusts based on ambient light sensor information and a simple game that moves a Marble around on the screen using an accelerometer.   I first learned of this .NET sample code and the Virtual Light Sensor on the Windows Team Blog in Yochay Kiriaty's post Windows 7 Sensor and Location .NET Interop Sample Library.  In this post, I will expand on setting up the Virtual Light Sensor and testing your environment with the sample MSDN Reader mentioned in Kiriaty's post.

    To start experimenting with Windows 7 Sensor and Location .NET Library you need to have a few prerequisites.

    1. .NET 3.5 SP1 
    2. Visual Studio 2008
    3. Download and install the Windows 7 Beta SDK -  This is an ISO DVD image.
    4. Download and install Microsoft XNA Game Studio 3.0 - This is only required if you want to run the Marble game demo.
    5. If you want to run the Marble game demo in the sample library, you will need a hardware accelerometer.

    Once these prerequisites are installed, you can proceed to setting up the Virtual Light Sensor that comes with the Windows 7 Beta SDK.  

    Step 1 - Go to Device Manager, right click your compurer name, and Select "Add legacy Hardware"

    Step 2 - In the add new hardware wizard make sure you choose to manually select the driver.

    Step 3 -  When prompted to select the type of hardware you are installing, select "Sensors".

     

    Step 4 - When prompted to select a device driver, choose "Have Disk".

    Step 6 - In the location dialog browse to C:\Program Files\Microsoft SDKs\Windows\v7.0\bin which is the location of the Virtual Light Sensor driver.

    After selecting the driver location, continue thru the wizard until installation is complete.

    Step 7 - Enable the sensor

    Before you can use the virtual light sensor it needs to be enabled. Go to Control Panel -> Hardware and Sound -> Location and Other Sensors.  You will see a screen like that below.  Check the box to enable the sensor and click apply. 

    Step 8 - Run the Virtual Light Sensor Application

    Now that the sensor is enabled, open Windows Explorer and navigate to C:\Program Files\Microsoft SDKS\Windows\V7.0\Bin and run VirtualLightSensor.exe as an Administrator.  Note: In my environment running this application triggered another install of the sensor.  If that occurs, you may need to repeat Step 7 and select the newly installed sensor.

    Once launched you should see the application which looks like this:

    You can now use this application to adjust the current light level and the app will trigger the appropriate events and reports through the sensor API.

    To see this in action navigate to the location where you un-zipped the Windows 7 Sensor and Location Interop Sample Library and open the solution file Windows7.sln.  Once this is opened, launch the MSDN reader application, and try changing the light intensity using the slider in the Virtual Light Sensor application.  You should be able to see the interface change as you change the lighting environment with the slider.

    You now should have everything you need to start building your own application that uses the Virtual Ambient Light sensor.

     

     

  • Windows 7 Sensor and Location API

    One of the exciting new additions coming in Windows 7 is the Windows 7 Sensor and Location Platform.   The Windows 7 Sensor and Location Platform is an API built into Windows 7 that will allow application developers to interact with sensors in a standard way, and it allow a standard way for hardware vendors to create their sensor interfaces.  Hence,  it allows hardware and software developers to speak a common language.  Application developers will be able to create enviromentally aware applications much easier by using these standard API interfaces built into Windows 7, instead of writing code for each specific piece of sensor hardware they want to use.   The APIs are provided primarily as native code interfaces using C++ and COM.  However, a lightweight .NET Interop Library has been published for .NET development.

     

    Sensors could include GPS devices, accelerometers, light sensors, temperature sensors, or logical sensors (logical sensors are software based sensors).   An application could easily interact with GPS data to plot your current location on your laptop as you are driving.  An application might use a logical sensor to detect your location based on your current IP address.  Or, if you go from a bright office setting to a dark conference room environment, your application might adjust your display brightness and decrease your laptop volume to better fit the change in environment.  These are just a few examples, the platform is flexible in that it will allow hardware vendors to create and publish new categories and types of sensors. 

     

     For more information on the Windows 7 Sensor and Location Platform check out these links:

     

     

Powered by Community Server (Commercial Edition), by Telligent Systems