Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
C

Christopher Fairbairn

@Christopher Fairbairn
About
Posts
19
Topics
0
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Uniquely indentify a Windows Mobile 5.0 device
    C Christopher Fairbairn

    Hi,

    JGentsch wrote:

    I get the impression that those solutions are completely native code. I'm using C#. I'd like to use managed code. I could use System.Net.Dns.GetHostName(), but that's unreliable for uniqueness

    Yes that is correct, the .NET Compact Framework / Windows Mobile OS doesn't provide any managed way to easily access the unique device id. However this shouldn't be too much of an issue, since it can be worked around via a little bit of Platform Invoke code. For example www.pinvoke.net has a page discussing how you could do this on a Windows Mobile 5.0 or higher device via a function called GetDeviceUniqueID at http://pinvoke.net/default.aspx/coredll/GetDeviceUniqueID.html Hope this helps, Christopher Fairbairn

    Windows Mobile Development blog http://www.christec.co.nz/blog/

    Mobile wcf question

  • Screen Orientation
    C Christopher Fairbairn

    Hi CodingYoshi,

    CodingYoshi wrote:

    The only event I found that has anything to do with the size is Resize. However, this event is not raised when orientation changes. None of the other events look useful to me.

    Hmm what operating system/mobile device type are you targeting? Hope this helps, Christopher Fairbairn

    Windows Mobile Development blog http://www.christec.co.nz/blog/

    Mobile hardware help question

  • Screen Orientation
    C Christopher Fairbairn

    Within your .NET Compact Framework application you can handle the OnSize event for your form, when the device changes orientations it will cause the form to be resized and by comparing the the width to height ratio you can determine if the device is in portrait or landscape mode. On a Windows Mobile 5.0 or higher device you may also like to investigate the SystemState.DisplayRotation property (http://msdn2.microsoft.com/en-us/library/microsoft.windowsmobile.status.systemstate.displayrotation.aspx[^])

    Windows Mobile Development blog http://www.christec.co.nz/blog/

    Mobile hardware help question

  • Can C++ call C# assemblies on WM5?
    C Christopher Fairbairn

    Hi Jason,

    Orange Squishy wrote:

    Is there some way I can 'talk' to this code? Can I create a C# project, incorporate the Intermec stuff, create some entry points and access them, dll style?

    This isn't possible. It's not possible for native code to host and then execute managed code since the .NET CF doesn't have any hosting APIs to enable this kind of functionality. What you could do is create two executables. One managed and one native. Then you could use something like point to point message queues to communicate between the two processes (i.e. a form of IPC). The managed executable using the RFID library could continually be waiting for commands from the native process. There's a great article on MSDN written by Daniel Moth that covers how to access point to point message queues within the .NET CF environment - http://msdn2.microsoft.com/en-us/library/aa446556.aspx[^] Hope this helps, Christopher Fairbairn

    Mobile csharp c++ visual-studio question

  • Can I resize Form in device application
    C Christopher Fairbairn

    Hi,

    Mike Dimmick wrote:

    To the best of my recollection, .NET Compact Framework does not offer any way to override this.

    It is possible. The "trick" is to set the FormBorderStyle property to None. For example see my blog entry titled "Creating non full screen forms and custom MessageBoxes" available at http://www.christec.co.nz/blog/archives/134[^]. However having said that it's best described as a hack, and there are some issues with my code sample on different versions of the Windows Mobile OS etc. Since I don't really want to encourage people to develop these kinds of user interfaces I'm not inclined to investigate/resolve these issues... Hope this helps, Christopher Fairbairn Windows Mobile Development blog http://www.christec.co.nz/blog/

    Mobile help csharp design

  • How to Resize the form and open the touch keyboard on screen.
    C Christopher Fairbairn

    Hi,

    Rizwan Bashir wrote:

    I am new to mobile applications and working on my first ever sample application.

    I have a couple of blog posts which might help with these issues.

    Rizwan Bashir wrote:

    1. The application is single form, So when I resize the form in design time and install on my PPC it always cover the complete screen instead of orignal size which is given while designing.

    This is by design. The Windows Mobile design guidelines suggest all application windows are fullscreen. You will notice this is how all the built in applications behave. I wouldn't suggest breaking this convention. However if you do want to give it a go, take a look at a blog posting of mine titled "Creating non full screen forms and custom MessageBoxes" http://www.christec.co.nz/blog/archives/134[^]. But the entire technique is rather fragile and not worth the effort in my opinion...

    Rizwan Bashir wrote:

    2. There is one textbox on my form, When It get focus I need to show the screen keyboard so user can write any thing using touch screen instead of using qwerty keyboard.

    For this you should investigate the InputPanel control within the toolbox of the forms designer. A blog post of mine called "Manage soft input panel (SIP)" available at http://www.christec.co.nz/blog/archives/42[^] may be of help. Especially the section titled "Automatic SIP Popup". Hope this helps, Christopher Fairbairn Windows Mobile Development blog http://www.christec.co.nz/blog/

    Mobile csharp com design tutorial

  • how to make sound & get the value of battery & memory in C# for PPC ?
    C Christopher Fairbairn

    Hi, You can query the current battery details by using some Platform Invoke code to access a native system API called GetSystemPowerStatusEx2. David Kline has a good example of how to do this via C# on his blog entry - "Is my device running on battery or AC?" available at http://blogs.msdn.com/davidklinems/archive/2005/02/10/370591.aspx[^] With respect to the memory status. This would depend upon exactly which figure / memory statistic you want to obtain. Are you wanting to know the total RAM within your device, or the amount currently available to your application for example? Hope this helps, Christopher Fairbairn Windows Mobile Development blog http://www.christec.co.nz/blog/

    Mobile csharp performance help tutorial question

  • change the folder
    C Christopher Fairbairn

    Hi paulraj, Can you share the code you use to call ShellExecuteEx? Windows CE (and hence Windows Mobile) have no concept of a current working directory. So for APIs such as ShellExecuteEx you need to specify the full path to the file you want to display. An exception to this rule is that some APIs will automatically look in the \windows folder if a path is not specified. Are you by chance asking ShellExecuteEx to open "paul" instead of "\temp\paul"? Hope this helps, Christopher Fairbairn Windows Mobile Development blog http://www.christec.co.nz/blog/

    Mobile c++ question help

  • COM wrapper registration
    C Christopher Fairbairn

    Hi,

    gottimukkala wrote:

    How can I register COM wrapper dll in pocket pc. Is this possible?

    Are you talking about a COM Callable Wrapper (CCW) that allows non .NET CF applications be able to make use of COM objects exposed by your .NET assembly? If you are the answer is you can't do this. The .NET Compact Framework does not currently support the hosting APIs etc required to host the .NET CF runtime within another (native) process. Hope this helps, Christopher Fairbairn

    Mobile question com

  • Screen Orientation
    C Christopher Fairbairn

    Hi CodingYoshi,

    CodingYoshi wrote:

    I want to handle the event when the screen orientation changes. I searched the web but nothing.

    What language are you developing in? When the orientation changes the size of your fullscreen window will automatically change. So one way to detect changes is to handle the window size changed event or window message that occurs in your chosen framework. If you need to tell if you are in portrait or landscape mode you can determine this by then checking if the current window width is greater than the height. If for some reason you actually need to determine the true orientation of the device (i.e. 0, 90, 180, 270 degrees) you can do this but the answer is a little different depending upon your programming language/environment of choice. Hope this helps, Christopher Fairbairn

    Mobile hardware help question

  • Animation image
    C Christopher Fairbairn

    Hi, out of the box the Compact Framework controls will not support animated gifs. If you are able to use the OpenNETCE SDF library you may be able to utilise their OpenNETCF.Windows.Forms.AnimateCtl control for this purpose. Otherwise you are probably best to extract the individual GIF frames and add them all as embedded resources into your application. you could then use a timer and a picture box to cycle through the images etc. Hope it helps, Christopher Fairbairn

    Mobile question database

  • How to retreive UUID of the device connected via USB to my PC.
    C Christopher Fairbairn

    Hi, You may like to take a look at the thread over on MSDN Forums available here - http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1504457&SiteID=1[^]. This thread discusses this exact topic and covers some of the problems you may fall into. In short it will be reasonably difficult to obtain the exact UUID as used by ActiveSync etc. However if you just need to get an id which is unique to a given device and repeatable you can probably do what you want by using the GetDeviceUniqueId API call. Hope it helps, Christopher Fairbairn

    Mobile com tutorial question

  • Which API is called when open a directory?
    C Christopher Fairbairn

    Hi, Have you looked into writing a file system filter as discussed in the Windows CE Team Blog in this posting http://blogs.msdn.com/ce_base/archive/2005/12/01/499052.aspx[^]? Directories are not opened, but searched. You would have to hook functions such as FindFirstFile et al which are called when an application wants to obtain a list of files within a specified directory. If you are wanting to "hide" or "remove" a directory. You would need to hook functions such as FindFirstFile to filter out the enteries related to the directory you want to hide. You would also need to hook CreateFile to stop the user being able to open any files within this directory (if they explictly type in a path somewhere). hope this helps, Christopher Fairbairn

    Mobile json help question

  • System Tray [modified]
    C Christopher Fairbairn

    Hi, You will need to PInvoke a native function called Shell_NotifyIcon. Details and additional references to this technique can be found on MSDN Forums in the following thread - http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1504811&SiteID=1[^] You can also find a component within the OpenNETCF SDF library called NotifyIcon which wraps this up for you - www.opennetcf.com Hope it helps, Christopher Fairbairn

    Mobile performance question

  • how can I read Unique DeviceID on Pocket PC using C#
    C Christopher Fairbairn

    Hi, Have a look at the following blog posting http://blogs.msdn.com/windowsmobile/archive/2006/01/09/510997.aspx[^] it should contain a nice wrapper to a native method you can use on Windows Mobile 5.0 or above devices. There is an older technique documented here http://msdn2.microsoft.com/en-us/library/ms172516.aspx[^] which works on older devices as well, however for many reasons it is suggested to try to avoid this process. One reason is that with the Windows Mobile security model, you may find that with newer devices you have access permisson problems utilising this technique depending on the particular device you attempt to use it on. Thanks, Christopher Fairbairn

    Mobile question csharp database

  • Handling the PIN entering dialog
    C Christopher Fairbairn

    have you looked at the "let Me in" example posted in Microsoft's Knowledge base - available here http://support.microsoft.com/kb/314989[^]. Essentially you need to develop a DLL with a few specified entry points. The following blog posting may also help guide you - http://blogs.msdn.com/marcpe/archive/2005/11/22/495780.aspx[^] Hope it helps, Christopher Fairbairn

    Mobile question tutorial

  • Playing video file on pocket pc
    C Christopher Fairbairn

    Hi, Have a look at Alex's article on MSDN titled "Hosting ActiveX Controls in the .NET Compact Framework 2.0" - http://msdn2.microsoft.com/en-us/library/aa446515.aspx[^] This will show you how to host the Windows Media Player ActiveX control within your applicatoni. It's fairly heavy going. If all you need to do is play a file in the existing windows media player application you may like to investigate using the System.Diagnostics.Process class. You could use this to start "myVideo.wmv" and the device would determine the correct application to run to play the file. Hope it helps, Christopher Fairbairn

    Mobile help question

  • How to add item from application to local mobile calendar
    C Christopher Fairbairn

    Have a look at the following article on developer.com - http://www.developer.com/ws/pc/article.php/10947_3556186_1[^]. It contains step by step instructions on how to add the required references etc in order to use the Microsoft.WindowsMobile.PocketOutlook assembly. You can also find a very good example here which does exactly what you want - http://rareedge.com/gmobilesync/2006/12/08/add-appointments-to-pocketoutlook/[^]. I have reposted the code example here for you: using System; using Microsoft.WindowsMobile.PocketOutlook; public class PocketOulookSample { public void AddAppointment() { Appointment appointment = new Appointment(); using (OutlookSession outlook = new OutlookSession()) { appointment.Subject = “Bake a cake”; appointment.Start = DateTime.Now.AddDays(1); appointment.AllDayEvent = true; appointment.Body = “Nicole loves cake!”; appointment.Location = “Kitchen”; appointment.Sensitivity = Sensitivity.Personal; outlook.Appointments.Items.Add(appointment); } } } Hope it helps, Christopher Fairbairn

    Mobile tutorial question

  • Form instances
    C Christopher Fairbairn

    What development environment are you creating your application in? Typically the template/wizard code for your environment (with Visual Studio atleast) will have inserted code which restricts your application to one instance. You may like to read the following thread on the MSDN Forums website (where the opposite problem is discussed, i.e. how to allow multiple instances) - http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1576750&SiteID=1[^] Basically in the WinMain method of your application you should put some code similiar to the following: //If it is already running, then focus on the window, and exit hWnd = FindWindow(szWindowClass, szTitle); if (hWnd) { // set focus to foremost child window // The "| 0x00000001" is used to bring any owned windows to the foreground and // activate them. SetForegroundWindow((HWND)((ULONG) hWnd | 0x00000001)); return 0; } The call to find window is used to detect the existing copy of your application based upon it's window class and window title. Just alter the two arguments to match that of your application's main window. Hope it helps, Christopher Fairbairn

    Mobile question database performance
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups