Event / Message sent to framework on Theme Change
-
Does anyone happen to know either the message(s) that are sent when a theme is change on the ppc or where I can research this information? I am trying to look at msdn and pocketpcdn but am not having much luck. Thanks, -Eric
-
VanHlebar wrote: WM_WININICHANGE is fired when the theme is changed ... and
wParam = 0xF2
! Regards, João Paulo -
VanHlebar wrote: WM_WININICHANGE is fired when the theme is changed ... and
wParam = 0xF2
! Regards, João PauloJoão Paulo Figueira wrote: ... and wParam = 0xF2! Regards, João Paulo That would be correct if I was making the change to the theme and wanted the os to update the screen. What I was looking for was how can my app tell that the os has just changed the today theme, maybe by another application or because the user when into settings->Today and changed it. WM_WININICHANGE is fired, but it is also fired when the users add/deletes a today module. I have yet to figure out if the message was really sent because the theme was changed or something else. The definition of the message handler that I found was OnWinIniChange(LPCTSTR lpszSection). When I have put a break point in this handler lpszSection is always empty. For my purposes it really doesn't matter but it would be nice to not do anything in the function if the user only added a today item and not changed the theme. -Eric
-
VanHlebar wrote: WM_WININICHANGE is fired when the theme is changed ... and
wParam = 0xF2
! Regards, João PauloJoão, I saw your earlier post regarding how to change a theme programatically. I have tried using it, but it doesn't seem to work on my Dell Axim X5 or X3i. Each time I goto Settings->Today and change the theme manually or when ThemeMaster changes the theme the WM_WININICHANGE message is sent and I can trap that just fine. This may work as a workaround for my purposes, but it would be nicer if I could just change the theme myself. Is there a different message that is being sent by the framework to tell the os to update the theme? I have searched MSDN and I have come up with nothing. My changes are being recorded in the registry, but the theme is not changing on the screen. Thanks, -Eric
-
VanHlebar wrote: WM_WININICHANGE is fired when the theme is changed ... and
wParam = 0xF2
! Regards, João PauloJoão Paulo Figueira wrote: VanHlebar wrote: WM_WININICHANGE is fired when the theme is changed ... and wParam = 0xF2! Regards, João Paulo I sort of got it to work. Why won't it work if there is a space path to the theme? If I have a theme that has a space in its name the code won't work, however if I change the name and remove the space then it works just fine. -Eric
-
João Paulo Figueira wrote: VanHlebar wrote: WM_WININICHANGE is fired when the theme is changed ... and wParam = 0xF2! Regards, João Paulo I sort of got it to work. Why won't it work if there is a space path to the theme? If I have a theme that has a space in its name the code won't work, however if I change the name and remove the space then it works just fine. -Eric
VanHlebar wrote: Why won't it work if there is a space path to the theme? Try enclosing the path in double quotes. Regards, João Paulo
-
VanHlebar wrote: Why won't it work if there is a space path to the theme? Try enclosing the path in double quotes. Regards, João Paulo
João Paulo Figueira wrote: VanHlebar wrote: Why won't it work if there is a space path to the theme? Try enclosing the path in double quotes. Regards, João Paulo Here is what I currently have:
TCHAR* pszFile = _T("\\Windows\\My Theme.tsk"); // The theme file
If I make the filename "MyTheme.tsk" it works just fine. If I say something like "\\Storage Card\\MyTheme.tsk" it also fails. -Eric -
João Paulo Figueira wrote: VanHlebar wrote: Why won't it work if there is a space path to the theme? Try enclosing the path in double quotes. Regards, João Paulo Here is what I currently have:
TCHAR* pszFile = _T("\\Windows\\My Theme.tsk"); // The theme file
If I make the filename "MyTheme.tsk" it works just fine. If I say something like "\\Storage Card\\MyTheme.tsk" it also fails. -EricTry this:
TCHAR* pszFile = _T("\"\\Windows\\My Theme.tsk\""); // The theme file
Regards, João Paulo
-
Try this:
TCHAR* pszFile = _T("\"\\Windows\\My Theme.tsk\""); // The theme file
Regards, João Paulo
-
Try this:
TCHAR* pszFile = _T("\"\\Windows\\My Theme.tsk\""); // The theme file
Regards, João Paulo
João Paulo Figueira wrote: Try this: TCHAR* pszFile = _T("\"\\Windows\\My Theme.tsk\""); // The theme file This works great if I am personally entering the information in as a constant into the variable. The problem is that if I read in the path from a text file I can't get it to work. In my text file I have \Windows\My Theme.tsk I have also tried put in my text file the above text of "\"\\Windows\\My Theme.tsk\"" and it still won't change the theme. How can I go about ensuring that the path is formated correctly before I put it into the registry? I have even tried running thru the path and adding the extra "\" characters and the extra '"' characters and it still did not work. Thanks for the help. -Eric
-
João Paulo Figueira wrote: Try this: TCHAR* pszFile = _T("\"\\Windows\\My Theme.tsk\""); // The theme file This works great if I am personally entering the information in as a constant into the variable. The problem is that if I read in the path from a text file I can't get it to work. In my text file I have \Windows\My Theme.tsk I have also tried put in my text file the above text of "\"\\Windows\\My Theme.tsk\"" and it still won't change the theme. How can I go about ensuring that the path is formated correctly before I put it into the registry? I have even tried running thru the path and adding the extra "\" characters and the extra '"' characters and it still did not work. Thanks for the help. -Eric
Can you please show me the code that you are using to add the quotes to the string? Regards, João Paulo
-
Can you please show me the code that you are using to add the quotes to the string? Regards, João Paulo
João Paulo Figueira wrote: Can you please show me the code that you are using to add the quotes to the string? Regards, João Paulo Ok, Again the text in my text file is Today Theme=\My Documents\My Theme.tsk. If I was going to do this without reading it in from the file I would have to format the string as such:
_T("\"\\My Documents\\My Theme.tsk\"");
Here is the code that I am using to attempt to format the string properly. I am getting the path then converting it to a CString so that I can do some other maniplutions to it. "str" has the string value of "Today Theme" and tmp has a value of "Today Theme=\My Documents\My Theme.tsk". I created the file on my desktop using Notepad so I am sure that the file is not Unicode and I wonder if that is having anything to do with this?int nCount = str.GetLength() + 1; int nLineLength = tmp.GetLength(); //Format the line read in from the file properly. tmp1[0] = '\\'; for(int i = nCount, j = 1; i < nLineLength; i++, j++) { if( tmp.GetAt(i) == '\\' ) { tmp1[j] = '\\'; j++; } tmp1[j] = tmp.GetAt(i); tmp1[j+1] = '\\'; tmp1[j+2] = NULL; }
Thanks for any insight you can provide. -Eric -
João Paulo Figueira wrote: Can you please show me the code that you are using to add the quotes to the string? Regards, João Paulo Ok, Again the text in my text file is Today Theme=\My Documents\My Theme.tsk. If I was going to do this without reading it in from the file I would have to format the string as such:
_T("\"\\My Documents\\My Theme.tsk\"");
Here is the code that I am using to attempt to format the string properly. I am getting the path then converting it to a CString so that I can do some other maniplutions to it. "str" has the string value of "Today Theme" and tmp has a value of "Today Theme=\My Documents\My Theme.tsk". I created the file on my desktop using Notepad so I am sure that the file is not Unicode and I wonder if that is having anything to do with this?int nCount = str.GetLength() + 1; int nLineLength = tmp.GetLength(); //Format the line read in from the file properly. tmp1[0] = '\\'; for(int i = nCount, j = 1; i < nLineLength; i++, j++) { if( tmp.GetAt(i) == '\\' ) { tmp1[j] = '\\'; j++; } tmp1[j] = tmp.GetAt(i); tmp1[j+1] = '\\'; tmp1[j+2] = NULL; }
Thanks for any insight you can provide. -EricVanHlebar wrote: I created the file on my desktop using Notepad so I am sure that the file is not Unicode and I wonder if that is having anything to do with this? This is where I would look first. Use the Notepad encoding option on File / Save As... and choose Unicode. Regards, João Paulo