Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
Windos
win32.3rdparty
win32.directx.audio
win32.directx.ddk
win32.directx.graphics
win32.directx.input
win32.directx.managed
win32.directx.misc
win32.directx.networking
win32.directx.sdk
win32.directx.video
win32.dirx.grap.shaders
win32.gdi
win32.international
win32.kernel
win32.messaging
win32.mmedia
win32.networks
win32.ole
win32.rtc
win32.tapi
win32.tapi.beta
win32.tools
win32.ui
win32.wince
win32.wmi
windows.mediacenter
winfx.aero
winfx.announcements
winfx.avalon
winfx.collaboration
winfx.fundamentals
winfx.general
winfx.indigo
winfx.sdk
winfx.winfs
  
 
date: Mon, 5 Nov 2007 12:55:00 -0800,    group: microsoft.public.windows.developer.winfx.avalon        back       


Re: How to intercept a Win32 Message in WPF App?   
How did you resolve the problem as WPF uses <Window> element instead of Form? 
Available articles out there only show how to intercept using WinForm. I have 
the same problem and am stuck. Appreciate that you will share your experience 
on this issue.

"Fabio Galuppo" wrote:

> Hello Nick,
> 
> Thanks for this information!
> 
> However, I hope in the "future" releases of WPF somekind of support to 
> receive these system messages. We have a lot of system messages that Windows 
> OS notifies an application (WM_TIMECHANGE, WM_POWER, WM_DEVICECHANGE to name 
> a few) and I don´t see the need to use classes from System.Windows.Interop to 
> receive a system message. 
> 
> I understand this kind of feature must be Windows only (perhaps not 
> supported in WPF/E). However, suppose that I´m writing a "Battery Control UI" 
> app, I can do these only with Windows Forms (with MDX) or Win32 (with 
> DirectX), but I can´t with WPF without Interop AND hosting a control :(.
> 
> Thanks again,
> 
> -- 
> Fabio Galuppo
> fabiogaluppo.blogspot.com
> 
> 
> "Nick Kramer [MSFT]" wrote:
> 
> > No, there's no "native" WPF API for that.  Not every window message has a 
> > WPF equivalent -- there's a lot of window messages that have nothing to do 
> > with presentation and UI.  Often you can use Winforms's 
> > System.Windows.Forms.SystemInformation class, although I don't remember if 
> > wm_timechange is part of SystemInformation.
> > 
> > Of course, as you suggested, you can also use wndprocs and/or 
> > HwndSource.AddHook.
> > 
> > -- 
> > -Nick Kramer [MSFT]
> > http://blogs.msdn.com/nickkramer
> > 
> > This posting is provided "AS IS" with no warranties, and confers no rights.
> > Use of included script samples are subject to the terms specified at
> > http://www.microsoft.com/info/cpyright.htm
> > 
> > "Fabio Galuppo"  wrote in message 
> > news:7104AA85-36B4-49F8-BBF5-8C3C19E9D765@microsoft.com...
> > > I´m trying to intercept a Win32 Message (WM_TIMECHANGE) in my WPF
> > > Application. In Windows Forms this is a simple task, but I didn´t found 
> > > how
> > > can I do to receive a Win32 Message in WPF.
> > >
> > > My question is: How can I do to intercept "natively" a Win32 Message in 
> > > WPF
> > > Application (via code and/or XAML) ? Is possible (it means without any 
> > > kind
> > > of interop or host form) ?
> > >
> > > Thanks in advanced,
> > >
> > > -- 
> > > Fabio Galuppo
> > > fabiogaluppo.blogspot.com 
> > 
> > 
> >
date: Mon, 5 Nov 2007 12:55:00 -0800   author:   Jen

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us