|
|
|
start date: Fri, 13 Jul 2007 07:14:06 -0700,
posted on: microsoft.public.dotnet.framework.compactframework
back
| Thread Index |
|
1
Deasun
|
|
2
Fabien
|
|
3
Deasun
|
|
4
Paul G. Tobey [eMVP] p space tobey no spam AT no instrument no spam DOT com
|
|
5
Deasun
|
|
6
Paul G. Tobey [eMVP] p space tobey no spam AT no instrument no spam DOT com
|
|
7
Deasun
|
|
8
Paul G. Tobey [eMVP] p space tobey no spam AT no instrument no spam DOT com
|
|
9
Deasun O'Donnachadha
|
|
10
Lisa Cowan
|
Changing the Today screen image?
Hello all,
Does anyone have a example of setting the today screens image to another file?
I am looking to build my first PPC app and decide to do a wallpaper changer.
Wow finding documentation on this is not easy!
I would like to do this in VB.net or C3.net.
Could anyone give me some pointers here?
Thanks
--
Deasun
Home Site: www.tirnaog.com
Check out: The Code Vault in my forums section.
Date:Fri, 13 Jul 2007 07:14:06 -0700
Author:
|
Re: Changing the Today screen image?
Hi,
Try to change this registry key : HKEY_CURRENT_USER\ControlPanel\Home
with your new image path and send a Windows Message to refresh the
today screen.
In C#, you must import the SendMessage function:
SendMessage((IntPtr)HWND_BROADCAST, WM_WININICHANGE,
SPI_SETDESKWALLPAPER, 0)
the import:
[DllImport("coredll.dll")]
private static extern int SendMessage(IntPtr hWnd, uint msg, int
wParam, int lParam);
BR
Fabien Decret (Device Application Development MVP)
Windows Embedded Consultant
ADENEO (ADESET)
http://www.adeneo.adetelgroup.com/ | http://fabdecret.blogspot.com/
On 13 juil, 16:14, Deasun wrote:
> Hello all,
>
> Does anyone have a example of setting the today screens image to another file?
> I am looking to build my first PPC app and decide to do a wallpaper changer.
> Wow finding documentation on this is not easy!
> I would like to do this in VB.net or C3.net.
>
> Could anyone give me some pointers here?
>
> Thanks
> --
> Deasun
> Home Site:www.tirnaog.com
> Check out: The Code Vault in my forums section.
Date:Fri, 13 Jul 2007 08:21:00 -0700
Author:
|
Re: Changing the Today screen image?
Thank you for your reply Fabien.
I tried what you said and I keep getting a Unautherizedaccess error!
Code I am currently trying is; [VB.net code.]
Public Shared HWND_BROADCAST As IntPtr = IntPtr.op_Explicit(&HFFFF)
Public Const WM_WININICHANGE = &H1A
Public Shared SPI_SETDESKTOPWALLPAPER As Integer = 20
'<DllImport("coredll.dll")>
Private Declare Function SendMessage Lib "coredll.dll" Alias "SendMessageA"
(ByVal hWnd As IntPtr, ByVal Msg As System.Int32, ByVal wParam As
System.Int32, ByVal lParam As System.Int32)
private sub SetWallpaper()
Dim strWhoAmI As String = ""
Dim registryKey As Microsoft.Win32.RegistryKey
Dim strValues() As String
try
registryKey = Microsoft.Win32.Registry.CurrentUser '.CurrentUser '
..GetValue("HKEY_CURRENT_USER\ControlPanel\Home")
strValues =
registryKey.OpenSubKey("ControlPanel").OpenSubKey("DeskTop").GetValueNames()
strWhoAmI =
registryKey.OpenSubKey("ControlPanel").OpenSubKey("DeskTop").GetValue("Wallpaper").ToString
registryKey.OpenSubKey("ControlPanel").OpenSubKey("DeskTop").SetValue("Wallpaper", "\Windows\Guava bubbles.tsk")
strWhoAmI =
registryKey.OpenSubKey("ControlPanel").OpenSubKey("DeskTop").GetValue("Wallpaper").ToString
registryKey.Close()
SendMessage(HWND_BROADCAST, WM_WININICHANGE, SPI_SETDESKTOPWALLPAPER, 0)
Catch ex As Exception
End Try
End Sub
--
Deasun
Home Site: www.tirnaog.com
Check out: The Code Vault in my forums section.
"Fabien" wrote:
> Hi,
>
> Try to change this registry key : HKEY_CURRENT_USER\ControlPanel\Home
> with your new image path and send a Windows Message to refresh the
> today screen.
> In C#, you must import the SendMessage function:
>
> SendMessage((IntPtr)HWND_BROADCAST, WM_WININICHANGE,
> SPI_SETDESKWALLPAPER, 0)
>
> the import:
> [DllImport("coredll.dll")]
> private static extern int SendMessage(IntPtr hWnd, uint msg, int
> wParam, int lParam);
>
> BR
>
> Fabien Decret (Device Application Development MVP)
> Windows Embedded Consultant
>
> ADENEO (ADESET)
> http://www.adeneo.adetelgroup.com/ | http://fabdecret.blogspot.com/
>
>
> On 13 juil, 16:14, Deasun wrote:
> > Hello all,
> >
> > Does anyone have a example of setting the today screens image to another file?
> > I am looking to build my first PPC app and decide to do a wallpaper changer.
> > Wow finding documentation on this is not easy!
> > I would like to do this in VB.net or C3.net.
> >
> > Could anyone give me some pointers here?
> >
> > Thanks
> > --
> > Deasun
> > Home Site:www.tirnaog.com
> > Check out: The Code Vault in my forums section.
>
>
>
Date:Fri, 13 Jul 2007 12:14:01 -0700
Author:
|
Re: Changing the Today screen image?
You get an error *WHEN*? What line of code is the problem?
Paul T.
"Deasun" wrote in message
news:0773E994-30AA-4A91-AD14-160AC4E6DFA4@microsoft.com...
> Thank you for your reply Fabien.
> I tried what you said and I keep getting a Unautherizedaccess error!
>
> Code I am currently trying is; [VB.net code.]
>
> Public Shared HWND_BROADCAST As IntPtr = IntPtr.op_Explicit(&HFFFF)
> Public Const WM_WININICHANGE = &H1A
> Public Shared SPI_SETDESKTOPWALLPAPER As Integer = 20
>
> '<DllImport("coredll.dll")>
> Private Declare Function SendMessage Lib "coredll.dll" Alias
> "SendMessageA"
> (ByVal hWnd As IntPtr, ByVal Msg As System.Int32, ByVal wParam As
> System.Int32, ByVal lParam As System.Int32)
>
> private sub SetWallpaper()
> Dim strWhoAmI As String = ""
> Dim registryKey As Microsoft.Win32.RegistryKey
> Dim strValues() As String
> try
> registryKey = Microsoft.Win32.Registry.CurrentUser '.CurrentUser '
> .GetValue("HKEY_CURRENT_USER\ControlPanel\Home")
> strValues =
> registryKey.OpenSubKey("ControlPanel").OpenSubKey("DeskTop").GetValueNames()
> strWhoAmI =
> registryKey.OpenSubKey("ControlPanel").OpenSubKey("DeskTop").GetValue("Wallpaper").ToString
> registryKey.OpenSubKey("ControlPanel").OpenSubKey("DeskTop").SetValue("Wallpaper",
> "\Windows\Guava bubbles.tsk")
> strWhoAmI =
> registryKey.OpenSubKey("ControlPanel").OpenSubKey("DeskTop").GetValue("Wallpaper").ToString
> registryKey.Close()
> SendMessage(HWND_BROADCAST, WM_WININICHANGE, SPI_SETDESKTOPWALLPAPER, 0)
> Catch ex As Exception
>
> End Try
> End Sub
>
> --
> Deasun
> Home Site: www.tirnaog.com
> Check out: The Code Vault in my forums section.
>
>
> "Fabien" wrote:
>
>> Hi,
>>
>> Try to change this registry key : HKEY_CURRENT_USER\ControlPanel\Home
>> with your new image path and send a Windows Message to refresh the
>> today screen.
>> In C#, you must import the SendMessage function:
>>
>> SendMessage((IntPtr)HWND_BROADCAST, WM_WININICHANGE,
>> SPI_SETDESKWALLPAPER, 0)
>>
>> the import:
>> [DllImport("coredll.dll")]
>> private static extern int SendMessage(IntPtr hWnd, uint msg, int
>> wParam, int lParam);
>>
>> BR
>>
>> Fabien Decret (Device Application Development MVP)
>> Windows Embedded Consultant
>>
>> ADENEO (ADESET)
>> http://www.adeneo.adetelgroup.com/ | http://fabdecret.blogspot.com/
>>
>>
>> On 13 juil, 16:14, Deasun wrote:
>> > Hello all,
>> >
>> > Does anyone have a example of setting the today screens image to
>> > another file?
>> > I am looking to build my first PPC app and decide to do a wallpaper
>> > changer.
>> > Wow finding documentation on this is not easy!
>> > I would like to do this in VB.net or C3.net.
>> >
>> > Could anyone give me some pointers here?
>> >
>> > Thanks
>> > --
>> > Deasun
>> > Home Site:www.tirnaog.com
>> > Check out: The Code Vault in my forums section.
>>
>>
>>
Date:Fri, 13 Jul 2007 12:38:28 -0700
Author:
|
Re: Changing the Today screen image?
Sorry, meant to say that last time.
On trying to set the value;
registryKey.OpenSubKey("ControlPanel").OpenSubKey("DeskTop").SetValue("Wallpaper",
"\Windows\Guava bubbles.tsk")
--
Deasun
Home Site: www.tirnaog.com
Check out: The Code Vault in my forums section.
"Paul G. Tobey [eMVP]" wrote:
> You get an error *WHEN*? What line of code is the problem?
>
> Paul T.
>
> "Deasun" wrote in message
> news:0773E994-30AA-4A91-AD14-160AC4E6DFA4@microsoft.com...
> > Thank you for your reply Fabien.
> > I tried what you said and I keep getting a Unautherizedaccess error!
> >
> > Code I am currently trying is; [VB.net code.]
> >
> > Public Shared HWND_BROADCAST As IntPtr = IntPtr.op_Explicit(&HFFFF)
> > Public Const WM_WININICHANGE = &H1A
> > Public Shared SPI_SETDESKTOPWALLPAPER As Integer = 20
> >
> > '<DllImport("coredll.dll")>
> > Private Declare Function SendMessage Lib "coredll.dll" Alias
> > "SendMessageA"
> > (ByVal hWnd As IntPtr, ByVal Msg As System.Int32, ByVal wParam As
> > System.Int32, ByVal lParam As System.Int32)
> >
> > private sub SetWallpaper()
> > Dim strWhoAmI As String = ""
> > Dim registryKey As Microsoft.Win32.RegistryKey
> > Dim strValues() As String
> > try
> > registryKey = Microsoft.Win32.Registry.CurrentUser '.CurrentUser '
> > .GetValue("HKEY_CURRENT_USER\ControlPanel\Home")
> > strValues =
> > registryKey.OpenSubKey("ControlPanel").OpenSubKey("DeskTop").GetValueNames()
> > strWhoAmI =
> > registryKey.OpenSubKey("ControlPanel").OpenSubKey("DeskTop").GetValue("Wallpaper").ToString
> > registryKey.OpenSubKey("ControlPanel").OpenSubKey("DeskTop").SetValue("Wallpaper",
> > "\Windows\Guava bubbles.tsk")
> > strWhoAmI =
> > registryKey.OpenSubKey("ControlPanel").OpenSubKey("DeskTop").GetValue("Wallpaper").ToString
> > registryKey.Close()
> > SendMessage(HWND_BROADCAST, WM_WININICHANGE, SPI_SETDESKTOPWALLPAPER, 0)
> > Catch ex As Exception
> >
> > End Try
> > End Sub
> >
> > --
> > Deasun
> > Home Site: www.tirnaog.com
> > Check out: The Code Vault in my forums section.
> >
> >
> > "Fabien" wrote:
> >
> >> Hi,
> >>
> >> Try to change this registry key : HKEY_CURRENT_USER\ControlPanel\Home
> >> with your new image path and send a Windows Message to refresh the
> >> today screen.
> >> In C#, you must import the SendMessage function:
> >>
> >> SendMessage((IntPtr)HWND_BROADCAST, WM_WININICHANGE,
> >> SPI_SETDESKWALLPAPER, 0)
> >>
> >> the import:
> >> [DllImport("coredll.dll")]
> >> private static extern int SendMessage(IntPtr hWnd, uint msg, int
> >> wParam, int lParam);
> >>
> >> BR
> >>
> >> Fabien Decret (Device Application Development MVP)
> >> Windows Embedded Consultant
> >>
> >> ADENEO (ADESET)
> >> http://www.adeneo.adetelgroup.com/ | http://fabdecret.blogspot.com/
> >>
> >>
> >> On 13 juil, 16:14, Deasun wrote:
> >> > Hello all,
> >> >
> >> > Does anyone have a example of setting the today screens image to
> >> > another file?
> >> > I am looking to build my first PPC app and decide to do a wallpaper
> >> > changer.
> >> > Wow finding documentation on this is not easy!
> >> > I would like to do this in VB.net or C3.net.
> >> >
> >> > Could anyone give me some pointers here?
> >> >
> >> > Thanks
> >> > --
> >> > Deasun
> >> > Home Site:www.tirnaog.com
> >> > Check out: The Code Vault in my forums section.
> >>
> >>
> >>
>
>
>
Date:Fri, 13 Jul 2007 12:52:02 -0700
Author:
|
Re: Changing the Today screen image?
At a guess, there's probably no key for one of those items that you're
chaining together, DeskTop, probably.
Paul T.
"Deasun" wrote in message
news:3B9867C0-3A95-4D42-8E37-EB86CBC7D018@microsoft.com...
> Sorry, meant to say that last time.
> On trying to set the value;
> registryKey.OpenSubKey("ControlPanel").OpenSubKey("DeskTop").SetValue("Wallpaper",
> "\Windows\Guava bubbles.tsk")
> --
> Deasun
> Home Site: www.tirnaog.com
> Check out: The Code Vault in my forums section.
>
>
> "Paul G. Tobey [eMVP]" wrote:
>
>> You get an error *WHEN*? What line of code is the problem?
>>
>> Paul T.
>>
>> "Deasun" wrote in message
>> news:0773E994-30AA-4A91-AD14-160AC4E6DFA4@microsoft.com...
>> > Thank you for your reply Fabien.
>> > I tried what you said and I keep getting a Unautherizedaccess error!
>> >
>> > Code I am currently trying is; [VB.net code.]
>> >
>> > Public Shared HWND_BROADCAST As IntPtr = IntPtr.op_Explicit(&HFFFF)
>> > Public Const WM_WININICHANGE = &H1A
>> > Public Shared SPI_SETDESKTOPWALLPAPER As Integer = 20
>> >
>> > '<DllImport("coredll.dll")>
>> > Private Declare Function SendMessage Lib "coredll.dll" Alias
>> > "SendMessageA"
>> > (ByVal hWnd As IntPtr, ByVal Msg As System.Int32, ByVal wParam As
>> > System.Int32, ByVal lParam As System.Int32)
>> >
>> > private sub SetWallpaper()
>> > Dim strWhoAmI As String = ""
>> > Dim registryKey As Microsoft.Win32.RegistryKey
>> > Dim strValues() As String
>> > try
>> > registryKey = Microsoft.Win32.Registry.CurrentUser '.CurrentUser '
>> > .GetValue("HKEY_CURRENT_USER\ControlPanel\Home")
>> > strValues =
>> > registryKey.OpenSubKey("ControlPanel").OpenSubKey("DeskTop").GetValueNames()
>> > strWhoAmI =
>> > registryKey.OpenSubKey("ControlPanel").OpenSubKey("DeskTop").GetValue("Wallpaper").ToString
>> > registryKey.OpenSubKey("ControlPanel").OpenSubKey("DeskTop").SetValue("Wallpaper",
>> > "\Windows\Guava bubbles.tsk")
>> > strWhoAmI =
>> > registryKey.OpenSubKey("ControlPanel").OpenSubKey("DeskTop").GetValue("Wallpaper").ToString
>> > registryKey.Close()
>> > SendMessage(HWND_BROADCAST, WM_WININICHANGE, SPI_SETDESKTOPWALLPAPER,
>> > 0)
>> > Catch ex As Exception
>> >
>> > End Try
>> > End Sub
>> >
>> > --
>> > Deasun
>> > Home Site: www.tirnaog.com
>> > Check out: The Code Vault in my forums section.
>> >
>> >
>> > "Fabien" wrote:
>> >
>> >> Hi,
>> >>
>> >> Try to change this registry key : HKEY_CURRENT_USER\ControlPanel\Home
>> >> with your new image path and send a Windows Message to refresh the
>> >> today screen.
>> >> In C#, you must import the SendMessage function:
>> >>
>> >> SendMessage((IntPtr)HWND_BROADCAST, WM_WININICHANGE,
>> >> SPI_SETDESKWALLPAPER, 0)
>> >>
>> >> the import:
>> >> [DllImport("coredll.dll")]
>> >> private static extern int SendMessage(IntPtr hWnd, uint msg, int
>> >> wParam, int lParam);
>> >>
>> >> BR
>> >>
>> >> Fabien Decret (Device Application Development MVP)
>> >> Windows Embedded Consultant
>> >>
>> >> ADENEO (ADESET)
>> >> http://www.adeneo.adetelgroup.com/ | http://fabdecret.blogspot.com/
>> >>
>> >>
>> >> On 13 juil, 16:14, Deasun wrote:
>> >> > Hello all,
>> >> >
>> >> > Does anyone have a example of setting the today screens image to
>> >> > another file?
>> >> > I am looking to build my first PPC app and decide to do a wallpaper
>> >> > changer.
>> >> > Wow finding documentation on this is not easy!
>> >> > I would like to do this in VB.net or C3.net.
>> >> >
>> >> > Could anyone give me some pointers here?
>> >> >
>> >> > Thanks
>> >> > --
>> >> > Deasun
>> >> > Home Site:www.tirnaog.com
>> >> > Check out: The Code Vault in my forums section.
>> >>
>> >>
>> >>
>>
>>
>>
Date:Fri, 13 Jul 2007 13:46:37 -0700
Author:
|
Re: Changing the Today screen image?
Nope checked that already.
All those keys are in there. The Wallpaper had the value: default.2bp in it.
Some sort of PPC bitmap file.
Just cant overwrite it. :(
--
Deasun
Home Site: www.tirnaog.com
Check out: The Code Vault in my forums section.
"Paul G. Tobey [eMVP]" wrote:
> At a guess, there's probably no key for one of those items that you're
> chaining together, DeskTop, probably.
>
> Paul T.
>
> "Deasun" wrote in message
> news:3B9867C0-3A95-4D42-8E37-EB86CBC7D018@microsoft.com...
> > Sorry, meant to say that last time.
> > On trying to set the value;
> > registryKey.OpenSubKey("ControlPanel").OpenSubKey("DeskTop").SetValue("Wallpaper",
> > "\Windows\Guava bubbles.tsk")
> > --
> > Deasun
> > Home Site: www.tirnaog.com
> > Check out: The Code Vault in my forums section.
> >
> >
> > "Paul G. Tobey [eMVP]" wrote:
> >
> >> You get an error *WHEN*? What line of code is the problem?
> >>
> >> Paul T.
> >>
> >> "Deasun" wrote in message
> >> news:0773E994-30AA-4A91-AD14-160AC4E6DFA4@microsoft.com...
> >> > Thank you for your reply Fabien.
> >> > I tried what you said and I keep getting a Unautherizedaccess error!
> >> >
> >> > Code I am currently trying is; [VB.net code.]
> >> >
> >> > Public Shared HWND_BROADCAST As IntPtr = IntPtr.op_Explicit(&HFFFF)
> >> > Public Const WM_WININICHANGE = &H1A
> >> > Public Shared SPI_SETDESKTOPWALLPAPER As Integer = 20
> >> >
> >> > '<DllImport("coredll.dll")>
> >> > Private Declare Function SendMessage Lib "coredll.dll" Alias
> >> > "SendMessageA"
> >> > (ByVal hWnd As IntPtr, ByVal Msg As System.Int32, ByVal wParam As
> >> > System.Int32, ByVal lParam As System.Int32)
> >> >
> >> > private sub SetWallpaper()
> >> > Dim strWhoAmI As String = ""
> >> > Dim registryKey As Microsoft.Win32.RegistryKey
> >> > Dim strValues() As String
> >> > try
> >> > registryKey = Microsoft.Win32.Registry.CurrentUser '.CurrentUser '
> >> > .GetValue("HKEY_CURRENT_USER\ControlPanel\Home")
> >> > strValues =
> >> > registryKey.OpenSubKey("ControlPanel").OpenSubKey("DeskTop").GetValueNames()
> >> > strWhoAmI =
> >> > registryKey.OpenSubKey("ControlPanel").OpenSubKey("DeskTop").GetValue("Wallpaper").ToString
> >> > registryKey.OpenSubKey("ControlPanel").OpenSubKey("DeskTop").SetValue("Wallpaper",
> >> > "\Windows\Guava bubbles.tsk")
> >> > strWhoAmI =
> >> > registryKey.OpenSubKey("ControlPanel").OpenSubKey("DeskTop").GetValue("Wallpaper").ToString
> >> > registryKey.Close()
> >> > SendMessage(HWND_BROADCAST, WM_WININICHANGE, SPI_SETDESKTOPWALLPAPER,
> >> > 0)
> >> > Catch ex As Exception
> >> >
> >> > End Try
> >> > End Sub
> >> >
> >> > --
> >> > Deasun
> >> > Home Site: www.tirnaog.com
> >> > Check out: The Code Vault in my forums section.
> >> >
> >> >
> >> > "Fabien" wrote:
> >> >
> >> >> Hi,
> >> >>
> >> >> Try to change this registry key : HKEY_CURRENT_USER\ControlPanel\Home
> >> >> with your new image path and send a Windows Message to refresh the
> >> >> today screen.
> >> >> In C#, you must import the SendMessage function:
> >> >>
> >> >> SendMessage((IntPtr)HWND_BROADCAST, WM_WININICHANGE,
> >> >> SPI_SETDESKWALLPAPER, 0)
> >> >>
> >> >> the import:
> >> >> [DllImport("coredll.dll")]
> >> >> private static extern int SendMessage(IntPtr hWnd, uint msg, int
> >> >> wParam, int lParam);
> >> >>
> >> >> BR
> >> >>
> >> >> Fabien Decret (Device Application Development MVP)
> >> >> Windows Embedded Consultant
> >> >>
> >> >> ADENEO (ADESET)
> >> >> http://www.adeneo.adetelgroup.com/ | http://fabdecret.blogspot.com/
> >> >>
> >> >>
> >> >> On 13 juil, 16:14, Deasun wrote:
> >> >> > Hello all,
> >> >> >
> >> >> > Does anyone have a example of setting the today screens image to
> >> >> > another file?
> >> >> > I am looking to build my first PPC app and decide to do a wallpaper
> >> >> > changer.
> >> >> > Wow finding documentation on this is not easy!
> >> >> > I would like to do this in VB.net or C3.net.
> >> >> >
> >> >> > Could anyone give me some pointers here?
> >> >> >
> >> >> > Thanks
> >> >> > --
> >> >> > Deasun
> >> >> > Home Site:www.tirnaog.com
> >> >> > Check out: The Code Vault in my forums section.
> >> >>
> >> >>
> >> >>
> >>
> >>
> >>
>
>
>
Date:Fri, 13 Jul 2007 15:32:04 -0700
Author:
|
Re: Changing the Today screen image?
And this is what sort of device? Maybe that API is locked by the device
OEM...
Paul T.
"Deasun" wrote in message
news:E6B9E16D-0AA8-4537-8CCB-B32CBAA47044@microsoft.com...
> Nope checked that already.
>
> All those keys are in there. The Wallpaper had the value: default.2bp in
> it.
> Some sort of PPC bitmap file.
> Just cant overwrite it. :(
>
> --
> Deasun
> Home Site: www.tirnaog.com
> Check out: The Code Vault in my forums section.
>
>
> "Paul G. Tobey [eMVP]" wrote:
>
>> At a guess, there's probably no key for one of those items that you're
>> chaining together, DeskTop, probably.
>>
>> Paul T.
>>
>> "Deasun" wrote in message
>> news:3B9867C0-3A95-4D42-8E37-EB86CBC7D018@microsoft.com...
>> > Sorry, meant to say that last time.
>> > On trying to set the value;
>> > registryKey.OpenSubKey("ControlPanel").OpenSubKey("DeskTop").SetValue("Wallpaper",
>> > "\Windows\Guava bubbles.tsk")
>> > --
>> > Deasun
>> > Home Site: www.tirnaog.com
>> > Check out: The Code Vault in my forums section.
>> >
>> >
>> > "Paul G. Tobey [eMVP]" wrote:
>> >
>> >> You get an error *WHEN*? What line of code is the problem?
>> >>
>> >> Paul T.
>> >>
>> >> "Deasun" wrote in message
>> >> news:0773E994-30AA-4A91-AD14-160AC4E6DFA4@microsoft.com...
>> >> > Thank you for your reply Fabien.
>> >> > I tried what you said and I keep getting a Unautherizedaccess error!
>> >> >
>> >> > Code I am currently trying is; [VB.net code.]
>> >> >
>> >> > Public Shared HWND_BROADCAST As IntPtr = IntPtr.op_Explicit(&HFFFF)
>> >> > Public Const WM_WININICHANGE = &H1A
>> >> > Public Shared SPI_SETDESKTOPWALLPAPER As Integer = 20
>> >> >
>> >> > '<DllImport("coredll.dll")>
>> >> > Private Declare Function SendMessage Lib "coredll.dll" Alias
>> >> > "SendMessageA"
>> >> > (ByVal hWnd As IntPtr, ByVal Msg As System.Int32, ByVal wParam As
>> >> > System.Int32, ByVal lParam As System.Int32)
>> >> >
>> >> > private sub SetWallpaper()
>> >> > Dim strWhoAmI As String = ""
>> >> > Dim registryKey As Microsoft.Win32.RegistryKey
>> >> > Dim strValues() As String
>> >> > try
>> >> > registryKey = Microsoft.Win32.Registry.CurrentUser '.CurrentUser '
>> >> > .GetValue("HKEY_CURRENT_USER\ControlPanel\Home")
>> >> > strValues =
>> >> > registryKey.OpenSubKey("ControlPanel").OpenSubKey("DeskTop").GetValueNames()
>> >> > strWhoAmI =
>> >> > registryKey.OpenSubKey("ControlPanel").OpenSubKey("DeskTop").GetValue("Wallpaper").ToString
>> >> > registryKey.OpenSubKey("ControlPanel").OpenSubKey("DeskTop").SetValue("Wallpaper",
>> >> > "\Windows\Guava bubbles.tsk")
>> >> > strWhoAmI =
>> >> > registryKey.OpenSubKey("ControlPanel").OpenSubKey("DeskTop").GetValue("Wallpaper").ToString
>> >> > registryKey.Close()
>> >> > SendMessage(HWND_BROADCAST, WM_WININICHANGE,
>> >> > SPI_SETDESKTOPWALLPAPER,
>> >> > 0)
>> >> > Catch ex As Exception
>> >> >
>> >> > End Try
>> >> > End Sub
>> >> >
>> >> > --
>> >> > Deasun
>> >> > Home Site: www.tirnaog.com
>> >> > Check out: The Code Vault in my forums section.
>> >> >
>> >> >
>> >> > "Fabien" wrote:
>> >> >
>> >> >> Hi,
>> >> >>
>> >> >> Try to change this registry key :
>> >> >> HKEY_CURRENT_USER\ControlPanel\Home
>> >> >> with your new image path and send a Windows Message to refresh the
>> >> >> today screen.
>> >> >> In C#, you must import the SendMessage function:
>> >> >>
>> >> >> SendMessage((IntPtr)HWND_BROADCAST, WM_WININICHANGE,
>> >> >> SPI_SETDESKWALLPAPER, 0)
>> >> >>
>> >> >> the import:
>> >> >> [DllImport("coredll.dll")]
>> >> >> private static extern int SendMessage(IntPtr hWnd, uint msg, int
>> >> >> wParam, int lParam);
>> >> >>
>> >> >> BR
>> >> >>
>> >> >> Fabien Decret (Device Application Development MVP)
>> >> >> Windows Embedded Consultant
>> >> >>
>> >> >> ADENEO (ADESET)
>> >> >> http://www.adeneo.adetelgroup.com/ | http://fabdecret.blogspot.com/
>> >> >>
>> >> >>
>> >> >> On 13 juil, 16:14, Deasun wrote:
>> >> >> > Hello all,
>> >> >> >
>> >> >> > Does anyone have a example of setting the today screens image to
>> >> >> > another file?
>> >> >> > I am looking to build my first PPC app and decide to do a
>> >> >> > wallpaper
>> >> >> > changer.
>> >> >> > Wow finding documentation on this is not easy!
>> >> >> > I would like to do this in VB.net or C3.net.
>> >> >> >
>> >> >> > Could anyone give me some pointers here?
>> >> >> >
>> >> >> > Thanks
>> >> >> > --
>> >> >> > Deasun
>> >> >> > Home Site:www.tirnaog.com
>> >> >> > Check out: The Code Vault in my forums section.
>> >> >>
>> >> >>
>> >> >>
>> >>
>> >>
>> >>
>>
>>
>>
Date:Fri, 13 Jul 2007 15:44:27 -0700
Author:
|
Re: Changing the Today screen image?
I currently use the WM5 emulator in VS.net 2005.
*** Sent via Developersdex http://www.developersdex.com ***
Date:Mon, 16 Jul 2007 10:53:43 -0700
Author:
|
Change today screen wallpaper in c# on windows mobile 5
pocket pc
The code below sets the today screen wallpaper in c# on windows mobile 5. It updates the background image on the today screen and the start menu. If the image is larger than 240 * 240 it gets cropped.
(tested on .NET Compact Framework 2.0, windows mobile 5, phone edition, pocket pc device: hp ipaq hw6940 / hw6945)
using System.Runtime.InteropServices;
using Microsoft.Win32;
....
[DllImport("coredll.dll")]
private static extern int SendMessage(IntPtr hWnd, uint msg, int wParam, int lParam);
....
public const int HWND_BROADCAST = 0xffff;
public const int WM_WININICHANGE = 0x001A;
// Copy wallpaper file to windows directory
File.Copy(@"\My Documents\My Pictures\ImageFileName.jpg", @"\Windows\stwater_240_240.jpg", true);
// Update registry
Registry.SetValue(@"HKEY_CURRENT_USER\Software\Microsoft\Today", "Wall", "ImageFileName");
// Send message to refresh today screen
SendMessage((IntPtr)HWND_BROADCAST, WM_WININICHANGE, 0xF2, 0);
EggHeadCafe.com - .NET Developer Portal of Choice
http://www.eggheadcafe.com
Date:Mon, 30 Jul 2007 15:17:26 -0700
Author:
|
|
|