Welcome to MSDN Blogs Sign in | Join | Help

Browse by Tags

All Tags » P/Invoke   (RSS)

Determining the type of a device at runtime II: A single binary solution

Recently, I wrote about a mechanism to identify the type of device on which your application is running. My original solution utilized a custom unmanaged function to provide a simplified, type safe way to call the SystemParametersInfo function. Some of
Posted by DavidKlineMS | 2 Comments

Determining the type of a device at runtime

There are times when it is useful for an application to know on what type of device it is running. An application may wish to modify it's user interface depending on device type (suppress button controls on SmartPhone devices, for example), or may be

Checking for Screen Rotation Support using version 2 of the .NET Compact Framework - Visual Basic .Net version

Last year, I posted a snippet on how to determine whether or not your device supported screen rotation using the .NET Compact Framework . I have recently been asked for a Visual Basic .NET version of the snippet. Other than some minor reordering / reformatting,
Posted by DavidKlineMS | 1 Comments

Wrapping Unmanaged Resources

I recently wrote about three common causes of memory leaks in managed applications . In that post , I mentioned that failing to release unmanaged resources was one cause. Today, I'd like to talk a bit about one approach to working with unmanaged resources

Checking for Screen Rotation Support in NetCF version 2

A couple of months ago, I showed an example of how to P/Invoke to check if your device supports device rotation using version 1 of the .NET Compact Framework. In that post , I promised to revisit the example for NetCF v2 once Beta 2 was released. You
Posted by DavidKlineMS | 4 Comments

Is my device running on battery or AC power?

At times, it's helpful to know if the device running your application is plugged in or on battery power (long duration process, software update, etc). Since the .NET Compact Framework does not provide a managed implementation for this check, you will
Posted by DavidKlineMS | 2 Comments

How To Get The Display's Color Depth using NetCF Version 1

I've seen this asked about recently on the NetCF ( microsoft.public.dotnet.framework.compactframework ) newsgroup, and it fits nicely with yesterday's display related p/invoke, too... :) You may have noticed that, in version 1 of the .NET Compact Framework,
Posted by DavidKlineMS | 5 Comments

Checking for Screen Rotation Support Using NetCF

Yesterday, the Windows Mobile team posted a handy tip titled " How to check if screen can be rotated ". This got me interested in checking for screen rotation support from managed code. In V1, the structure to be marshalled is not pretty. Since the fixed
Posted by DavidKlineMS | 8 Comments
 
Page view tracker