[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

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

Posted on 2006-04-19
5
Medium Priority
?
1,485 Views
Last Modified: 2010-05-18
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.
0
Comment
Question by:mromeo
  • 3
  • 2
5 Comments
 
LVL 12

Expert Comment

by:topdog770
ID: 16493000
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
 

Author Comment

by:mromeo
ID: 16497505
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
 
LVL 12

Accepted Solution

by:
topdog770 earned 800 total points
ID: 16498865
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
 

Author Comment

by:mromeo
ID: 16554590
Perfect...thanks!
0
 
LVL 12

Expert Comment

by:topdog770
ID: 16562010
You're welcome, helped me learn something too!
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction Although it is an old technology, serial ports are still being used by many hardware manufacturers. If you develop applications in C#, Microsoft .NET framework has SerialPort class to communicate with the serial ports.  I needed to…
This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an anti-spam), the admin…
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
Suggested Courses
Course of the Month17 days, 16 hours left to enroll

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question