[HD2 Windows Mobile 6.5 Themes and Apps] dreamtide11:
another approach

Hi!

I had the very same problem.

The recommendations given here, I use too, but I remembered a small program usually used for maintaining a directory organisation with PortableApps on the PC. It just uses its own name (like 'games.exe') extracts the '.exe' out of it and opens the reaining 'games' as a directory. I found this was a brute, but very useful solution to the problem. So finally I did that app for mobile devices on my own. It is written in C#. Prerequisites are compact framework 3.5.

In my opinion its only drawback is, that it uses the file-explorer as a platform to view the directory. I would like the HTC view with icons more, but I don't know, how to call the required code to do so.

Personally I have installed 4 instances of the program (240kb) on the storage-card and created the links to them in the startmenu-folder. This works fine with directlinks.

Note: Only subfolders in /windows/startmenu/programs are opened! For other needs the source code is easily changeable.

Here comes a short description:

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

Prerequisites: Microsoft Compact Framework 3.5.

Install and usage description:

MobDir.Cab installs the file MobDir.exe into your 'prorams' directory.

Since MobDir reads in its very own name to function, it is of utmost importance to RENAME MobDir.exe to a directory name, that fits for your environment!

MobDir starts a File-Explorer directly in a directory that resides in your /windows/start menu/programs

directory.

e.g.: There is a dir called 'games' in your 'programs' directory of 'start menu', that contains all the links to your games on the device. Rename MobDir.Exe accordingly into 'games.exe'. If the program is already installed in your 'start menu/programs' directory, there is not much more to do for you. Simply select games.exe in your directlinks. There you have a directory-icon labeled 'games' then which, when clicked, opens the file-explorer in your games directory. If games.exe resides on your starage card, you have to create a games.lnk into the 'start menu/programs' directory first.

Of course, if you have more subdirectories in your 'start menu/programs' folder, which is most likely the case ('apps', 'tools' for instance), just copy the file MobDir.Exe under these names to your device. In this example as apps.exe and tools.exe. The rest is the same as written beforehand.

Sounds more complicated as it is, just try it, it's simple.

Note: The way it works can be followed by watching the source code. It first reads in its own filename (e.g.: 'games.exe'). Then it extracts the '.exe' out of the name (leaving a 'games'). Right after it looks for your current localized '/windows/start menu/programs/' path and adds the string to it, which we extracted beforehand. So we have a path 'windows/start menu/programs/games'. Finally the file-explorer is called with that path as a parameter.

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

Here is the source-code:

using System;

namespace MobDir
{
static class Program
{
[MTAThread]
static void Main()
{
string cFileNameSelf="Use this Base-Code as a sample. Written in '2010 bei D.Bos";

try
{
//read out own filename and strip out ".EXE"
cFileNameSelf = AppDomain.CurrentDomain.FriendlyName.ToUpper().Replace(".EXE", "");
//start File-Explorer, given the path to /windows/startmenu/programs/ + <NameSelf>
System.Diagnostics.Process p = System.Diagnostics.Process.Start("fexplore.exe", ReadSpecialFolder("Programs") + "\\" + cFileNameSelf + "\\");
p.WaitForExit();
}
catch (System.Exception e)
{
System.Windows.Forms.MessageBox.Show("Problem with <" + cFileNameSelf + ">!\n" + e.Message);
}
}

public static string ReadSpecialFolder(string cVarName)
{
return Environment.GetFolderPath((Environment.SpecialFolder)Enum.Parse(typeof(Environment.SpecialFolder), cVarName, true));
}
}
}

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

And finally: The file MobDir.Cab is attached to this posting.

Hopefully you can make some use of it.

Dietmar