Taskvisible and NotifyIcon. Not supported. Why?

  • Thread starter Thread starter LWoodIS
  • Start date Start date
L

LWoodIS

TaskVisible property not supported in VB.Net
Is there any WinAPI around this problem?

Why do you support NotifyIcon when you do not support TaskVisible property
in VB.Net? Your help says similar interface as Antivirus, this is not true.
Antivirus only shoes up in Task List when it is visible.

My app cannot be a service, because it needs to be User Specific.
Quickbooks will automatically launch my Application when it starts up.
User can launch my application and leave it on the system tray using
NotifyIcon, for dynamic comaprisons.
My applciation can dynamically launch Quickbooks when needed.

The purpose of the application is to Synchronize data between QB and an SQL
application. The secondary purpose is to provide analysis tools, data
comparisons, and batch updates.
Needless to say this application is quite powerfull and security is a prime
concern.
Data integrity is extremely important, a confused user or accidental
activations can be problematic.

I need to remove the applcation from the Task List. So that Alt-Tab will
not activate my application or Task switching. Can you offer any
suggestions or workarounds?

Thank You
Lewis
 
Hello Lewis,

Thanks for your post. As I understand, you are looking for the replacement
of App.TaskVisible in VB .NET. I'd like to share the following information
with you:

1. As you know, there is no equivalent for the TaskVisible property in
Visual Basic .NET, because such tasks generally run at background. Please
refer to the following MSDN article:

TaskVisible Property Changes in Visual Basic .NET
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbcon/html/
vbcontaskvisiblepropertychangesinvisualbasicnet.asp?frame=true

2. To work around the problem, I suggest that you can create two projects,
one is a Service, the other is a WinForm application. The Service is
responsible for background data manipulation say, synchronizing data
between QB and SQL, data comparison, batch updates, etc. While the WinForm
application provides the user interface only, it forwards the user commands
to Service and displays the result.

Does this help?

Regards,

HuangTM
Microsoft Online Partner Support
MCSE/MCSD

Get Secure! -- www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
 
Yeah, but that is not a great solution. Services run for the computer. So
if another user logs on the domain at that computer then the user can batch
update QB & SQL, and analyze confidential data.

QB has to be able to launch the app automatically, but the app must access
QB so it can automatically launch QB auto login feature. Asking for
password at QB and my app level is a bit redundant and may occur repeatedly.

Telling my users that they must place a padlock on the computer is also a
bit much.

Why would anyone want a NotifyIcon in a Windows Application? Should be
removed from arsenal then.

Lewis
 
You give up to quickly!!! I also posted in vb.enteprise. Note my reply
below:

I FIGURED IT OUT. Below you will find the code. Y0ou may want to post this
as a sample.
Note the lines in New, Load, and Menuitem Click are all neccessary.
Otherwise you ALT-TAB will start off, or form visible, or MenuItem Click
will not display it the first time.

Public Class Form1
Inherits System.Windows.Forms.Form

Public Sub New()
MyBase.New()

'This call is required by the Windows Form Designer.
InitializeComponent()

'Add any initialization after the InitializeComponent() call
Me.WindowState = FormWindowState.Minimized
Me.Visible = False
Me.Hide()
End Sub


Private Sub MenuItem1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MenuItem1.Click
Me.Show()
Me.WindowState = FormWindowState.Normal
Me.Visible = True
Me.ShowInTaskbar = True
End Sub

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Me.Hide()
End Sub

Private Sub Form1_Load(ByVal sender As Object, ByVal e As
System.EventArgs) Handles MyBase.Load
'Me.WindowState = FormWindowState.Minimized
Me.Hide()
End Sub
End Class


Lewis


Peter Huang said:
Hi Lewis,

Thanks for your quick reply.

To prevent the appliation was activated by using Alt-Tab, I think you may
simply set its to hide, so that it will be elimitated from the Task List,
which will achieve. You may hide the form by click a button, if you wants
to do it by click the minimized button, you may need to override the
winproc and handle the message yourself.


Private Sub MenuItem1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MenuItem1.Click
Me.WindowState = FormWindowState.Normal
Me.Show()
End Sub

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Me.Hide()
End Sub

Public Class MyForm
Inherits System.Windows.Forms.Form
Public Const WM_SYSCOMMAND = &H112
Public Const SC_MINIMIZE = &HF020
Protected Overrides Sub WndProc(ByRef m As System.Windows.Forms.Message)
If m.Msg = WM_SYSCOMMAND And m.WParam.ToInt32 = SC_MINIMIZE Then
Me.Hide()
Me.WindowState = FormWindowState.Minimized
Return
End If
MyBase.WndProc(m)
End Sub
End Class

You may try my suggestion and let me know the result.


Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
 
Back
Top