i used the standard subclassing to create a system tray icon and then used the following code for the event handling

VB Code:
  1. Select Case uMsg
  2.             Case WM_MYHOOK
  3.            
  4.                Select Case lParam
  5.                   Case WM_RBUTTONUP
  6.                   SetForegroundWindow (Main_Page.hwnd)
  7.                   Main_Page.PopupMenu Main_Page.mnusystray
  8.                  
  9.                   Case WM_LBUTTONDBLCLK
  10.                   Main_Page.WindowState = vbNormal
  11.                   Main_Page.Show
  12.                  
  13.                   Case NIN_BALLOONSHOW
  14.                  
  15.                            
  16.                   Case NIN_BALLOONHIDE
  17.                            
  18.                   Case NIN_BALLOONUSERCLICK
  19.                   Main_Page.WindowState = vbNormal
  20.                   Main_Page.Show
  21.                            
  22.                   Case NIN_BALLOONTIMEOUT
  23.                            
  24.                End Select

the problem is that on right clicking the sysicon the menu popsup but when i select a menu .the app freezes

VB Code:
  1. Private Sub mnushowmain_Click()
  2.     Main_Page.WindowState = vbNormal
  3.     Main_Page.Show
  4. End Sub

the above is to display the main form

and in my form_resize i have the following code
VB Code:
  1. ShellTrayRemove
  2.     UnSubClass Main_Page.hwnd
  3.     Me.lblmsg.Caption = ""
  4.     Me.Show

interestingly the WM_LBUTTONDBLCLK event works fine,where could the problem lie?