How to refresh the Today screen?
I did a search and couldn't find an answer to this question but it seems like it should be possible to do...
I was wondering how to cause a refresh of the Today screen using Visual Basic .NET. I suspect is would be something along the lines of using a coredll call but I just can't find anything to give me insight into this problem.
Thanks
Re: How to refresh the Today screen?
I think you can only program the today screen from unmanaged/c++ code. But im not sure what you are trying to do.
Re: How to refresh the Today screen?
I seem to have stumbled onto a solution. I did a search on coredll.dll and the today screen and found someone trying to change the background picture or theme... Anyway, he used the following code...
Code:
Imports System.Runtime.InteropServices
Module Module1
Const HWND_BROADCAST As Integer = &HFFFF
Const WM_WININICHANGE As Integer = &H1A
Sub Main()
SendMessage(HWND_BROADCAST, WM_WININICHANGE, &HF2, 0)
End Sub
<DllImport("coredll")> Private Function SendMessage(ByVal hwnd As Integer, ByVal msg01 As Integer, ByVal msg02 As Integer, ByVal msg03 As Integer) As Integer
End Function
End Module
I figured that I would code it up and play with the messages to see if I could get this to do what I wanted and to my utter surprise this does exactly what I wanted. I just wish I actually understood what it is doing. I don't even have a clue where the constants came from or why those were chosen. I haven't really been able to find anything useful doing a search either. Oh well....
Re: How to refresh the Today screen?
You are sending a message that you have updated the Win.ini.
I assume that the refresh is made by accident.
I don't know how correct it is but apparently and since i don't know how to refresh the screen myself you can use it if it works.
Re: How to refresh the Today screen?
That makes sense given the Names of the Constants. You wouldn't happen to know where a table of the message values / constants could be found do you? That would probably yield a treasure trove of possibilities.
Thanks
Re: How to refresh the Today screen?
No but that's a good question.