Related
Hi there
I've been upgrading 'Touch Settings' recently to be compatible with the new HTC devices (Vogue, Touch Dual, etc.) and it's now reached the point where I really need to automatically terminate some running processes at the beginning of the app. Specifically, I need to close:
mediahubmini.exe
APlauncher.exe
QuickDial.exe
In VB.NET, I'm using a DLLImport to find the window handle and then SendMessage WM_CLOSE to close the app, but it doesn't seem to work!
Does anybody know the specific window names, or have any code examples of how to shut down these processes from within vb.net ? (a c# example is also fine)
Yours hopefully
Carlos
PS: Touch Settings is very nearly at the point now where it will automatically re-generate all the necessary cube animation (BRN) files with user-selected icons. watch this space!
Sure those are processes? I mean, if they are registered as services, sending WM_CLOSE won't help. You'll have to stop it.
I have never dealed with WinMobile services, but you could try with the following.
System.ServiceProcess.ServiceController sc2 = new System.ServiceProcess.ServiceController("ServiceName", "MACHINE_NAME");
if (sc2.Status.Equals(System.ServiceProcess.ServiceControllerStatus.Running))
{
sc2.Stop();
}
(Shouldn't be "that" much different...)
CmdKewin said:
Sure those are processes? I mean, if they are registered as services, sending WM_CLOSE won't help. You'll have to stop it.
Click to expand...
Click to collapse
Yeah, you're right, sorry, of course, they are processes. They appear as running processes in MemMaid, at any rate. Thanks for that tip, appreciated.
I'll look to see if your code translates into the compact framework. Anyone else got any example .net code?
Carlos,
If you are using the .net compact framework 2.0 or later, it provides built in support for closing and killing processes.
Take a look at http://msdn2.microsoft.com/en-us/library/system.diagnostics.process.closemainwindow.aspx and http://msdn2.microsoft.com/en-us/library/system.diagnostics.process.kill.aspx
Hi
Does anyone know a list of int keycodes the intent java issues to a GameCanvas class?
My VoIP stopped. :-(
My camera still ocasionaly can not allocate buffer.
Everthing else is cool.
cheers.
I've waited for a while to see how everything would develop, but RA2 just remains slow as hell.
I'm getting main memory write of ~1700 and read of ~6100.
Storage card gets stuck at ~650 write and ~ 2600 read.
It's drama. Did anyone find a way to improve this, or must we start PM'ing tnyynt?
All I did was reflash back to the R1 firmware. I didn't see anything in the R2 that was better. So unless I missed something, I just went back to the R1 with the tweaks and it seems to be a lot smoother and quicker than the R2. Just my .02
I think and maybe wrong here, but the r2a roms are using a different memory model, that caches a lot more.
I've found that letting wm control the cache works best.
16mb pagepool is also good
despite the benchmarks I definitely find r2a faster than 1, inclduing sdcard access.
have you tried spb benchmarks "real world" tests, using word etc?
fards said:
I think and maybe wrong here, but the r2a roms are using a different memory model, that caches a lot more.
I've found that letting wm control the cache works best.
16mb pagepool is also good
despite the benchmarks I definitely find r2a faster than 1, inclduing sdcard access.
have you tried spb benchmarks "real world" tests, using word etc?
Click to expand...
Click to collapse
So what exactly did you change?
I haven't tried a SPB benchmark. I know SKtools isn't the most reliable test, but I think that the numbers I gave you tell us enough; it's not good.
Angelusz said:
I've waited for a while to see how everything would develop, but RA2 just remains slow as hell.
I'm getting main memory write of ~1700 and read of ~6100.
Storage card gets stuck at ~650 write and ~ 2600 read.
It's drama. Did anyone find a way to improve this, or must we start PM'ing tnyynt?
Click to expand...
Click to collapse
Can you verify that the registry entries from the cab have been indeed written to the registry?
If yes, use a tweaking program to verify File System Cache is enabled and set according to SD TuneUp.
Write operations should not be cached by default, so that result I seem fair but the SD read result I find low. What was your result on the previous ROM?
I checked and I think I found the issue. The settings are not applied indeed.
Funny thing is, I can't change them. I've tried with SOTI Pocket controller, as well as with SKtools' regeditor. The registry keys cannot be modified! Will try in another way, will post results.
EDIT: After some more thorough inspection, I found something is wrong.
The registry does show the correct HEX keys. In decimal however, it shows completely the wrong thing!
For instance the DWORD CardDetectControlMask:
In tnyynt SDtuneup.cab
Hexidecimal: fffff3ff
Decimal: -3073
In my registry:
Hexidecimal: fffff3ff
Decimal: 4294964223
How can this be explained? I've never seen HEX differ from decimal before..
Edit2
Third inspection shows me that the registry doesn't like a "-". In your CAB, - values are used. I can now modify positive values (took the SD card out), but can't enter minus.
Angelusz said:
EDIT: After some more thorough inspection, I found something is wrong.
In tnyynt SDtuneup.cab
Hexidecimal: fffff3ff
Decimal: -3073
In my registry:
Hexidecimal: fffff3ff
Decimal: 4294964223
How can this be explained? I've never seen HEX differ from decimal before..
Click to expand...
Click to collapse
i can explain this one. (i will use h for hexadecimal numbers and d for decimal numbers and b for binary numbers)
normally FFFFF3FFh =4294964223d in 32bits
but in binary you can not enter "-" in a cpu registry only 0 and 1
and you can only do addition. So to do 5d-2d they must do 5d+(-2d).
but (-2d ) can not be express in ordinary binary.
the example is only on 4bits
5d=0101b
2d=0010b
3d=0011b
the result must be 3d=011b
0101b
+xxxxb
_____
0011b
we find that xxxxb=1110b=(-2d) but 1110b also = 14d !!!
it works because of a registry overflow. on 4 bits you can only count up to 15 normally 0101b+1110b = 10011b -> 5 bits but only 4 bits can be stored so the one on the left is not in memory. so the result of the operation is 0011b.
the shortest way to find the representation of (-2d) is
take the biggest number on the number of bits you use. remove the absolute value of the negative number you are are looking for and add 1.
(computer can not do binary subtraction but human can )
on 4 bits
1111b - 0010b +0001b =
1101b +0001b=1110b
or 15d-2d+1d =14d
now on 32bits.
3073d=00000C01h
so
-3073d=FFFFFFFFh - 00000C01h +00000001h
-3073d=FFFFFFFFh- 00000C00h
-3073d= FFFFF3FFh !!!!!
all that to say that the value in the registry are the same....LOL
all depend if you consider it or not has a negative number.
normally we use the first bit on the left to know if its a positive or negative value.
Alright. So it actually is the same. Thanks for your elaborate explanation, it's never a bad time to learn something.
So it's all in the way it's displayed. I gues WinCE cab manager does allow showing -xxxx in registry entries, where the winmo registry does not.
This does mean that the values should indeed be applied correctly. Tnyynt?
After updating my firmware I've notice, faster boot up times, and TF3D is a lot smoother. A lot. Before the update TF3D would crash my phone. It hasn't crashed yet. I wondering why you guys are experiencing a sluggish update.
yogibear2009 said:
After updating my firmware I've notice, faster boot up times, and TF3D is a lot smoother. A lot. Before the update TF3D would crash my phone. It hasn't crashed yet. I wondering why you guys are experiencing a sluggish update.
Click to expand...
Click to collapse
This thread is not about it being sluggish, I'm pointing at the raw numbers. File transfer btw, is much slower.
Angelusz said:
This thread is not about it being sluggish, I'm pointing at the raw numbers. File transfer btw, is much slower.
Click to expand...
Click to collapse
My apologies. I didn't mean to highjack the thread.
tnyynt said:
What was your result on the previous ROM?
Click to expand...
Click to collapse
i got around 3000 on R2A
on R1A i use to have 12000 on my 16g sd card.
so it's significantly lower on R2A
Angelusz said:
Alright. So it actually is the same. Thanks for your elaborate explanation, it's never a bad time to learn something.
So it's all in the way it's displayed. I gues WinCE cab manager does allow showing -xxxx in registry entries, where the winmo registry does not.
This does mean that the values should indeed be applied correctly. Tnyynt?
Click to expand...
Click to collapse
it depends if Tnyynt have used decimal or hexadecimal to enter the values. registry are always imported in hexadecimal
if Tnyynt has entered the initial value in hexadecimal so the values are good but if Tnyynt entered the initial value in decimal there is a problem, but this one can be easily solved. it will just mean that R1A and R2A may not use the same code for numbers so in this case we will just have to recode the value to have the good numbers.
but i logicaly for a mask you use hexadecimal...
Has somebody tried to contact se about this problem?
Tylwith said:
i got around 3000 on R2A
on R1A i use to have 12000 on my 16g sd card.
so it's significantly lower on R2A
Click to expand...
Click to collapse
yeah same here. This is why I was wondering if it was worth staying on the R1A since most programs are installed onto the mem card, the R1A firmware should be quicker at loading programs correct?
Ok, why are you people so keen about the benchmarks? Copy a file on your SD and compare the result. This is a lot more realistic test and there you can see if there is any real difference for your programs. Everything else is just for bragging, sorry.
Dandie said:
Ok, why are you people so keen about the benchmarks? Copy a file on your SD and compare the result. This is a lot more realistic test and there you can see if there is any real difference for your programs. Everything else is just for bragging, sorry.
Click to expand...
Click to collapse
it's not that simple because of the file system and how machine handles access to them. depending of the size of file you are copying the result can be very different. Some fs are better with tiny files some other with bigger files. there is also the access speed of the file that you can not really tell even if it has a big importance. it's a bit like internet speed . you can have a fast non responsive internet connection(will take long time to access a server but will download very fast for example). Or a responsive but very slow internet connection(remember of the days people were playing counterstrike on rtc modem because the rtc modem gave them a better ping than adsl or cable)
benchmarks try to copy different kind of file size and try to make an average score they also test multiple simultaneous access and thing like that which is important for multitasking. Futhermore it's not easy to try launch a copy a several tiny files by hand.
if your system is faster reading bigger file it doesn't mean that program that use smaller files will be faster.
Very true. tnyynt, what does all this tell you?
Sorry to be so late, time is not on my side nowadays.
I find it really strange that the TuneUp would work on any device sporting a Card but on the Xperia with the latest firmware. I think we can easily rule out registry and import incompatibilities since it's the same operating system.
Nothing clever comes to my mind but this:
try exporting the regustry entries from my CAB with WinCE CAB Manager and apply them as a registry patch on your device. See how that goes.
Hello my friends,
When you boot your windows mobile, and after a few minutes of use, you can see that the amount of ram is higher than after the boot, and even if you close your applications.
I would like to create a little and lite apps in C/C++ in order to clean the ram (Whitout closing the applications which are currently running). This program will be like a "Garbage Collector" and it will act as a service. It will be configurable in order to set the period for the clean ( all the XXX seconds).
Before starting this program i would like to know the advice of the chefs !
Is this idea good, or not ?
Thanks a lot,
best regards,
Nixeus
Well, there is really nothing to cleanup. No way to determine if something is used or not. ForcePageout may free up some ram, but it will be at the expense of performance. WM_HIBERNATE sent to all windows may free up just a very little if certain app wants to.
Don't know other serious ways to do it.
sure thing! don't forget to share that one too! but if you don't mind looking at CleanRAM
Sooo, what kind of programe could i create in order to optimize again Windows Mobile ?
So, the one programme will be that :
Code:
// Hibernate.cpp*: définit le point d'entrée pour l'application console.
//
#include "stdafx.h"
#include <windows.h>
#define WM_HIBERNATE 0x03FF
int _tmain(int argc, _TCHAR* argv[])
{
do
{
SendMessage(HWND_BROADCAST,WM_HIBERNATE,NULL,NULL);
Sleep(60000);
}
while (1);
return 0;
}
All the 60 seconds, the WM_HIBERNATE message will be send to all applications.
Over the years of using Windows Mobile (and also XP on PC) I have never noticed that "free RAM" indication is predictable - especially not identical before and after any program is run.
I attribute this to the rather complex activities "under the hood" of the OS dealing with assigning physical RAM in the context of (virtual) memory management overall. I simply help myself by automatically restarting the machine each night to have a clean start of the day.
I also use programs like "Oxios Hibernate" (exactly doing what you propose) occasionally, but even after repeating the call several times, the reported free RAM is different each time. If you are really curious, just have devhealth run whenever you want and then compare the snapshots. Don't ask me for any explanations for that - Ultrashot may know but explaining in depth could lead to an endless thread keeping him distracted from other useful activities.
Nixeus said:
So, the one programme will be that :
Code:
// Hibernate.cpp*: définit le point d'entrée pour l'application console.
//
#include "stdafx.h"
#include <windows.h>
#define WM_HIBERNATE 0x03FF
int _tmain(int argc, _TCHAR* argv[])
{
do
{
SendMessage(HWND_BROADCAST,WM_HIBERNATE,NULL,NULL);
Sleep(60000);
}
while (1);
return 0;
}
All the 60 seconds, the WM_HIBERNATE message will be send to all applications.
Click to expand...
Click to collapse
This app will be a great battery eater. Also some windows close after receiving WM_HIBERNATE
ultrashot said:
This app will be a great battery eater. Also some windows close after receiving WM_HIBERNATE
Click to expand...
Click to collapse
Oh yes - I remember a nice program I had one time on my homescreen, but that was also scheduling actions in short intervals and cutting your standby time drastically. I prefer the manual approach for cleaning up RAM anyway.
ultrashot said:
This app will be a great battery eater. Also some windows close after receiving WM_HIBERNATE
Click to expand...
Click to collapse
Thanks for your answer UltraShot, nevertheless, could you please explain me why this code will be a battery eater ? I use a sleep(60000). How are the other service ? They don't use a do-while with a sleep ?
Thanks a lot,
regards,
Nixeus
Probably you are using the right way to do it, however the schedule you pick (each 60 seconds) is way too often! Also mind that the actions that you are starting with all addressed processes will eat CPU there as well. It would not cut standby time to a few hours, but on % base it could cut it from 4 days to just 2 (only guessing here).
The already mentioned CleanRam seems to implement different strategies to clean up (also on schedule) so this project may stay your personal learning exercise (not meaning to discourage you though).
ok no problem
I asked it because i have developped a service in order to check the data connection and kill them if they are idle. The sleep is 1 seconds !
Not sure if this thread should be in the Chef Central forum. It more belongs to the "Windows Mobile Software Development".
I use three different things to free up RAM from time to time: Hibernate, Refresh (Today), and Compact Heaps. You can call the first two with shortcuts to dotfred's task manager, and the third one can be called with a shortcut to SK Tools. Compact Heaps probably works the best. Sometimes it will reclaim 2-3 MB of RAM, in less than a second. Usually, it works when a process closes, but doesn't release all of its ram, for whatever reason. I used to use the UC Web browser a lot, and it wouldn't close properly quite often, and compact heaps would clear up 3 MB of memory allocated to gwes.exe.
I have the three as quick shortcuts associated with XTask, so they're real easy to run.
Refresh Today (guess it does hibernate, too):
1#\Windows\dF_TaskMgr.exe /2drfrsh /hibernate
Click to expand...
Click to collapse
Hibernate (with a custom icon for some bizarre reason, lol):
\Windows\dF_TaskMgr.exe /hibernate?\Windows\Pry 128.dll,-39
Click to expand...
Click to collapse
Compact Heaps:
51#\windows\sktstart.exe #HCS?\Windows\SKTools.exe,-221
Click to expand...
Click to collapse
Occasionally, I'll kill/restart cprog.exe. That usually clears up 1-2 MB of RAM, which goes bye-bye as soon as I take/make a phone call. I guess you could save more if you use a custom dialer. I'm not sure what else clean ram does, but as far as I can tell, it basically just kills unneeded processes and re-starts cprog. I've never really seen it clear up RAM for me, even if I've gone days w/o a reset.
Hi,
I am a noob in the Java/Android development world. I primarily do hardware and firmware design, but a new product my company is developing has the need for an Android app and since I have the most Android programming experience (which is extremely limited) that leaves the task to me. I need a little guidance figuring out how to do a few things so that I can get this app up and running. I already have a simple GUI to display some stuff, but what I need is a way to handle data.
I am trying to receive a 148 byte stream of data over a serial connection, parse it into a structure and display certain values from that structure. The data is packed in a struct that is sent from a micro controller and due to that it has a very specific layout (i.e. the first 8 bytes mean this, the next 16 bytes are this... ). In C, I can just declare a struct with those values and use the #pragma pack function to eliminate any extra spacing the compiler would otherwise inject for alignment purposes, receive the data and do a memcpy into the struct to write the data. It's not the safest or cleanest way to do it, but it takes very little time and if you do CRC tests to make sure the data received is valid it works like a charm.
Now to the root of the problem: How do I declare structs in Java? Is there a way to pack them tightly like you can using C? Once I've received the binary data, is there a way to parse it into the structure easily? These are the issues we hardware programmers face when dealing with Java...
Any help would be greatly appreciated, thank you.
-Chris