No-Click and Application manifest file.

G

Guest

I have a windows form application distributed via no click deployment. I am
thinking about adding xp theme support using an application manifest. I know
the manifest is not downloaded to the client machine because of this I
embedded the manifest as resource in the *.exe file, as recommended by many
people. If I run the application using a url(No click) then xp style
visualization isn't enabled. If i run it locally(clicking on the .exe file)
then it is enabled. Because of this i created a IEExec.exe.manifest and
placed it in the framework directory and xp style is supported even using no
click. Of course this is not the way to do it. Does any one know how to
actually support xp theme in no click deployment situations.
Application.EnbableVisualStyle()
Application.DoEvents() does not work throws an SEHException. thanks for
any suggestions.
 
K

Kevin Yu [MSFT]

Hi

First of all, I would like to confirm my understanding of your issue. From
your description, I understand that you need to enable visual style on a no
touch deployment app. If there is any misunderstanding, please feel free to
let me know.

When you need to apply XP Visual Styles to a Windows application that runs
as a separate process. you can either use a separate manifest file or embed
it in the resource as RT_MANIFEST(with index 1). If you build your
application in VS .NET 2003, then you can take advantage of the new method
EnableVisualStyles. But if you run your windows application on the web via
No-touch deployment, then the manifest approach will not work.

So when you run your windows application on the web via No-touch
deployment, you are running inside the context of another process such as
IE. The manifest will not be looked at. The only official solution is to
use Application.EnableVisualStyles which applies XP visual style to the
activation context before any window is created.

I tried it on my computer, and it works fine. Here is an example:

Application.EnableVisualStyles();
Application.DoEvents();
Application.Run(new Form1());

Make sure that you have set the FlatStyle property to FlatStyle.System.

Also, here is a community thread that discussing the same problem. HTH.

http://groups.google.com/groups?hl=zh-CN&lr=&rls=GGLD,GGLD:2004-43,GGLD:en&t
hreadm=6c7eb516.0311270224.409a5ff3%40posting.google.com&rnum=1&prev=/groups
%3Fq%3DEnableVisualStyles%2Bdeployment%26hl%3Dzh-CN%26lr%3D%26rls%3DGGLD,GGL
D:2004-43,GGLD:en%26selm%3D6c7eb516.0311270224.409a5ff3%2540posting.google.c
om%26rnum%3D1

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."
 
G

Guest

HI, thanks for the response.
From my experience, using
Application.EnableVisualStyles();
Application.DoEvents(); do not work and thorws an SEHException.

The following blog explains it.
http://blogs.msdn.com/rprabhu/archive/2003/09/28/56540.aspx
I knew , from testing, when you run the application via No_touch ,it is
run under IE's context. Tthat is the reason why i created an
IEExec.exe.manifest and everything worked fine. So the bottom line, Enabling
XP style isn't that simple or it isn't possible with out any problems.
 
K

Kevin Yu [MSFT]

Hi,

I would like to know if creating a manifest file resolved the problem? Is
there anything I can help?

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."
 
G

Guest

I have to create two manifests, one for my application and one for
IEExec.exe. Manifest for IEExec.exe is neccessary to support xp stlyle for
no-click applications. Do you know what causes the SEHException?, this
happens usually when i close other forms. We catcah every single exceptions
and when this is thrown, the applciation simply terminates. If i know what
causes this then I might be able to work around it and I could use
Application.enableVisualStyles() and
Application.DoEvents(). So i dont need to use use two manifests. Please let
me know. thanks.
 
K

Kevin Yu [MSFT]

Hi,

You're getting the SEHException because you might be calling the
EnableVisualStyles method during or after the form loads.

EnableVisualStyles should be called only once and before any forms are
loaded. So create a Sub Main() with this syntax:

<STAThread()> Public Sub Main()
Application.EnableVisualStyles()
Application.Run(New frmMain)
End Sub

HTH.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."
 
G

Guest

i am doing the same thing; i even call Application.DoEvents() after
enableVisualStyles(). I think this is a known bug and I spoke to a really
nice guy from ms. He suggested doing my own activation context management
through p/invoke. Finally, we decided not to support xp theme for the time
being. thanks.
 
K

Kevin Yu [MSFT]

You're welcome. Thanks for sharing your experience with all the people
here. If you have any questions, please feel free to post them in the
community.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top