[Original] custom default themes during Rom Customization

Source: Internet
Author: User
As we all know, tsk is the theme installation package for Windows Mobile. You can use wince manager to check the tsk file. You will find that the tsk file is mainly composed of two parts. Like a cab file, it includes necessary file and registry key records, which are generally JPG images or GIF images, these images are the background images on WM's desktop today and the menu that starts to pop up. These registry items are mainly used to set the system color and record the topic files currently used by the system. When you put the tsk file in the Windows directory or my documents and other directories, you can open the settings ==> the theme file in today's directory will be displayed, this is because the WM system will automatically search for tsk files and place them here. You can install the tsk file by programming,CodeAs follows:

1 Void Settheme ()
2 {
3 Hkey;
4 Long LRET;
5 Tchar szcmdline [max_path + 1 ];
6 Tchar * Pszfile = _ T ( " Mytheme. Tsk " ); // The theme File
7
8 LRET = Regopenkeyex (HKEY_CURRENT_USER, _ T ( " Software \ Microsoft \ today " ), 0 , 0 , & Hkey );
9
10   If (Error_success = LRET)
11 {
12 Regdeletevalue (hkey, _ T ( " Usestartimage " ));
13
14 Wcscpy (szcmdline, _ T ( " /Safe/noui/nouninstall/delete 0 " ));
15 Wcscat (szcmdline, pszfile );
16
17 Process_information PI;
18
19 If (CreateProcess (_ T ( " \ Windows \ wceload.exe " ), Szcmdline, null, null, false, 0 , Null, & Pi ))
20 {
21 Waitforsingleobject (PI. hprocess, infinite );
23 Closehandle (PI. hprocess );
25 Regsetvalueex (hkey, _ T ( " Skin " ), 0 , REG_SZ, (byte * ) Pszfile, Sizeof (Tchar) * (Wcslen (pszfile) +   1 ) ;
27 Regclosekey (hkey );
31 : Sendmessage (hwnd_broadcast, wm_wininichange, 0xf2 , 0 );
32 }
34 }
35 }
36 Haha, it seems that the question is a bit running. In fact, tsk files mainly rewrite the registry for the system and add two image files. However, during Rom customization, you cannot modify the default topic by simply writing the registry and adding image files. Even if you add such registry items during Rom customization, it is useless, because the system will rewrite your registry key during compilation. This rewrite action is controlled by an XML file. You can check wm61themeconfig_96.xml, you will find that this is the control file used by WM to set the default theme, which records the default tsk file name, the color of the system upper and lower columns, and the system color settings such as shcolor and syscolor. Therefore, this file cannot be included in the bin. You still need to find base_dpi_96.cab.pkg and delete it. In fact, before deleting wm61themeconfig_96.xml, the system will still generate a wm61themeconfig_96.xml file, which is automatically generated by the supervisor, these files are all represented by hexadecimal characters. They mainly record system icons, system icons, and other information, therefore, to thoroughly customize the default topic, you must also kill base_dpi_96.cab.pkg in BSP. In addition, you need to decompress and compile the image in the tsk file, export the registry key of the tsk file, and add it to platform. Reg. This is OK. Although this method is work, there is a lot of violence among them, and there is no better way to do this before. There are also some suggestions on the Internet that by modifying wm61themeconfig_96.xml, the method should be theoretically acceptable. It is not so violent, but it is not clear whether to work without trying it. If you do, you can leave a message.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.