Hello,
I made my own ppc theme and when I'm using InClose mobile with "Background -> The current Theme" checked, it looks like in the attached picture.
vista.inf:
Code:
[Version]
Signature = "$Windows NT$"
CESignature = "$Windows CE$"
Provider = "Jimmy"
[CEStrings]
Appname = "Vista"
InstallDir = %CE2%
[SourceDisksNames]
1 = ,"vista",,vista
[SourceDisksFiles]
stwater_240_320.gif = 1
stwater_320_240.gif = 1
tdywater_240_320.gif = 1
tdywater_320_240.gif = 1
[DefaultInstall]
CopyFiles = CopyDir01
AddReg = Registry
[CopyDir01] ; (%CE2% : \Windows)
"stwater_240_320.gif",stwater_240_320.gif,0x00000400
"stwater_320_240.gif",stwater_320_240.gif,0x00000400
"tdywater_240_320.gif",tdywater_240_320.gif,0x00000400
"tdywater_320_240.gif",tdywater_320_240.gif,0x00000400
[DestinationDirs]
CopyDir01 = 0, %InstallDir%
[Strings]
reg_path00 = Software\Microsoft\Color
reg_path01 = Software\Microsoft\Today\Vista.tsk
[Registry]
HKLM,%reg_path00%,4,0x00000001,FF,FF,FF,00
HKLM,%reg_path00%,6,0x00000001,00,00,00,00
HKLM,%reg_path00%,7,0x00000001,00,00,00,00
HKLM,%reg_path00%,11,0x00000001,00,00,00,00
HKLM,%reg_path00%,12,0x00000001,00,00,00,00
HKLM,%reg_path00%,13,0x00000001,C0,C0,C0,00
HKLM,%reg_path00%,14,0x00000001,FF,FF,FF,00
HKLM,%reg_path00%,15,0x00000001,FF,FF,FF,00
HKLM,%reg_path00%,16,0x00000001,6C,AB,B0,00
HKLM,%reg_path00%,25,0x00000001,C0,C0,C0,00
HKLM,%reg_path00%,26,0x00000001,FF,FF,FF,00
HKLM,%reg_path00%,27,0x00000001,00,00,00,00
HKLM,%reg_path00%,28,0x00000001,FF,00,00,00
HKLM,%reg_path00%,36,0x00000001,FF,FF,FF,00
HKLM,%reg_path00%,37,0x00000001,6C,AB,B0,00
HKLM,%reg_path00%,38,0x00000001,00,00,00,00
HKLM,%reg_path00%,39,0x00000001,FF,FF,FF,00
HKLM,%reg_path00%,40,0x00000001,FF,00,00,00
HKLM,%reg_path00%,5,0x00000001,00,00,00,00
HKCU,%reg_path01%,Color_NavBarText_Highlight,0x00000001,FF,FF,FF,00
HKCU,%reg_path01%,Color_SoftkeyFlatCenter,0x00000001,00,00,00,00
HKCU,%reg_path01%,Color_TitleFlatCenter,0x00000001,00,00,00,00
HKCU,%reg_path01%,Color_TitleFlatDoneBtn,0x00000001,E5,49,30,00
HKCU,%reg_path01%,Color_TitleFlatDoneBtn_Highlight,0x00000001,9D,47,32,00
HKCU,%reg_path01%,Color_Highlight,0x00000001,B6,D5,E9,00
HKCU,%reg_path01%,Color_HighlightText,0x00000001,00,00,00,00
HKCU,%reg_path01%,Color_MenuText,0x00000001,00,00,00,00
HKCU,%reg_path01%,Color_CommandBarText_Highlight,0x00000001,00,00,00,00
Can anyone tell me, what's wrong? Thanks very much and sorry for my bad english...
I think its because you have created a orientation theme - inclose looks for tdywater.gif and as yours are named tdywater_240_320.gif & tdywater_320_240.gif it uses default windows one. Change your theme to a standard format and it will work.
btw with what software did you make the theme? And nice looking theme
I have it and maybe
Jimm98y.. i use inclose too and if im not mistaken you want that blue part to be taking off inclose correct.. well if you do you need to go to the inclose settings and in background just click none it will be white, but i dont know why when you click current theme its allways blue, as for user image its tuff to do that.. Hope that helps
Josh
I think its because you have created a orientation theme - inclose looks for tdywater.gif and as yours are named tdywater_240_320.gif & tdywater_320_240.gif it uses default windows one. Change your theme to a standard format and it will work.
Click to expand...
Click to collapse
OK. I'm going to try it but I hoped there is some registry key which can change it.
with what software did you make the theme? And nice looking theme
Click to expand...
Click to collapse
Thanks. I made it with notepad, paintbrush and cabwiz.exe, because the other programs (like themegence) looks too complicated and cannot offer such possibilities.
go to the inclose settings and in background just click none it will be white
Click to expand...
Click to collapse
Yes, I know about it, but I would like to have a "transparent menu". I tried to use my own picture in background, but it doesn't work in landscape because there cannot be set 2 pictures.
Thanks very much now it works fine. Here is the final version of this skin for anyone who is interested in:
How did you do it
Jimm98y.. How did you get to be transperant.. i tried reading the other messages but i cant get it.. coul d you help?
Re: How did you do it
Juicy J said:
Jimm98y.. How did you get to be transperant.. i tried reading the other messages but i cant get it.. coul d you help?
Click to expand...
Click to collapse
I used background files named tdywater.gif and stwater.gif, both in resolution 320x320, so the inf file looks like this:
Code:
[Version]
Signature = "$Windows NT$"
CESignature = "$Windows CE$"
Provider = "Jimmy"
[CEStrings]
Appname = "Vista"
InstallDir = %CE2%
[SourceDisksNames]
1 = ,"vista",,vista
[SourceDisksFiles]
stwater.gif = 1
tdywater.gif = 1
[DefaultInstall]
CopyFiles = CopyDir01
AddReg = Registry
[CopyDir01] ; (%CE2% : \Windows)
"stwater.gif",stwater.gif,0x00000400
"tdywater.gif",tdywater.gif,0x00000400
[DestinationDirs]
CopyDir01 = 0, %InstallDir%
[Strings]
reg_path00 = Software\Microsoft\Color
reg_path01 = Software\Microsoft\Today\Vista.tsk
[Registry]
HKLM,%reg_path00%,4,0x00000001,FF,FF,FF,00
HKLM,%reg_path00%,6,0x00000001,00,00,00,00
HKLM,%reg_path00%,7,0x00000001,00,00,00,00
HKLM,%reg_path00%,11,0x00000001,00,00,00,00
HKLM,%reg_path00%,12,0x00000001,00,00,00,00
HKLM,%reg_path00%,13,0x00000001,C0,C0,C0,00
HKLM,%reg_path00%,14,0x00000001,FF,FF,FF,00
HKLM,%reg_path00%,15,0x00000001,FF,FF,FF,00
HKLM,%reg_path00%,16,0x00000001,6C,AB,B0,00
HKLM,%reg_path00%,25,0x00000001,C0,C0,C0,00
HKLM,%reg_path00%,26,0x00000001,FF,FF,FF,00
HKLM,%reg_path00%,27,0x00000001,00,00,00,00
HKLM,%reg_path00%,28,0x00000001,FF,00,00,00
HKLM,%reg_path00%,36,0x00000001,FF,FF,FF,00
HKLM,%reg_path00%,37,0x00000001,6C,AB,B0,00
HKLM,%reg_path00%,38,0x00000001,00,00,00,00
HKLM,%reg_path00%,39,0x00000001,FF,FF,FF,00
HKLM,%reg_path00%,40,0x00000001,FF,00,00,00
HKLM,%reg_path00%,5,0x00000001,00,00,00,00
HKCU,%reg_path01%,Color_NavBarText_Highlight,0x00000001,FF,FF,FF,00
HKCU,%reg_path01%,Color_SoftkeyFlatCenter,0x00000001,00,00,00,00
HKCU,%reg_path01%,Color_TitleFlatCenter,0x00000001,00,00,00,00
HKCU,%reg_path01%,Color_TitleFlatDoneBtn,0x00000001,E5,49,30,00
HKCU,%reg_path01%,Color_TitleFlatDoneBtn_Highlight,0x00000001,9D,47,32,00
HKCU,%reg_path01%,Color_Highlight,0x00000001,B6,D5,E9,00
HKCU,%reg_path01%,Color_HighlightText,0x00000001,00,00,00,00
HKCU,%reg_path01%,Color_MenuText,0x00000001,00,00,00,00
HKCU,%reg_path01%,Color_CommandBarText_Highlight,0x00000001,00,00,00,00
Related
yesterday,my C500 upgrade to WM2005,i make a Chinese Fonts pakage,only packs .ttf file can be writer in ram,but add registry value Latter,install cab file show:Installation was unsuccessful.Theprogram or setting cannot be installed because it does not have sufficient system permissions.
cab inf file:
Code:
[Version]
Signature = "$Windows NT$"
Provider = "Microsoft"
CESignature = "$Windows CE$"
[CEStrings]
CompanyName="Cloud-Castle Studio."
AppName="WM2005 Chs Fonts Installer"
InstallDir=%CE2%\Fonts
[DefaultInstall]
AddReg = RegSettings.All
CopyFiles = CopyToInstallDir.All
[SourceDisksNames]
1 = ,"ttf",,D:\smartphone\fonts
[SourceDisksFiles]
nina.ttf = 1
ninab.ttf = 1
MSSONG.TTF = 1
[DestinationDirs]
CopyToInstallDir.All=0,%InstallDir%
[CopyToInstallDir.All]
nina.ttf,,,0
ninab.ttf,,,0
MSSONG.TTF,,,0
[RegSettings.All]
HKLM,Software\Microsoft\FontLink\SystemLink,nina,0x00000000,"\Windows\Fonts\mssong.ttf,SC_Song"
HKLM,Software\Microsoft\FontPath,FontPath,0x00000000,"\Windows\Fonts"
help me,thanks![/b]
in HKLM\Security\Policies\Policies add DWORD key,"0000101b"=1
all ok!
Hi All,
Is anyone familiar with the EDB notification mechanism? I have some code that has opened the appointments database to get change notifications, all well and good. The trouble is I am unable to delete the CENOTIFICATION structure, meaning I get a memory leak after every change.
if anyone has seen this or knows the solution, I'd be grateful.
Code:
CEOID apps_oid;
request= new CENOTIFYREQUEST; // or (CENOTIFYREQUEST *) LocalAlloc (LPTR,
// sizeof (CENOTIFYREQUEST));
if (request) {
request->dwSize = sizeof (CENOTIFYREQUEST);
request->hwnd = hwnd;
request->hHeap = NULL;
request->dwFlags = CEDB_EXNOTIFICATION;
request->dwParam = param;
database = CeOpenDatabaseInSession ( NULL,
&pim_guid,
&apps_oid,
L"Appointments Database",
0,
0, // or CEDB_AUTOINCREMENT,
request);
}
. . .
case WM_DBNOTIFICATION:
{
CENOTIFICATION * notification = (CENOTIFICATION *)lParam;
// Always returns FALSE
BOOL hr = CeFreeNotification(request, notification);
// Always returns 5 - access denied
DWORD dw = GetLastError();
}
break;
Hi all, sorry I am not normally one for starting a new thread for help or a question but I have a problem which a dont even understand let alone begin to fix, and googlin for aover an hour turns up nothing
Initially I needed to do some screen grabs and so I proceeded to install DotPocket to try out its screen capture functions. The software installed over activesync, popped up on the phone screen as normal, asked for location, installed CAB fine. Then it asked me to pick a resolution and then soft reset which I did. since then the touch screen has been completely unresponsive, it does not register a press at all! I am able to (just!) use the phone using the optical trackpad and select button, which is how I have since managed to uninstall dotpocket and play with the settings. This however did nothing, and I am still left with a 90's phone with a large screen any help would be much appreciated, I am currently trawling through the registry to try and find a related entry.
Another wierd thing - since this has happened when I go to Settings->System->Screen and press the "Align Screen" button to repeat the screen tap alignment procedure, nothing happens. I have clicked this button til I am blue in the face
Things I have tried - Align Screen, Advanced Config+ > Pressure sensitivity options, numerous soft resets.
As I am sure you can understand this is quite perplexing and without doing a hard reset (which is a last reort) I cant think what else to do! Thanks in advance
if you soft reset the phone.
does this bring back the functionalities of the touch screen?
I had this in the biginning that i could not use my screen anymore.
but i could use my keys.
i am not 100% sure, but some how i suspect it to be an app that locks the screen.
i thought it might be the windows lock (see end key button)
but i could net get it to respond.
aftert hard reset it worked again, but it did not take long before it got locked again.
i now have a other rom without panels and have not had this issue anymore.
either post up the cab you installed or have a look at it yourself in msceinf that will give you some clues as to what it installed.
What was the option with resolution you took??
OH and I've just had a look at the prog and it's designed for 2003! that's like complaining that os/2 messes up vista..
I think you may be stuck with a hard reset, and a lesson to not do it again...
In future MyMobiler, it's not fast but you can do screengrabs through activesynce/wdm
It might help you out here as you can control the X1 from your desktop.
I've had a look at the cab and there's a gapi.dll thats unlikely to have been removed, amongst other things..
So this is the readout of what it's done.
Code:
Strings Value Equivalent
001 %CE1%\Aurorisoft\dotPocket \Program Files\Aurorisoft\dotPocket
002 %CE2% \Windows
003 Help Help
004 %CE11% \Windows\Start Menu\Programs
005 %CE4% \Windows\StartUp
006 dotPocket.lnk dotPocket.lnk
007 dpTCPGateway.lnk dpTCPGateway.lnk
*****************************************************************************************************************************************************************
Directories String ID Value
004 1\3 \Program Files\Aurorisoft\dotPocket\Help
007 2\3 \Windows\Help
002 1 \Program Files\Aurorisoft\dotPocket
003 2 \Windows
005 4 \Windows\Start Menu\Programs
006 5 \Windows\StartUp
*****************************************************************************************************************************************************************
Files Order Number Flags ID Dir FileName in CAB FileName
001 001 0x40000003 \Program Files\Aurorisoft\dotPocket DPMANA~1.001 "dpManager.exe"
002 005 0x40000003 \Program Files\Aurorisoft\dotPocket DPTCPG~1.002 "dpTCPGateway.exe"
003 006 0x40000003 \Program Files\Aurorisoft\dotPocket DPDISP~1.003 "dpDisplayIp.exe"
004 002 0x40000003 \Windows DPDRIV~1.004 "dpDrivers.dll"
005 003 0x40000003 \Windows DPSERV~1.005 "dpService.dll"
006 004 0x40000003 \Windows DPRAPI~1.006 "dpRAPIGateway.dll"
007 007 0x00000012 \Windows 000000GX.007 GX.DLL
008 008 0x40000003 \Windows 0000gapi.008 gapi.dll
009 010 0x40000003 \Program Files\Aurorisoft\dotPocket\Help TROUBL~1.009 "Troubleshooting.htm"
010 011 0x40000003 \Program Files\Aurorisoft\dotPocket\Help SCREEN~1.010 "ScreenNav.htm"
011 012 0x40000003 \Program Files\Aurorisoft\dotPocket\Help DOTPOC~1.011 "dotPocket.htm"
012 013 0x40000003 \Program Files\Aurorisoft\dotPocket\Help DEVICE~1.012 "DeviceManager.htm"
013 014 0x40000003 \Windows DEVICE~3.013 "device_manager_buttons1.2bp"
014 015 0x40000003 \Windows DEVICE~4.014 "device_manager_register1.2bp"
015 016 0x40000003 \Windows DEVICE~1.015 "device_manager1.2bp"
016 017 0x40000003 \Windows DEVICE~2.016 "device_manager2.2bp"
017 018 0x40000003 \Windows SCREEN~1.017 "screen_navigator1.2bp"
018 019 0x40000003 \Windows SCREEN~2.018 "screen_navigator2.2bp"
*****************************************************************************************************************************************************************
ID S. Shortcut Name Installed at Points to
001 dotPocket.lnk \Windows\Start Menu\Programs "dpManager.exe"
002 dpTCPGateway.lnk \Windows\StartUp "dpTCPGateway.exe"
003 dotPocket.lnk \Windows\Help "dotPocket.htm"
*****************************************************************************************************************************************************************
SETUP File DPINST~1.999
*****************************************************************************************************************************************************************
*****************************************************************************************************************************************************************
INF file rebuilt : "dotPocket.INF"
*****************************************************************************************************************************************************************
[Version]
Signature = "$Chicago$"
CESignature = "$Windows CE$"
Provider = "%Provider%"
[CEStrings]
Appname = "dotPocket"
InstallDir = "%CE1%\%Provider%\%AppName%" ; (%CE1%\Aurorisoft\dotPocket)
[CEDevice]
ProcessorType = 2577
Unsupported Platforms = "HPC","JUPITER"
[SourceDisksNames]
2 = ,"Dir2",,.\Program Files\Aurorisoft\dotPocket
3 = ,"Dir3",,.\Windows
4 = ,"Dir4",,.\Program Files\Aurorisoft\dotPocket\Help
999 = "Dir999",,.
[SourceDisksFiles]
"dpManager.exe" = 2 ; 001
"dpTCPGateway.exe" = 2 ; 002
"dpDisplayIp.exe" = 2 ; 003
"dpDrivers.dll" = 3 ; 004
"dpService.dll" = 3 ; 005
"dpRAPIGateway.dll" = 3 ; 006
GX.DLL = 3 ; 007
gapi.dll = 3 ; 008
"Troubleshooting.htm" = 4 ; 009
"ScreenNav.htm" = 4 ; 010
"dotPocket.htm" = 4 ; 011
"DeviceManager.htm" = 4 ; 012
"device_manager_buttons1.2bp" = 3 ; 013
"device_manager_register1.2bp" = 3 ; 014
"device_manager1.2bp" = 3 ; 015
"device_manager2.2bp" = 3 ; 016
"screen_navigator1.2bp" = 3 ; 017
"screen_navigator2.2bp" = 3 ; 018
DPINST~1.dll = 999 ; 999
[DefaultInstall]
CESetupDLL = DPINST~1.dll ; (DPINST~1.999)
CEShortcuts = RaccourcisCourts,Raccourci02
CopyFiles = CopierVersDir00,CopierVersDir02,CopierVersDir03
[CopierVersDir00] ; (%CE1%\Aurorisoft\dotPocket\Help : \Program Files\Aurorisoft\dotPocket\Help)
"Troubleshooting.htm",,,0x40000003
"ScreenNav.htm",,,0x40000003
"dotPocket.htm",,,0x40000003
"DeviceManager.htm",,,0x40000003
[CopierVersDir02] ; (%CE1%\Aurorisoft\dotPocket : \Program Files\Aurorisoft\dotPocket)
"dpManager.exe",,,0x40000003
"dpTCPGateway.exe",,,0x40000003
"dpDisplayIp.exe",,,0x40000003
[CopierVersDir03] ; (%CE2% : \Windows)
"dpDrivers.dll",,,0x40000003
"dpService.dll",,,0x40000003
"dpRAPIGateway.dll",,,0x40000003
GX.DLL,,,0x00000012
gapi.dll,,,0x40000003
"device_manager_buttons1.2bp",,,0x40000003
"device_manager_register1.2bp",,,0x40000003
"device_manager1.2bp",,,0x40000003
"device_manager2.2bp",,,0x40000003
"screen_navigator1.2bp",,,0x40000003
"screen_navigator2.2bp",,,0x40000003
[DestinationDirs]
CopierVersDir00 = 0, %InstallDir%\Help
CopierVersDir02 = 0, %InstallDir%
CopierVersDir03 = 0, %CE2%
RaccourcisCourts = 0, %InstallDir%
Raccourci02 = 0, %CE2%\Help ; Répertoire (ID Dir 007) = \Windows\Help
[Strings]
Provider = Aurorisoft
[RaccourcisCourts]
%Appname%, 0, "dpManager.exe", %CE11% ; (\Windows\Start Menu\Programs)
dpTCPGateway.lnk, 0, "dpTCPGateway.exe", %CE4% ; (\Windows\StartUp)
[Raccourci02],
%Appname%, 0, "%AppName%.htm" ; Répertoire (ID Dir 007) : %CE2%\Help (\Windows\Help)
fards said:
either post up the cab you installed or have a look at it yourself in msceinf that will give you some clues as to what it installed.
What was the option with resolution you took??
OH and I've just had a look at the prog and it's designed for 2003! that's like complaining that os/2 messes up vista..
I think you may be stuck with a hard reset, and a lesson to not do it again...
In future MyMobiler, it's not fast but you can do screengrabs through activesynce/wdm
Click to expand...
Click to collapse
LOL I agree with your quote about os/2, I didnt realise it was 2003 til after DUH!
"Post up the cab or have a look yourself" - It was installed from a pc .exe file via Activesync, is it possible to extract the CAB from this? If so that would be great but I thought that was the point of an exe installer? Im considering a hard reset now, had the phone six weeks still on stock ROM and no hard resets as had no issues whatsoever. Oh well, live & learn. At least I have the luxury of being able to plug the phone in and copy all data off before wiping
EDIT: Just seen your readout thanks for that. What do you mean "a Gapi.dll thats unlikely to have been removed"? I see very few registry entries (if any) so its likely to be a replaced interface related file (like you suggested). Maybe I installed the smartphone version by mistake? (with no touchscreen support?) I am sorry I do understand what all this means and where to find these files etc, but I dont know what to start looking for to do with my problem. should i just start replacing these files with backed up versions? any hints of where to start would be appreciated, It would be interesting to understand why this program did this rather than to just hard reset it and cover my tracks
I suggest hard reset because I will not trust anymore in my phone registry after a disaster like this even if fixed. just my humble opinion but something bad could silently remains and comes up in the worst moment or at next customization driving you crazy
for the future I suggest a periodic full backup before try a new program, and for screens you can try mymobiler
Annoyed by the fact that Search Companion doesn't return the text string you specified even though you indicated All Files & Folders?
This handy script allows you to extend the PersistenHandlers to include other extension. In my case, I added: provxml and rgu. Copy and paste the following code into notepad and save as a .VB script (ex: xp_persisthandler.vbs). Execute the script and specifiy the file extension you wish to include in Search Companion.
Code:
'Add files to Search for files containing text
'© Doug Knox - 11/04/2001
'This code may be freely distributed/modified
Option Explicit
On Error Resume Next
Dim WshShell, N, P, P1, P2, ItemType, MyBox, FileType, Title, Prompt, RegKey, X
Set WSHShell = WScript.CreateObject("WScript.Shell")
P = "HKEY_CLASSES_ROOT\."
P1 = "\PersistentHandler\"
N = "{5e941d80-bf96-11cd-b579-08002b30bfeb}"
Prompt = "Enter the file extension for the file you wish to add." & vbCR
Prompt = Prompt & "Examples: txt, adm, inf"
Title = "Enter File Type"
FileType = InputBox(Prompt, Title, "")
If FileType = "" Then
MyBox = MsgBox("You left the box blank.",4096,"Error.")
Set WshShell = Nothing
WScript.Quit
Else
'Check to see if there is already a PersistentHandler default value
RegKey = P & FileType & P1
X = WshShell.RegRead(RegKey)
End If
'MyBox = MsgBox("The PersistentHandler value for ." & FileType & " is: " & X,4096,"Results")
'Set WshShell = Nothing
If X = N Then
MyBox = MsgBox("This value already exists, and is correct." & vbCR & "No Changes were made.", 4096, "No Changes")
Set WshShell = Nothing
WScript.Quit
End If
If X <> N AND X <> "" Then
MyBox = MsgBox("The Persistent Handler value already exists and is different." & vbCR & "No changes were made.", 4096, "No Changes")
Set WshShell = Nothing
WScript.Quit
End If
If Err.Number <> 0 Then
WshShell.RegWrite RegKey, N
MyBox = MsgBox("The Registry has been updated." & vbCR & "Restart your computer.", 4096, "Done")
Set WshShell = Nothing
End If
I wanted to share a small script I wrote for those who know how to use it. It converts non-binary pim-backup message files to html files.
Usage: ruby <file> <message_file>
Code:
#-sms2html----------------------------------------------------------------#
# ChaosR (<[email protected]>) wrote this file. As long as #
# you do not touch this note and keep this note here you can do whatever #
# you want with this stuff. Also, the author(s) are not responsible for #
# whatever happens using this. #
#-------------------------------------------------------------------------#
require 'jcode' if RUBY_VERSION[0..2] == "1.8"
class SMSConverter
attr_accessor :messages, :raw, :by_folder, :by_name, :by_number
SPEC = [
:msg_id,
:sender_name,
:sender_address,
:sender_address_type,
:prefix,
:subject,
:body,
:body_type,
:folder,
:account,
:msg_class,
:content_length,
:msg_size,
:msg_flags,
:msg_status,
:modify_time,
:delivery_time,
:recipient_nbr,
:recipients,
:attachment_nbr,
:attachments
]
RECIP_SPEC = [
:id,
:name,
:phone,
:var1,
:var2,
:type
]
FOLDERS = {
"\\%MDF1" => "INBOX",
"\\%MDF2" => "OUTBOX",
"\\%MDF3" => "SENT",
"\\%MDF4" => "TRASH",
"\\%MDF5" => "DRAFTS"
}
def initialize(file)
f = File.open(file)
@raw = f.read
f.close
raw2array
clean_messages
sort_messages
end
def raw2array
messages = []
state = { :arg => 0, :escaped => false, :in_string => false }
sms = {}
@raw.each_char do |byte|
arg = SPEC[state[:arg]]
sms[arg] = "" unless sms[arg]
if byte == "\0" or byte == "\r"
next
elsif state[:escaped]
sms[arg] << byte
state[:escaped] = false
elsif state[:in_string]
if byte == "\""
state[:in_string] = false
elsif byte == "\\"
state[:escaped] = true
else
sms[arg] << byte
end
elsif byte == "\\"
state[:escaped] = true
elsif byte == "\""
state[:in_string] = true
elsif byte == ";"
state[:arg] += 1
elsif byte == "\n"
raise "Faulty conversion or corrupt file" if state[:escaped] or state[:in_string] or state[:arg] != 20
messages << sms
sms = {}
state[:arg] = 0
else
sms[arg] << byte
end
end
@messages = messages
end
def clean_messages
@messages.map! do |sms|
sms[:modify_time] = Time.local( *sms[:modify_time].split(",") )
unless sms[:delivery_time] == ""
sms[:delivery_time] = Time.local( *sms[:delivery_time].split(",") )
else
sms[:delivery_time] = sms[:modify_time]
end
sms[:recipient_nbr] = sms[:recipient_nbr].to_i
sms[:body_type] = sms[:body_type].to_i
sms[:msg_flags] = sms[:msg_flags].to_i
sms[:msg_status] = sms[:msg_status].to_i
sms[:attachment_nbr] = sms[:attachment_nbr].to_i
sms[:content_length] = sms[:content_length].to_i
sms[:msg_size] = sms[:msg_size].to_i
sms[:folder] = FOLDERS[sms[:folder]]
if sms[:recipient_nbr] > 0
recipients = {}
sms[:recipients].split(";").each_with_index { |var, index| recipients[RECIP_SPEC[index]] = var }
recipients[:id] = recipients[:id].to_i
recipients[:var1] = recipients[:var1].to_i
recipients[:var2] = recipients[:var2].to_i
sms[:recipients] = recipients
end
sms
end
end
def sort_messages
@messages = @messages.sort { |a, b| a[:delivery_time] <=> b[:delivery_time] }
@by_folder = {}
@messages.each do |sms|
@by_folder[sms[:folder]] = [] unless @by_folder[sms[:folder]]
@by_folder[sms[:folder]] << sms
end
@by_name = {}
@messages.each do |sms|
if sms[:recipient_nbr] > 0
if sms[:recipients][:name] != ""
name = sms[:recipients][:name]
else
name = sms[:recipients][:phone]
end
else
if sms[:sender_name] != ""
name = sms[:sender_name]
else
name = get_number_from_address(sms[:sender_address])
end
end
@by_name[name] = [] unless @by_name[name]
@by_name[name] << sms
end
@by_number = {}
@messages.each do |sms|
if sms[:recipient_nbr] > 0
name = sms[:recipients][:phone]
else
name = get_number_from_address(sms[:sender_address])
end
@by_number[name] = [] unless @by_number[name]
@by_number[name] << sms
end
end
def get_number_from_address(address)
if address =~ /^(\+?\d+)$/
return address
elsif address =~ /\<(\+?\d+)\>/
return $1
else
return false
end
end
end
if $0 == __FILE__
require 'fileutils'
dir = "./messages"
my_name = "yourname"
sms = SMSConverter.new(ARGV[0])
FileUtils.mkdir_p(dir)
sms.by_name.each { |name, messages|
filename = File.join(dir, "#{name}.html")
f = File.open(filename, "w")
f << "<html><body>"
messages.each { |sms|
sent = sms[:recipient_nbr] > 0
message = sms[:subject]
f << "<b>--- #{sent ? my_name : name} (#{sms[:delivery_time].strftime("%H:%M:%S, %a %d-%b-%Y")}) ---</b><br/>"
f << "<pre>#{message.strip}</pre><br/><br/>"
}
f << "</body></html>"
f.close
}
end
I'm a little new to this, but am really interested.
I installed Ruby and then created your ruby script. I then run from command prompt:
convertsms.rb pim.vol convertedsms.htm
but I get the following error. What have I done wrong?
C:\Users\mjt\Desktop>convertsms.rb pim.vol convertedsms.htm
C:/Users/mjt/Desktop/convertsms.rb:67:in `raw2array': undefined method `each_cha
r' for #<String:0x24ee9d4> (NoMethodError)
from C:/Users/mjt/Desktop/convertsms.rb:57:in `initialize'
from C:/Users/mjt/Desktop/convertsms.rb:199:in `new'
from C:/Users/mjt/Desktop/convertsms.rb:199
I'm just supposed to run it on a copy of my pim.vol correct?
Thanks!
You have to install pimbackup on your phone, make a non-binary backup. Download the backup to your computer, unzip it, and run this script on the msgs_<date>.csm file. This script will then create a folder called messages and store all the messages per user in it.
ChaosR said:
You have to install pimbackup on your phone, make a non-binary backup. Download the backup to your computer, unzip it, and run this script on the msgs_<date>.csm file. This script will then create a folder called messages and store all the messages per user in it.
Click to expand...
Click to collapse
Ok, I installed pim backup backed up the messages, copied the file to my computer, extracted the csm file and the following happened when I tried to run it.
C:\Users\mjt\Desktop>ruby convertsms.rb msgs.csm
convertsms.rb:67:in `raw2array': undefined method `each_char' for #<String:0x33e
94c> (NoMethodError)
from convertsms.rb:57:in `initialize'
from convertsms.rb:199:in `new'
from convertsms.rb:199
Thanks!
Heh, it seems on Windows you need to include jcode for each_char to work. Put the new code in. Cheers.
how to convert the binary backup to a non binary backup? other than restoring and backing up.
Relaying SMS
Would it be possible to relay the SMS to another phone when backing up, perhaps as a transfer operation, or by sending SMS via a webservice?