Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Mobile Development
  3. Mobile
  4. Event / Message sent to framework on Theme Change

Event / Message sent to framework on Theme Change

Scheduled Pinned Locked Moved Mobile
question
14 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Joao Paulo Figueira

    VanHlebar wrote: WM_WININICHANGE is fired when the theme is changed ... and wParam = 0xF2! Regards, João Paulo

    V Offline
    V Offline
    VanHlebar
    wrote on last edited by
    #5

    Joã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

    1 Reply Last reply
    0
    • J Joao Paulo Figueira

      VanHlebar wrote: WM_WININICHANGE is fired when the theme is changed ... and wParam = 0xF2! Regards, João Paulo

      V Offline
      V Offline
      VanHlebar
      wrote on last edited by
      #6

      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

      J 1 Reply Last reply
      0
      • V VanHlebar

        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

        J Offline
        J Offline
        Joao Paulo Figueira
        wrote on last edited by
        #7

        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

        V 1 Reply Last reply
        0
        • J Joao Paulo Figueira

          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

          V Offline
          V Offline
          VanHlebar
          wrote on last edited by
          #8

          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

          J 1 Reply Last reply
          0
          • V VanHlebar

            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

            J Offline
            J Offline
            Joao Paulo Figueira
            wrote on last edited by
            #9

            Try this:

            TCHAR* pszFile = _T("\"\\Windows\\My Theme.tsk\""); // The theme file

            Regards, João Paulo

            V 2 Replies Last reply
            0
            • J Joao Paulo Figueira

              Try this:

              TCHAR* pszFile = _T("\"\\Windows\\My Theme.tsk\""); // The theme file

              Regards, João Paulo

              V Offline
              V Offline
              VanHlebar
              wrote on last edited by
              #10

              João Paulo Figueira wrote: Try this: TCHAR* pszFile = _T("\"\\Windows\\My Theme.tsk\""); // The theme file Regards, João Paulo Worked like a charm! Thanks, -Eric

              1 Reply Last reply
              0
              • J Joao Paulo Figueira

                Try this:

                TCHAR* pszFile = _T("\"\\Windows\\My Theme.tsk\""); // The theme file

                Regards, João Paulo

                V Offline
                V Offline
                VanHlebar
                wrote on last edited by
                #11

                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

                J 1 Reply Last reply
                0
                • V VanHlebar

                  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

                  J Offline
                  J Offline
                  Joao Paulo Figueira
                  wrote on last edited by
                  #12

                  Can you please show me the code that you are using to add the quotes to the string? Regards, João Paulo

                  V 1 Reply Last reply
                  0
                  • J Joao Paulo Figueira

                    Can you please show me the code that you are using to add the quotes to the string? Regards, João Paulo

                    V Offline
                    V Offline
                    VanHlebar
                    wrote on last edited by
                    #13

                    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

                    J 1 Reply Last reply
                    0
                    • V VanHlebar

                      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

                      J Offline
                      J Offline
                      Joao Paulo Figueira
                      wrote on last edited by
                      #14

                      VanHlebar 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

                      1 Reply Last reply
                      0
                      Reply
                      • Reply as topic
                      Log in to reply
                      • Oldest to Newest
                      • Newest to Oldest
                      • Most Votes


                      • Login

                      • Don't have an account? Register

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • World
                      • Users
                      • Groups