Re: system tray icon application



No at the bottom of the screen

Ive created both 16x16 and 32x32 ico files
and ive tried including as content in the project and compile
assign it as a solutions icon absolutley nothing!!
Im using vis studio 2003 and vb dot net

Basically i want an image to be displayed on the system toolbar at the bottom.
Ive based my form load code on Mr Feinmans article (Thanks alex very useful)
But nothing comes up in the emulator!!

Pray tell me how are you expected to develop apps for the pocket PC when
trying to display an Icon appears to be a mamoth task!!!

An ideas please!!!




' Extract icon from the application's exe
' This requires that app icon were set in the project properties
Dim szPath As String =
Path.GetDirectoryName([Assembly].GetExecutingAssembly().GetModules(0).FullyQualifiedName)
Dim szAssemb =
[Assembly].GetExecutingAssembly().GetModules(0).FullyQualifiedName

Dim resources As System.Resources.ResourceManager = New
System.Resources.ResourceManager(GetType(Form1))

Me.Icon = CType(resources.GetObject("$this.Icon"),
System.Drawing.Icon)


Me.mainMenu1 = New System.Windows.Forms.MainMenu
Me.Menu = Me.mainMenu1
Me.Text = "Form1"

ExtractIconEx(szAssemb, 0, 0, hIcon, 1)

' Fill NOTIFYICONDATA with data
Dim nid As New NOTIFYICONDATA
' In our struct definition we have omitted emebedded wchar array
size 64 - we need to account for it
Dim cbSize As Integer = Marshal.SizeOf(nid) + 64 *
Marshal.SystemDefaultCharSize
' Allocate memory
Dim pData As IntPtr = LocalAlloc(LPTR, cbSize)
Dim ltemp As IntPtr
' Set fields of the NOTIFYICONDATA (see SDK documentation)
nid.cbSize = cbSize
nid.hIcon = hIcon
nid.hWnd = msgWnd.Hwnd
nid.uCallbackMessage = msg
nid.uID = 1
nid.uFlags = NIF_ICON Or NIF_MESSAGE Or NIF_TIP
Marshal.StructureToPtr(nid, pData, False)

' Add tooltip
Dim arrTooltip As Char() = "My tooltip".ToCharArray()
ltemp = LocalAlloc(LPTR, pData.ToInt32() + Marshal.SizeOf(nid))

Marshal.Copy(arrTooltip, 0, ltemp, arrTooltip.Length)

' Register with shell
Dim ret As Boolean = Shell_NotifyIcon(NIM_ADD, pData)
LocalFree(pData)

' Set up event handler to handle incoming messages
AddHandler msgWnd.AfterMessageEvent, AddressOf
msgwnd_AfterMessageEvent



"Peter Foot [MVP]" wrote:

> When you say toolbar, you mean the titlebar at the top of the screen? If so
> you need the SHNotification* APIs which you'll find neatly wrapped in the
> OpenNETCF.WindowsCE.Forms.Notification class in the SDF. There isn't a
> sample included on how to use it, but it's designed to follow the .NETCF
> v2.0 equivalent, and there is a sample for that here:-
> http://msdn2.microsoft.com/en-us/library/7ctk0s42(en-us,vs.80).aspx
>
> It should allow you to do almost everything the v2.0 control does.
>
> Peter
>
> --
> Peter Foot
> Windows Embedded MVP
> http://www.inthehand.com | http://www.peterfoot.net
>
> "Stu" <Stu@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
> news:0B934978-F35B-4A3B-B3F8-BBDF5C1AD45D@xxxxxxxxxxxxxxxx
> > Hi,
> >
> > Im developing a pocket pc app ind vb dot net and basically when the
> > application
> > starts i would like a icon to appear on the pocket pc toolbar.
> > Which when I mouse click on it displays a menu
> >
> > Any links,sample code is appreciated
> >
> > TIA
> >
> > Stu
> >
>
>
>
.



Relevant Pages

  • Re: Notes View - Acces via 1 click
    ... Not at the bottom of your screen, but you can add a button to any other ... Rightclick next to any toolbar and choose customize (or ... in the category View on the commands tab drag the icon ... In PPT 97, Notes View could have been accessed ...
    (microsoft.public.powerpoint)
  • Re: C# toolbar stuck on bottom of screen
    ... the display rather than at the bottom by the SIP? ... Is a custom toolbar needed? ... will be on the bottom of the screen and the Task Bar will be on the ... Pocket PC, but the menus disappeared starting with Pocket PC 2003. ...
    (microsoft.public.pocketpc.developer)
  • .Net Compact Framework for Pocket PC 2003 SE
    ... I develop an application using .net compact framework for Pocket ... the image of icon on toolbar cannot be displayed in ... either emulator or physical HW. ...
    (microsoft.public.dotnet.framework.compactframework)
  • .net compact framework for Pocket PC 2003 SE
    ... I develop an application using .net compact framework for Pocket ... the image of icon on toolbar cannot be displayed in ... either emulator or physical HW. ...
    (microsoft.public.pocketpc.developer)
  • Re: show desktop help!
    ... "Sam" wrote in message ... I've lost the 'show desktop' icon I had in the Quick Launch part of ... > toolbar at the bottom of my desktop. ... Not an answer but lateral thinking - why not use the Desktop Toolbar ...
    (microsoft.public.windows.inetexplorer.ie6.browser)