Possible solution for TF3D Qvga Standby issue, dev needed - Windows Mobile Development and Hacking General

Hi there,
cause most of you know the problem with TF3D Qvga and StandBy.
Could anyone here with knowledge of coding write a small app that acts like the standby timer in Windows Mobile?
I thought about something like that:
If no user action is recognize for time x, then deactivate TF3D (HKLM","\Software\Microsoft\Today\Items\TouchFLO 3D","Enabled","0")
and device goes to standby.
If device wakes up (or pressing power button) TF3D will be enabled again.
I think for someone with knowledge in development it shouldn't be mouch action, but it would be great to have a fully working TF3D and i think driver development still will need some time.
So, if someone is able to do that, please, please, please
I will test everything.

that should only be a few lines of mortscript, no ?

No itried this by myself (it's anywhere here in this forum) and i talked to Mort, too.
But there is no possibility in the actual version to recognize user actions.
The rest you can easyli write in MortScript, but not the user recognation.

Related

How do I stop the PPC from turning off?

Hi guys,
Hope this hasn't been asked before too many times. I did do a search but couldn't find anything.
I've just written a small app for ppc (works on 2002, 2003 and WM5) to act as a countdown timer. However, unless I set my Wizard to never shutdown, it turns off whilst the timer is still going.
I've had a look through the latest SDK's (I'm using Visual Studio 2005 and the latest version of the Compact .NET Framework) but can't figure out how to stop this.
The only way I can think of is to find the reg key that controls this (I assume there is one), copy it, set it to a rediculous or null value and then copy it back again on shutdown. But it seems like a god awful solution and prone to any number of errors where it doesn't get copied back.
Is there a simple ".NET" way to do this?
BTW Although I've been a developer for [cough] years, I've never written anything for PPC before.
Cheers,
Bassey
Hi
take a closer look at HKLM\System\CurrentControlSet\Control\Power. There you will find system and user idle timeouts. To prevent a PocketPC WindowsMobile system from going to sleep, you must reset the System idle timer periodically. This is done by a call to
void WINAPI SystemIdleTimerReset (void);
I think this will be the same for WinCe 3.0 up to WinCe5
If you think about a good programming starter book, I recommend Douglas Boling 'Programming Microsoft Windows CE .NET' (3rd edition). It talks about nearly everything. It is my favourite book.
regards
Josef
Thank you very much indeed. Have just ordered the book as well.
Cheers,
Bassey

Switch Radio on&off from .NET

Hi, I'm a .NET developer and I want to start to develop mobile apps.
My last device is a KJAM that need pen-tap to toggle radio on & off and this is a little frustrating for me (especially when it rains). So I decided to develop a simple (!) app so I can switch my phone on and off simply pressing the "red" button (for example).
Now I found how to bind the red-button-press event to my app but I really not yet found the (damn) method that let me to switch the phone (radio) on and off.
Can someone give me PInvoke samples to use in my C# app?
thnks
At least I can point you to an application, that does what you want.
read the thread http://forum.xda-developers.com/viewtopic.php?t=34831&highlight=
See my posts there (Conchas), and the .exe turned available by Koksie.
The same .exe toggles between enable/disable.
It is really great
thanks a lot ...
even if I wish to develop this app by myself (to start to "surf" the PInvoke hell) of course your advice will help me to reduce my frunstration switchin on my phone
You can always PM Koksie, asking for the function call he used.
I'll do it but he downloaded the program ... in the meantime ... the hardware button "4" now switch my radio on and off

How to run application in suspend mode ?

Hello eveyone,
I do not know if this is the right place to post my question, if not please advice of where I should do so.
My question is the following:
Is it possible to configure WM5 registry keys so as to enable an application run in suspended mode. In other words when the PPC goes to stand-by-mode I would like my application to keep on running.
I have developed a Java application (runs with IBM J9) but when the PPC enters the suspend mode, threads pause and the application does not behave as it should do. My intention is not to completely disable suspend mode for the PPC, but just for an application (as it is possible to prevent e.g. the 'sound device' ('wav1:') from going to suspend mode, when the PPC goes to stand-by).
Thank you in advaced.
No
Read here:
http://blogs.msdn.com/windowsmobile/archive/2006/08/16/702833.aspx
and here:
http://blogs.msdn.com/windowsmobile/archive/2005/08/01/446240.aspx
Apparently, if you want your app to run, the device can't be suspended.
I'm not sure how useful this is, depending on your program, you might want to consider using notification queues to wake the PC up to run your software.
Anyway, I'm not sure how true what Setok said above, I do find many other programs that runs with my PPC is in 'suspend' mode. E.g. I've tried various timer (count down) program which seems to be able to run in background when after I press the power-button to suspend it. I wake my phone when it reaches 0. And it is done without using notification queue.
The links above certainly seem to authoritatively state that applications can't run in sleep mode, so I posted it. But hanmin's post made me wonder what was up, so I went looking. There are a few more states.
An application can use:
PowerPolicyNotify(PPN_UNATTENDEDMODE, TRUE);
to put the device in unattended mode so that it doesn't suspend. In unattended mode the backlight, LCD, and audio still turn off.
There are a couple more power states explained here:
http://blogs.msdn.com/windowsmobile/archive/2005/08/10/450186.aspx
If you do put the device in unattendedmode be sure to call
PowerPolicyNotify(PPN_UNATTENDEDMODE, FALSE)
before you exit.
I just re-read your post, you want audio on, then use ScreenOff mode. See the above link.
Good luck
Registry way....
Hello guys,
thank you very much for your concerns and details.
To tell you the truth I have read all of these in the past. And I believe that since you can program this on-the-fly probably you can do it also by altering registry keys. In other words, not do it programmatically, cause this involves writting a C program (mu application is Java). After all if you notice ....the values that you can change through you C application to alter suspend mode for you application are 'registry values'.
My application is an event calendar, that checks the time and if there is an event it notices the user. When the mobile goes to suspend mode the thread pauses and the application does not work as appropriate...Tha't why I would like to set it in the registry-stage...
If you find anything of interest I would be more that thankfull
Thank you in advanced. ;-)
Christos
Hey,
have a look at the CeSetUserNotificationEx() function and the CE_NOTIFICATION_TRIGGER structure.
This is the way MS calendar app does it on the device.
Register your exe for a special time and if in suspend mode and
the time is reached you app will bestarted. Nice or?
Infos here: http://msdn2.microsoft.com/en-us/library/ms913969.aspx
Houser
Hi all,
I recently installed Pedometer on my HTC HD (with MaryOne X0.04☻Build 23502 COM5☻Leo 1.43), but I would like to "suspend" the device, and yet let the Pedometer run in the background, so it could measure my walk distance/steps.
I am not a programmer, but I could change a few registry settings if anyone could point me in right direction...
Thanks in advance,
cheers,
Nenad
p.s. - it should be possible, how all the other "background" programs are running (the clock, the notification, the G alarm...) ?

MaxHome (replacement of Today)

PROGRAM IS NOT WORKING AT 100%! AT THIS MOMENT ONLY FUCTIONS LISTED BELOW ARE WORKING. OTHER FUNCTIONS UNDER DEVELOPMENT.
Current Version
- [NEW] Birthdays button/indicator works
- [NEW] A little bit more comfortable clock setting
- [NEW] Fade-in effect now depends on your device speed
- Clock Settings
- Clocks, Indicators
- Balance update
- BlueTooth, GPRS/EDGE, WiFi, GSM on/off
- Support for all resolutions (hope so )
- Support for scale components of main window (may be useful for big resolutions)
Install: unpack to Program Files to your device.
Scale factor and balance setting are in HKCU\Software\MaxHome
Day's period to search birthdays in the same regestry.
To Do Next: sort birthdays in order of days, alarm settings, maybe screenlock
Hmmmm. so i'l be the first one
I'me more into icons and launchers but nice icons
I'm sure that a lot of people will like this
Very nice...can't wait to take it for a spin
It's amazing ! I really want this ! Good job !
Thos application seems to be verry good.
nice!!! quite tired of the normal todays screens..too much cluttered plugins...
hope you could share with us soon very much interested to try out...
nice work keep it up =) hope it is also support VGA..coz many developers develop QVGA soft huhu
looks good, keep it up!
I'm begginer in programming. So dont promise a VGA version. I wrote it with Windows Mobile 6 SDK. I think it will work with 5.0 and 6.0 of coarse.
Actually I doing it for my personal using (QTek S200, WM6).
Will be glad if some one else will can to use it
hi MaxKysh, im a beginner too. Is possible to use grafic libs like XFlib in your project?
Don't know I use only API functions.
Please, try it
Here it is if somebody want to try Please report of your try.
Tested on QTEK S200 - works well.
Tested on Asusu p525 - don't work BlueTooth swith (will try to fix it).
WiFi switch don't realised yet.
Place into Program Files on your device.
The balance USSD request message stored in HKCU\Software\MaxHome\Balance\Message.
http://forum.xda-developers.com/attachment.php?attachmentid=72766&stc=1&d=1204001375
I've got an normal htc elf p3450
And the program doesn't work correct, the background doesn't load therefore the transparant icons doesn't show.
I can enter the settings tab but i don't think any of the settings work.
I know you are a starting programmer (and i can't program anything so i have deep respect for you) but could you concider something like total customization
Greetz
Did you extract it to Program Files? (I meen Program Files\MaxHome\, and not to Storage Card (!)). Don't promise full customize but will work on it
MaxKysh said:
Did you extract it to Program Files? (I meen Program Files\MaxHome\, and not to Storage Card (!)). Don't promise full customize but will work on it
Click to expand...
Click to collapse
As i have a dutch elf i don't have the program files folder but i made one by hand and copied the whole MaxHome folder to that directory but it still didn't work.
Greetz,
Hmm... That is my big mistake Will try to fix it
hi, just tried it, unzipped to device/Program Files/Max Home
tried running MaxHome01b.exe and comes up with error:
"the file 'MaxHome01b' cannot be opened. Either it is not signed with a trusted certificate, or one of its components cannot be found. You might need to reinstall or restore this file."
I clicked on accept when it said it wasnt signed...
Not working for Wizard
Date and time displayed correctly, the "Comm Manager" displays correctly but the Bluetooth button is the only one functioning, the rest do not have any effect.
Icons at the bottom do not work at all.
Anyhow, good idea, keep the good work!
Forget to say:
realized at this moment only:
- Clocks
- BlueToot, GSM, GRRS switch (WiFi - not yet)
- Balance Update
The bottom icons just for full view They are not working.
Please tell me, which Software to programm do you use??
Can you post the source code, so that we can help you to make a realy realy good home screen?
Thanks

[solved] How to prevent standby using VB.NET?

Hallo!
I'm working on an application called hTorch and although it is my first vb.net app I was quite successfull so far (at least I hope so ). But one think I'm just not able to achieve: Preventing the device from going into standby/suspend while the app is running.
In C++/C# there semes to be a system call "SystemIdleTimerReset()" but either there is no equivalent for vb.net or I was not able to find it.
Another thought was to modify the according registry key (HKLM\System\CurrentControlSet\Control\Power\Timeouts\BattSuspendTimeout) and to restore the original settings on program exit. This works fine except that WM does not apply the settings change immediately when it's done via registry. Again I did some research and again I only found a solution for C++/C# only. A system call named "NWUS_MAX_IDLE_TIME_CHANGED" tells the OS that the settings have changed and should be reread. I wasn't able to find something similar for vb.net though.
Does anybody know a solution for my needs?
Maybe someone could provide me with some sample code how he achieved this within vb.net?
Maybe some C++/C# programmer has build a library to access the power functions?
I would be really thankful for any help/hint you can give me!
Thanks in advance,
DeepThought
The standby mode is in the registry. Make a timer in VB.net and set it with an interval of about 5000 ms. Then make sure that ever time the timer ticks the standby mode will be disabled in the registry
Thank you for the quick response!
But the change via registry doesn't work. When I change the BattSuspendTimeout to 0 that does change the setting correctly. But they become not active. Only after a soft reset. It seems, that you somehow have to notify windows, that the settings have changed. Otherwise the will not be reread.
Any Idea how to achieve that?
I would also like to know if there is a way to prevent suspend.
I think only the pocket pc winmo versions do a real suspend where wifi and applications stop processing, and the smartphone winmo devices only kind of black the screen.
The only software I know is S2U2 which successfully can prevent "real suspend" and let e.g. my led notification work correctly.
Cause i cannot really use it on ks20 due to compatibilty issues i would be very interested in a reg hack, or (if there really is no reghack, i tried alot) some code snipets with which i could build a little app.
There's a pretty good article on CodeProject covering power.
*digs out link*
Here you go - http://www.codeproject.com/KB/mobile/WiMoPower1.aspx
It covers:
* Displaying the voltage, current, and temperature of your device's battery
* Changing the power state of hardware within the device
* Enumerating the hardware in a Windows Mobile Professional device
* Enumerating the power modes that a Windows Professional device supports
* Preventing a device from sleeping
* Toggling the state of the screen's backlight
* Waking up the machine to perform work without alerting the user or turning on the screen
[solution]
Thanks to AndyZap I can now answer the question myself
It is so simple, that I'm really ashamed now.
The magic word for me was PInvoke. Since I new the function I was searching for was an available win32 systemcall the missing link was how I can make this system call within vb.net.
So the actual solution are just two lines:
Code:
Declare Sub IdleTimerReset Lib "coredll.dll" Alias "SystemIdleTimerReset" ()
where "IdleTimerReset" is the name I've given the Sub. Which than just needs to be called like:
Code:
IdleTimerReset()
NOTE: This just resets the Idle timer once. So if you want to prevent the device from going into standby you have to reset this timer every time before it reaches the threshold. (The windows default setting is 60 seconds AFAIK).
THANK YOU AndyZap for your Help via PMail!
DeepThought
Thank you for your answer Northernmost!
I really love this community!

Categories

Resources