yashsingh1/xdaforums huggingface dataset:
[Windows Mobile Development and Hacking General] meltwater:
If you still have 2.1 on, does it use the tab control file in the same way?

i.e. What is the 26948339_manila file like (can you post it?).

"Tabs Loaded" does nothing at the moment anyway, not reading the file yet. The update was to put in my current work in progress.

"Tabs available" I guess the filenames are different for sense 2.1, but can't see why we can't have a set of xml files for 2.1 as well if it works in a similar way. So far I've only created files for the ones on my system and a few which I've had before, I know there are a few missing to add.

Interesting the "set" button gives an exception, thought I'd covered that on my device (will look into it).

Cheers.
[Windows Mobile Development and Hacking General] Captain_Throwback:
Here's the Tab Control file from Manila 2.1.1920.2517. It seems to contain similar information, but it contains a LOT more . . .

NOTE: This is from the VGA ported version, but I'm sure the differences are minor (if at all) . . .
[Windows Mobile Development and Hacking General] meltwater:
I would guess that 2.1 does not have the _page.xml files, since that is what the manilafull.xml file looks like, a combination of the tab control and each of the related _page.xml files! Looks like the mode9 files don't include any of the path info beyond the HTC bit, hence why the filenames are probably different.

I'll not worry too much about it for now, interesting though.

Will upload my latest, simply because I'm calling it a night... Populated Tab(Installed) page with some data from the TabControl File - note the buttons will stay disabled (only put in for layout). Oh and the url links on the Tab(Available) aren't enabled yet either.

Update on codeplex now.
[Windows Mobile Development and Hacking General] Skrobel:
This is my WVGA control file for comparison. I haven't heared about any custom tabs for Sense 2.1 so I didn't thought you would be interested in it at alll.
[Windows Mobile Development and Hacking General] mike2nl:
@meltwater:

sorry to say that, but i have all the time when i start the version 4851 an error popup. Please see the screenshot:
[Windows Mobile Development and Hacking General] meltwater:
See if the version before that works (since the exception is referring to InitialiseTabLists() which hasn't changed). I added a function before InitialiseTabLists() in the latest, which loads up the sense tab control file (but doesn't seem like it is that). Anyway, will check that there is suitable checking of things to avoid the exception, still building the basics.

Hopefully next time should be able to have a go at matching the tabs found in the file with the ones loaded, then generate a new file.

Cheers
[Windows Mobile Development and Hacking General] mike2nl:
No stress please i can wait ;), because i skinning the RSS tab.
[Windows Mobile Development and Hacking General] brunoisa10:
Seems you are creating a "M2DC" like program (it was the TouchFlo Customiser)

great idea

about stop and restart I'm using MortScript but why not your program

about tabs : I don't understand : it is already on Settings Page

i could be very interesting if your programm will be able to change Font and Font Size (I've done the change of SMS page but it will be fantastic if possible , but changes in a manila file , I'm not sure you could do)
[Windows Mobile Development and Hacking General] brunoisa10:
about enabling / disabling it is just to change Enabled from 0 to 1 and 1 to 0 in Today Items for HTC Sense in the registry and then RedrawToday

OK I understand your software will add new tabs : great idea :)

about Fonts it is in mode9 files (see here http://xdaforums.com/showthread.php?t=688002 )

I can give you an exe for Soft Reset I have no c# code

I am ok to be beta tester if needed (on a Diamond 2 Manila version 2.5.19192828.0)
[Windows Mobile Development and Hacking General] meltwater:
So same thing then just in c# directly. I still have problems on mine, it's not enough to restart sense in my case, I still have to soft-reset. Perhaps its a Touch HD specific thing...I will see if the CHTEditor does the same (similar code) if not then will ask what is different.

Obviously if there is something out there which does the same thing then there is no point duplicating it. Hopefully though, doing it this way, it should be useful for any new tabs too.

Fonts would be nice, but I don't know enough to edit mode9 files directly on the device, would be a lot to program if it could be done. But I am open to adding other options, ie. language switching, themes etc. if people specify how they work or are happy to code it.

exe, will be better than nothing, should be able to invoke that from the software. I think I may have found some code, so will put that in for testing.

The more testers the better, since it is a tool to help fix problems it is important it does the job! Hopefully it isn't too far off doing some useful work (once it generates a usable tab control file it starts to have a use, even if it is not configurable to start with!).
[Windows Mobile Development and Hacking General] Skrobel:
Well I don't know how to trigger a device reset using C# but I noticed that many of the developers use external reset app. I also did the same when I developed my actionscreen. Then you can call it using shell. This is some idea until you discover how to do it via runtime.
[Windows Mobile Development and Hacking General] brunoisa10:
about the restart , i've noticed with a dev that you need to run twice the code for redrawToday and it works on c# , it is specified on Microsoft site (MSDN) they don't know why but it is like that

so if you call twice the function for redrawtoday , no need to soft reset
[Windows Mobile Development and Hacking General] meltwater:
Yep seems to work now! Cheers. :D

The soft-reset works fine too, added the snippet below for anyone else who might want it (from http://www.codeproject.com/KB/smart/restartwidnowsmobile.aspx):

[DllImport("coredll.dll")]

public static extern int KernelIoControl(int dwIoControlCode, IntPtr lpInBuf, int nInBufSize, IntPtr lpOutBuf, int nOutBufSize,ref int lpBytesReturned);

private int CTL_CODE(int DeviceType, int Func, int Method, int Access)

{

return (DeviceType << 16) | (Access << 14) | (Func << 2) | Method;

}
private int ResetPocketPC()

{
const int FILE_DEVICE_HAL = 0x101;

const int METHOD_BUFFERED = 0;

const int FILE_ANY_ACCESS = 0;

int bytesReturned = 0;

int IOCTL_HAL_REBOOT;

IOCTL_HAL_REBOOT = CTL_CODE(FILE_DEVICE_HAL, 15, METHOD_BUFFERED, FILE_ANY_ACCESS);

return KernelIoControl(IOCTL_HAL_REBOOT, IntPtr.Zero, 0, IntPtr.Zero, 0, ref bytesReturned);

}
[Windows Mobile Development and Hacking General] brunoisa10:
yes good :)

cool about coredll , I just want to send you to see how to play with , happy to see it is OK now

I don't have any PPC programming knowledge but I'm very curious and i've helped dev on WM to find the way to have good programs

i wonder if you are able to make just a restart-Service for me (totally different thing) about taskservice.dll
[Windows Mobile Development and Hacking General] meltwater:
Can't say I understand how it works, but it seems to...

You have as much chance as me with finding that, most my code ends up being put together with the help of google search. I would like to know about controlling tasks etc though since there is a good opportunity to make a nice task switcher tab...just need a lot more spare time! With time and effort most things can be achieved, how much time and effort is always the problem :D
[Windows Mobile Development and Hacking General] meltwater:
Getting very close now, although trying to work out how to convert the completed file into UTF-16 as required for sense. Looking for some code to achieve this...
[Windows Mobile Development and Hacking General] brunoisa10:
have you looked for how to mod a mod9 file ?
[Windows Mobile Development and Hacking General] RoryB:
What are using to write the xml file?

From the page you linked earlier in this thread:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml;

namespace cpap1
{
class Program
{
static int Main(string[] args)
{
XmlDocument docXML = new XmlDocument();
docXML.LoadXml("[COLOR=#ff0000]<?xml version=\"1.0\" encoding=\"utf-16\"?>[/COLOR]");
return 0;
}
}
}

I cannot find where you are writing the new xml file, but I do not know code that well.

Found this too

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml;

namespace cpap1
{
class Program
{
static int Main(string[] args)
{
XmlDocument docXML = new XmlDocument();
docXML.LoadXml("<?xml version=\"1.0\" encoding=\"utf-16\"?>"[COLOR=#ff0000] +[/COLOR]
[COLOR=#ff0000] "<Employees><Employee>" +[/COLOR]
[COLOR=#ff0000] "<EmplNumber>48-705</EmplNumber>" +[/COLOR]
[COLOR=#ff0000] "<firstName>John</firstName>" +[/COLOR]
[COLOR=#ff0000] "<lastName>Cranston</lastName>" +[/COLOR]
[COLOR=#ff0000] "<HourlySalary>16.48</HourlySalary>" +[/COLOR]
[COLOR=#ff0000] "</Employee><Employee>" +[/COLOR]
[COLOR=#ff0000] "<EmplNumber>22-688</EmplNumber>" +[/COLOR]
[COLOR=#ff0000] "<firstName>Annie</firstName>" +[/COLOR]
[COLOR=#ff0000] "<lastName>Loskar</lastName>" +[/COLOR]
[COLOR=#ff0000] "<HourlySalary>12.50</HourlySalary>" +[/COLOR]
[COLOR=#ff0000] "</Employee><Employee>" +[/COLOR]
[COLOR=#ff0000] "<EmplNumber>85-246</EmplNumber>" +[/COLOR]
[COLOR=#ff0000] "<firstName>Bernie</firstName>" +[/COLOR]
[COLOR=#ff0000] "<lastName>Christo</lastName>" +[/COLOR]
[COLOR=#ff0000] "<HourlySalary>22.52</HourlySalary>" +[/COLOR]
[COLOR=#ff0000] "</Employee><Employee></Employees>");[/COLOR]
[COLOR=#ff0000] docXML.Save("Employees.xml"[/COLOR]);
return 0;
}
}
}

Changed both to be UTF-16 instead of UTF-8
[Windows Mobile Development and Hacking General] meltwater:
Nope, I'm not even sure it is possible, I've not seen any mode9 edit code for compact .net. At the moment, not planning on working on that though, probably a huge task.

I'm not sure if the xml generator takes notice of the encoding bit there or not, but it is written as part of the file instead (the proper sense file does not include it). I'll try it with that and see if it changes the underlying encoding or not (I can remove the declaration afterwards). Currently working on using the byte encoding convert methods, so one way or another should have a solution soon.

private static void ConvertUFT8ToUTF16(string sourcefilename, string targetfilename)
{
using (StreamWriter output = new StreamWriter(targetfilename, false, Encoding.Unicode))
{
using (StreamReader input = new StreamReader(sourcefilename))
{
while (input.EndOfStream == false)
{
string utf8string = input.ReadLine();
output.WriteLine(utf8string);
}
output.Flush();
output.Close();
}
}
}

Ok, that is sorted! Now just to change the line endings from windows (CRLF) to Unix (LF) if I need to.

Right, tested and it appears to work without the line endings changed (although I might change them at a later date) but first will update what I have done (stopping for the night anyway!).

Updated Release:

Work in progress (finishing for the night)

----------------

- Added 1st go at generating Tab Control File, creates test.xml which can be used to replace 26948339_manila

Currently the text.xml file, looks at the tabs in the 26948339_manila and re-generates the same file from the xml data files (currently ignores any which aren't found, so they will be missing).

Plan is now, to allow the generation to pull tab info from the original 26948339_manila file too, then allow the user to do the following:

1. Define if the new file tabs are generated from the original tab file OR from the available tab files (will lock any which aren't available yet, plus might lock any CORELOCKED ones to take from the original 26948339_manila file - Settings/Home)

2. Change the order of the tabs (useful if you reset sense a lot!) - again will lock any CORELOCKED ones

3. Remove tabs - again will lock any CORELOCKED ones

4. Insert tabs from the available tabs list (if present on the device, & perhaps if not present too - with a warning)

5. Check the 26948339_manila tabs to see if they are present on the device

With that done, it is basically there! :D
[Windows Mobile Development and Hacking General] mike2nl:
@meltwater:

i have tested version 3 so far as i can... plesase see the screenshot. This happens after i start the app.
[Windows Mobile Development and Hacking General] meltwater:
My first guess would be you do not have the resources folder copied over.

I will ensure that it doesn't have an exception just for that reason though.
[Windows Mobile Development and Hacking General] meltwater:
New Release!

Work in progress

----------------

- Generate Tab Control File, creates test.xml which can be used to replace 26948339_manila

- Move & Remove Tabs [^]up [v]down [-]remove

- Select tab data source [#]Toggle between "Default" (Original Tab Control File) and "File" (Xml File) if available.

- Opens file using NotepadPPC.exe

Getting quite close now I think, need to add option to add tabs:

i.e. On the available tabs page:

- Add all tabs on device (will insert any tabs which are present on the device but not in the tab control file)

- Add selected tab (add selected tab - with prompt if not detected as present on the device)

[Probably make these options from the command line too...for use with cabs perhaps - Would that be usable by a cab?]

Also need to add some buttons to backup and replace the tab control file!
[Windows Mobile Development and Hacking General] Captain_Throwback:
If the CAB includes a setup.dll, I believe the command line function of your SenseUtil should be callable. Of course, I don't know how to create a setup.dll, so someone else will have to do it :rolleyes:.

EDIT: I've tried to create them based on info I found online, but I'm never able to get it to work right :(
[Windows Mobile Development and Hacking General] meltwater:
I'll give the following link a try at some point and see if I can make one which calls my app. If I can get it to work will drop the source in the project so it is easy to mod.

http://www.mobilepractices.com/2008/10/setupdll-sample-and-walkthrough-terms.html

Is the target location of the files set by the cab?

i.e. can you force some files to be located in the device windows dir regardless of the install to device/storage card options.

Would the cab be able to handle a different reg file, dependent on the above choice, or should I try to put that in the dll too?

i.e. Can set the correct exe path in the registry for my programs which uses the keys.
[Windows Mobile Development and Hacking General] RoryB:
I have used wincecabmanager and you can set hard install directory or %install directory% so some things can be forced to only install in folder of your choice and others can be device or storage path.
[Windows Mobile Development and Hacking General] Captain_Throwback:
Yes. In fact, that's how I install your RSS Tab, currently (you can select the "Storage Card" option, but the Manila files will always copy to the "Windows" folder of the device).

This can be done dynamically in the CAB. Using the example of my RSS Tab CAB:

Default Install Folder is set to %CE1%\RSSUtil (%CE1% = "Program Files") - Using the "%" allows for localization, for non-WWE systems.

The Registry values "RSSFeed.LaunchApp0" & "RSSFeed.RSSUtilExe" are set to ="%InstallDir%\RSSUtil.exe". When installing the CAB, based on the location that is selected (Device/Storage Card), that entry is updated during install to reflect the correct path (either \Program Files\RSSUtil or \Storage Card\Program Files\RSSUtil).

That wouldn't need to be put into the DLL.

The only issue I currently have in creating CAB install files to add Manila tabs is the updating of the Tab Control file, and preserving the existing tab order if previously configured (since part of the process involves deleting the Configuration key). I suppose there are two possible solutions to that - create a Tab Control file based on the order in the Configuration key prior to deleting it (and then add the new tab to the end), or update the Configuration key to add the new tab as part of the process when updating the Tab Control file. Or, I guess we could just ignore that altogether and make the user re-order the tabs, since likely they won't want the new tab at the end anyway (maybe it should be inserted before the "Settings" tab? Most people leave that at the end, right?).
[Windows Mobile Development and Hacking General] meltwater:
In fact I hadn't thought about the configuration keys (except to delete them), I reset so often I never have any!

Was just thinking I could read in the order of the keys and order the file to that.

However, there comes a problem of what to do with disabled tabs...so might as well generate the registry keys (I have all the info to do it). I can even read in the current order from the keys and use that for the initial order in the list (so it'll set the default order on reset).
[Windows Mobile Development and Hacking General] illi:
meltwater - I tested this util since the last 3 versions and all have the display over-lap. Please see attached screen capture.

Thanks
[Windows Mobile Development and Hacking General] meltwater:
That's an interesting fault....how did you manage that?

Not sure how it would happen since as you can tell, it is all standard .net controls at the moment, those buttons are attached the tab control so should behave as normal.

I'm guessing you are using some version of compact .net which MS has "bug" fixed, and added in new problems (like how they messed up the WebBrowse control). Not sure how I can fix that though.
[Windows Mobile Development and Hacking General] illi:
Being a rookie cook, I am uncertain. However, my NETCF is 3.5.9198.00.
[Windows Mobile Development and Hacking General] meltwater:
cgacutil.exe reports 3.5.9198.0 and 2.0.7045.0 for me.

Perhaps it is my target platform (Currently: Windows Mobile 6 Professional SDK), really worries me how much variation MS introduce even when the versions are the same.

Will see what I can find to solve it, anyone else heard or seen this before? At least the GUI is rubbish, so eventually it can be re-done! :)

Update: Almost there with the next update, enables adding of tabs from the available tab list.

I've not done anything with the configuration keys, but that is something which can easily be added later on, other than that I think it is basically functional.

Notes:

- Each time you Update the tab control file in the Control Sense tab (it's only enabled when you have a generated file ready) it'll create a dated backup of the original tab control file (26948339_manila) located in the SenseUtil folder.

- The [+All] button will automatically add any tabs which are present on the device but not currently installed in the tab control file.

- If you remove a tab from the Tabs (Loaded) list, and then re-add it via the Tabs (Available) list, you will not be able to set the Source back to DEFAULT (i.e. generate the tab from the tab control file).
[Windows Mobile Development and Hacking General] meltwater:
Ok, a lot of new code for this one, so enjoy.

Need people to:

- test this

- provide xml files for any other tabs (or information for them)

- report any problems

- ideas for GUI/graphics

Beta Version - Should be usable

----------------

- Added [+] and [+All]

The [+All] button will automatically add any tabs which are present on the device but not currently installed in the tab control file.

The [+] will add any tab which is not installed, but will prompt if not detected as present on the device (the key mode9 file missing).

- Advanced Mode

Allows all the data in the list views to be seen

- Reload Data

Resets all the list views and reloads from the files

- Url links enabled

- Update Tab Control File

Each time you Update the tab control file in the Control Sense tab (it's only enabled when you have a generated file ready) it'll create a dated backup of the original tab control file (26948339_manila) located in the SenseUtil folder.

Still to do:

CommandLine options for cabs/shortcuts etc.

Configuration Key support (will do much later)

Also, what command line options do we need to support?

1. Insert a specified tab at the default location (last before settings page) i.e. SenseUtil.exe -add 6B54437C_manila

2. Renew - rebuilds the tab control file with tab data from the supported xml files (copies over any which aren't included) for each tab currently in the file only. i.e. SenseUtil.exe -renew

3. Addall??? - Just like the Add All button, adds any tabs which it detects are present on the device but not installed (should be used with caution since tabs which aren't correctly installed will mess up sense).

4. Addallnew - Combo of 2 and 3!

[EDIT]

5. Remove specified tab i.e SenseUtil.exe -remove 6B54437C_manila (to allow uninstall)

I've since added the ManilaTVPlayer tab file: 129DE958_manila.xml

[UPDATE] The above command-line options are almost complete - They will perform the actions and then prompt a AutoRun message which if accepted will update and reset manila, if rejected the changes can be checked (or you can reload the data from the settings page).

Should be updating tonight, then the app will need some serious testing since there are so many variations and combinations to deal with.
[Windows Mobile Development and Hacking General] meltwater:
Ok, got it updated with commandline support so should be enough to be tested and hopefully will be usable in cabs :D

Beta - with CommandLine support

------------------------------

Added the following commandline options:

SenseUtil add 6B54437C_manila

- Adds the specified tab, leave other tabs as they are

SenseUtil renew

- Replaces all tab details with data from the xml files (leaves any not found in the xml files as they are)

SenseUtil addall

- Adds any tabs which are not in the tab control file but found on the device (checking for the key mode9 file), the other tabs are left as they are. New tabs are added at end before settings tab.

SenseUtil addallnew

- As above, but other tabs are replaced with details from the xml files

SenseUtil remove 6B54437C_manila

- Removes the tab if installed on the device

------------------

Need details of any tabs which are not currently defined in xmls, please.

============================

Right, for now I think I'll finish tinkering with this app, I think it has enough function to perform it's intended purpose. It works for me, although sense is still difficult to get into a stable state afterwards - but that is my setup rather than anything else.

The only two area's which I feel needs improvement upon later on is the GUI, and also to add support for ordering the tabs using the configuration keys.

For now until I get some feedback from testing I'll leave the prompts in from the commandline option before any changes are made (so that devs can test), we can then decide if we want to keep them or remove them or make them optional etc.

If there is something which you would like the app to do but it doesn't yet, then let me know. Interested to hear from cooks, could the app be useful on first run of a flash so that the tab control file does not need to be pre-configured?

Any chance someone could package this app in a cab for use please? Thank you!
[Windows Mobile Development and Hacking General] mike2nl:
More ate the weekend, so as i have written in the PM to you....
[Windows Mobile Development and Hacking General] Phhere:
For me the tool doesn't create a new TabControl_manila.xml file. i can't see it in the browser or on the file system. :(
[Windows Mobile Development and Hacking General] meltwater:
It'll back up and replace your 26948339_manila file, which is the Tab Control file.