How do you tell CE .Net Compact Framework dialogs to not ShowInTaskbar?

I have a .NET C# Compact Framework application for Windows CE.  My app has several dialogs that get displayed, and they show in the taskbar when they get displayed.  How do I tell them not to show in the taskbar, (ie. like using the ShowInTaskbar property on the regular Forms class).  This isn't a property on a Form in the CF, so how is this done?  Thanks.
mromeoAsked:
Who is Participating?
 
topdog770Commented:
Your question got me thinking and when I looked at a PocketPC device last night, I noticed that there IS a window/program title that appears next to the start button.

As frequently happens, I was wrong.  I was thinking POCKETPC not CE.

This code snippet will do it ( from http://blog.opennetcf.org/sbogdanov/ )

using System;
using System.Drawing;
using System.Collections;
using System.Windows.Forms;
using System.Data;
using System.Runtime.InteropServices;

namespace SmartDeviceApplication1
{
      public class Form1 : System.Windows.Forms.Form
      {
            const int EXSTYLE = -20;
            const int WS_EX_NOANIMATION = 0x04000000;

            [DllImport("coredll.dll", SetLastError=true)]
            public static extern void SetWindowLong(IntPtr hWnd, int GetWindowLongParam, uint nValue);

            [DllImport("coredll.dll", SetLastError=true)]
            public static extern uint GetWindowLong(IntPtr hWnd, int nItem);

            [DllImport("coredll.dll")]
            private static extern IntPtr GetCapture();

            public Form1()
            {
                  InitializeComponent();

                  Capture = true;
                  IntPtr hwnd = GetCapture();
                  Capture = false;

                  uint style = GetWindowLong(hwnd, EXSTYLE);
                  style |= WS_EX_NOANIMATION;
                  SetWindowLong(hwnd, EXSTYLE, style);
            }
0
 
topdog770Commented:
When you say don't show the applications on the taskbar, what do you mean?  CE doesn't, as far as I'm aware, have a task bar.


From http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnnetcomp/html/sdeforvb.asp

Form and controls
As a rough guide, the .NET Compact Framework version of the Form supports more than three quarters of the events and methods and about half of the properties of the Form in the full version. You can set the colors, certain style properties, and include a menu. What you can't do is create an MDI application, SHOW THE FORM IN THE TASKBAR, implement drag and drop, and respond to certain keyboard events (like the Cancel button) that are not appropriate for small devices.

0
 
mromeoAuthor Commented:
Well, I'm running it in the CE Emulator right now. Maybe it won't happen when I move it to the actual device.  I'll try that today.
0
 
mromeoAuthor Commented:
Perfect...thanks!
0
 
topdog770Commented:
You're welcome, helped me learn something too!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.