简体   繁体   中英

how to make program that be in the taskbar windows-CE

how to make C# program that will be All time in the taskbar ?

i want to Build a Keyboard program.

i need that when i open the device the program will open and be in the taskbar.

another question is, when i have an external program that has a Textbox, how

to make that when i press any key in my C# keyboard it will be in this external Textbox ?

thank's in advance

It's not implemented in the CF, but the NotifyIcon class is what you're after. The SDF does implement it . It would be used something like this:

m_notifyIcon = new NotifyIcon();
m_notifyIcon.Icon = this.Icon;
m_notifyIcon.Visible = true;
m_notifyIcon.Click += new EventHandler(m_notifyIcon_Click);
m_notifyIcon.DoubleClick += new EventHandler(m_notifyIcon_DoubleClick);

EDIT

If you want to implement this yourself, the place to start is with the Shell_NotifyIcon API. You'll want to pass it the handle to a MessageWindow class and handle the WM_NOTIFY messages.

To Create a system Tray application in Windows-CE, put some code like:

CSystemTray m_TrayIcon;   // Member variable of some class

... 
// in some member function maybe...

m_TrayIcon.Create(pParentWnd, WM_MY_NOTIFY, "Click here", 
                  hIcon, nTrayIconID);

Eg. For a non-MFC tray icon, do the following:

Collapse
CSystemTray m_TrayIcon;   // Member variable of some class

... 
// in some member function maybe...

m_TrayIcon.Create(hInstance, NULL, WM_MY_NOTIFY, 
                  "Click here", hIcon, nID);

// Send all menu messages to hMyMainWindow

m_TrayIcon.SetTargetWnd(hMyMainWindow);

As found here:

http://www.codeproject.com/KB/shell/systemtray.aspx

To create a system tray application in Windows XP or Windows 7/Vista, put some code like this in your project:

private void Form1_Resize(object sender, System.EventArgs e)
{
   if (FormWindowState.Minimized == WindowState)
      Hide();
}

and this to handle the system tray click

private void notifyIcon1_DoubleClick(object sender,
                                     System.EventArgs e)
{
    Show();
    WindowState = FormWindowState.Normal;
}

This and more information found at :

http://www.developer.com/net/net/article.php/3336751/C-Tip-Placing-Your-C-Application-in-the-System-Tray.htm

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM