Re: Need Expert Opinion on design issue by Neil
Neil
Mon Dec 15 16:57:33 CST 2003
Yes, I have tried that, but I think the nature of this problem lies deeper.
The problem has to do with creating two different windows within my shell
extension DLL. It seems that whichever shows itself first dictates the
state of the visual styles. The problem is that there is no way that I know
of to apply visual styles to a window that is created within
IShellView::CreateViewWindow. For my other window which is a dialog, I
simply create it like normal and then show it in an Application.Run() method
call. If I include Application.EnableVisualStyles() before this function,
my dialog is indeed XP Themed, but after I close it, and attempt to show my
IShellView window, things start to act flakey and eventually explorer
crashes. If, on the other hand, I show my IShellView window first, and then
show my dialog, the dialog appears unthemed even though I called
Application.EnableVisualStyles before the Run method.
Anyway, since this app is not your ordinary simple executable, I don't
expect much in the way of help, so I've decided to bite the bullet and
create my own custom controls that use UxTheme to directly get the XP theme
look. So far this approach seems to be working create, although it is quite
time consumeing, but after I'm done, I'll have a nice UxTheme library full
of controls I can keep using with other programs.
"Neal Andrews" <neal@NOSPAN_ALIAS.com> wrote in message
news:egNYXtzwDHA.2508@TK2MSFTNGP12.phx.gbl...
> Are you calling Application.DoEvents directly after calling
> EnableVisualStyles? There are some bugs with using the EnableVisualStyles
> call but calling DoEvents directly after EnableVisualStyles should in most
> cases fix the problem of crashes.
>
> Regards
> Neal
>
>
> may "Neil" <neil.axe@verizon.net.invalid> wrote in message
> news:ud%23VgOPwDHA.2444@TK2MSFTNGP09.phx.gbl...
> > Greetings all,
> >
> > Ok, I've developed a .NET application that integrates into the Windows
> shell
> > as a namespace extension (think of Scheduled Tasks and you'll get the
> > general look of my app). Since I've written it in C# using the 1.1
> > framework, I decided to support the XP look by calling
> > Application.EnableVisual Styles(), however here lies the problem:
> >
> > It appears that calling EnableVisualStyles() works as long as its'
called
> > from an executable. Unfortunately, in my case, I have no starting
> > executable. Technically the executable is Windows Explorer
(explorer.exe)
> > which calls into my DLL through various interfaces. To make a long
story
> > short, calling EnableVisualStyles within my DLL eventually leads to a
> crash
> > of the Windows exlplorer interface, so I'm left with one option to get
the
> > XP style interface, and this is where I need expert opinions:
> >
> > If I include a manifest named explorer.exe.manifest and install it into
> the
> > windows directory, everthing works great. My windows inherit the XP
> > interface, however so does other programs that are tied to Windows
> > explorer, such as scheduled tasks. So my question is, should I install a
> > manfiest that potentially alters other programs interface just to get my
> app
> > to have the XP style interface, or should I just leave it alone? The
> reason
> > I ask this is that this is going to be a commercial application, and I
> want
> > it to look professional (i.e. when run on XP, one would expect it to
have
> an
> > XP interface), but am I crossing the line by installing a file that
could
> > have affects on other apps that are not mine?
> >
> > All opinons are welcome!
> >
> > Neil Axe
> > Exalien Software
> >
> >
>
>