Looking for evC++ source for screen-off - Windows Mobile Software Development

Hello.
I searched anywhere,but I didn't found it yet,so I hope,that someone is able to help me in this case.
All I need is to implement "Screen Off" feature to my program,that switches off display and keeps everything else alive. That means classic thingie...
Thanks for your code sharing.
Btw,I am using Embedded Visual C++ 4.0

I think
Code:
DWORD SetSystemPowerState(
LPCWSTR psState,
DWORD StateFlags,
DWORD Options
);
from here should be what's needed. Check PM.h for which state flag it is (I can't remember of the top of my head, but it should be there).
Alternatively, you could try using unattended mode
PowerPolicyNotify(PPN_UNATTENDEDMODE, TRUE). (See here).
Hope that helps.

Thanks for your reply.
Unfortunately,no of them works.
SetSystemPowerState and PowerPolicyNotify are undeclared identifiers.
I also didn't found,which header file should I include.
evC++ 4.0 is relatively old tool for WM2003+,however it is free and useful also for WM6.5.

TomasNM said:
Thanks for your reply.
Unfortunately,no of them works.
SetSystemPowerState and PowerPolicyNotify are undeclared identifiers.
I also didn't found,which header file should I include.
evC++ 4.0 is relatively old tool for WM2003+,however it is free and useful also for WM6.5.
Click to expand...
Click to collapse
If you have an emulator set up for WM6.5 (not sure if you can do that with evC), you should be able to just inlcude PM.h, though I would have thought it's in WM2003.

Well,this works perfectly...
#include "PM.h"
SetSystemPowerState(NULL,POWER_STATE_IDLE,NULL);
Thanks for your help...

TomasNM said:
Well,this works perfectly...
#include "PM.h"
SetSystemPowerState(NULL,POWER_STATE_IDLE,NULL);
Thanks for your help...
Click to expand...
Click to collapse
Excellent... I should probably have said it was PM.h in my first reply... :S

Okay. Thanks again.
However I have to say,that I was used Google for it the same time amount as our dialog,but without success...

Related

X2 PanelManager panel auto switching on X1 ?

I installed the X2 panel manager. Unfortunately, does not go with me, the panel auto-switching function. What am I doing wrong? Or it does not work on the Xperia1?
Thanks...
FerdinandJ
It works for me. Should be added to HLKM\init\
@ ultrashot
Can you post a how to do it?
Big thanks to you.
FerndinandJ
apply this as *.reg:
[HKEY_LOCAL_MACHINE\init]
"Launch250"="\\Program Files\\PanelManager\\PanelManager.exe"
"Depend250"=hex:41,00,c7,00
[HKEY_LOCAL_MACHINE\init]
"Launch65"="\\Program Files\\XKeyHandler\\XKeyHandler.exe"
"Depend65"=hex:32,00,3C,00
apply this as *.reg:
[HKEY_LOCAL_MACHINE\init]
"Launch250"="\\Program Files\\PanelManager\\PanelManager.exe"
"Depend250"=hex:41,00,c7,00
[HKEY_LOCAL_MACHINE\init]
"Launch65"="\\Program Files\\XKeyHandler\\XKeyHandler.exe"
"Depend65"=hex:32,00,3C,00
Thanks for help. I will try it.
Wish you a merry chrismas!!
@ ultrashot
Hello,
last question.
I go to Registry - new value - and what typ is must take ( String, Dword, Binär, repeatedly String or expandable String)
Thanks..
Launch*** - String
Depend*** - Binary
I have this making.
But it make no automatical switch. Is must go to Panelmanager and back and then is switching. Is this normal?
after activating auto switch option in PanelManager and selecting panels' time, everything should work even with minimized PanelManager. I hope you made soft-reset
Soft Reset - OK
But : ?? with minimized PanelManager ?? How to do it??
On click on ProgrammFiles/Panelmanager.exe no action?
ultrashot said:
apply this as *.reg:
[HKEY_LOCAL_MACHINE\init]
"Launch250"="\\Program Files\\PanelManager\\PanelManager.exe"
"Depend250"=hex:41,00,c7,00
[HKEY_LOCAL_MACHINE\init]
"Launch65"="\\Program Files\\XKeyHandler\\XKeyHandler.exe"
"Depend65"=hex:32,00,3C,00
Click to expand...
Click to collapse
I tried and it didn't work for me, any other ideas?
FerdinandJ said:
I have this making.
But it make no automatical switch. Is must go to Panelmanager and back and then is switching. Is this normal?
Click to expand...
Click to collapse
Same thing happening with me....i tried this on the stock rom...any more solutions????

[W O R K I N G] Kaiser-Buntu - Ubuntu on the HTC Kaiser (!UPDATED w/DL-links!)

Hello everyone,
I am happy to inform all those folks who waited for a full Linux operating system on the HTC Kaiser PDA that today a little bit modified version of Zubuntu finally booted successfully on my HTC Kaiser.
It is a really in the alpha-state but it works, let's see what do we have:
TouchScreen: works perfectly with calibration
Screen: looks good. but programs doesn't support Kaiser's small resolution. You can fix this by using INTERPOLATION, but this makes picture quality a lot worse. To try it out edit the default.txt, find the mddi.height and mddi.weight values and change to for example 480 and 360.
Keyboard: works exactly as expected, some fine tuning with the keyboard map will be done
ScreenRotating
Not tested/not working:
WiFi (MY #1 ISSUE, TRYING TO FIX): I extracted the wifi section from an Android rootfs, successfully modprobed wlan.ko, dmesg shows that the driver is loaded OK, but:
Code:
iwconfig
tiwlan0: no wireless extensions
ifconfig tiwlan0 up
ifconfig: ioctl (SIOCDIFADDR): Can't assign requested address
TI's WLAN_LOADER program didn't work either, so now I am moving to the other driver (wl12xx)
Bluetooth (Driver is there, no BT programs installed, couldn't test it)
3G
Cameras
Phone (NO dialer, nothing, however perhaps gsm-libs can help us firing it up)
Many many thanks goes for all these people form the #htc-linux IRC channel: randomblame, Markinus, ali1234, Ondalf and bombenbach for their outstanding support and help!
I would like to say thank you especially to phh for his awesome help and patience with me!
Click on the image for more pictures!
Stay tuned for: hopefully working WiFi, screnshots, YouTube-demonstration.
If you are interested, want to say thank you, want to help, or have an idea how to fix some things please write into this topic.
Also if you like my work, please consider a little a donation for me
After all, I am pretty sure now you want to try this on your own too, so here is the link for the Google-Code website. Download all the files and read the Wiki to know what to do.
http://code.google.com/p/kaiser-buntu/http://code.google.com/p/kaiser-buntu/
Link to RootFS:
http://www.megaupload.com/?d=ANRC94ON
Mirror (thanks to jmcbrother):
http://rapidshare.com/files/371631240/ubuntu_rootfs.rar
Mirror #2 (thanks to hoatienii):
http://www.mediafire.com/?uvytadoykyy
Want to be updated? Check out the project's Twitter page!
http://www.twitter.com/kaiserbuntu
Thank you,
DOMy
RESERVED for future additions
Reserved for future additions
great work . please upload link to test
Sweet that is great news! I can't wait to try it out!
Me wants the alfa link
This is so great!
Maybe we can find a solution at my hackersspace.
Great Work... Luv Linux.... Ported Android on Windows Mobile Device... Eager to port Ubuntu on Kaiser...
can you please share the Linux Beta link ...
Makes me almost wanna install Ubuntu on my PC.
Dukenukemx said:
Makes me almost wanna install Ubuntu on my PC.
Click to expand...
Click to collapse
me 2
oh……thank you……I wanna test……wait ……
Would it be destructive to flash it to nand at this point in the project?
I wouldn't count on it even remotely fitting on the NAND. Besides, you'll probably have to have half the apps on an SD card anyway...
how about a build that will work with the new nomorootfs installers so hose of us like me can try it without going back to winmo, Would like to install to ext2.img files or sdcard partitions.
And is this remotely close to the MER Linux build that progress seems to be halted on I was able to get it to work
working XWindow?
I wouldn't recommend installing it to NAND (it doesn't work so good, for example I didn't have time to test power/suspend).
Xwindows works perfectly (except the resolution issue).
DOMy
resolution issue. can you please explain that? (whats wrong in resolution) before i flash back to ,WM and try it
Michga said:
resolution issue. can you please explain that? (whats wrong in resolution) before i flash back to ,WM and try it
Click to expand...
Click to collapse
The problem is that the rootfs is not for the Kaiser and the Xserver uses some hardcoded resolution (that means there is no config file for it) so circa half of the windows are too big for the screen. It is not a big problem because you can move them around so it is easy to get to one of the corners and resize them so you can see the whole thing at once.
Fixing this is on my To-Do list
sorry for the dumb question but...
will this support phone???
no mention in the OP.
I assume no. (for now anyway)
mnjm9b said:
sorry for the dumb question but...
will this support phone???
no mention in the OP.
I assume no. (for now anyway)
Click to expand...
Click to collapse
Driver support is there, but AFAIK no frontend yet.
DOMy
mod: I found this: http://packages.ubuntu.com/hardy/comm/gsm-utils and this http://manpages.ubuntu.com/manpages/gutsy/man8/gsmctl.8.html perhaps I will try it later (or someone can try it and report)
This intrigues me muchly, but why ubuntu/debian based?
There are other, (and imho simpler), bases to build on, slackware springs to mind, and there are some tiny distros out there, which may also be worth looking at, to say nothing of the likes of Familiar, an interesting candidate for a non-android htc-linux.

[Q] Usage of Microsoft.Phone.Media.Extended

I'm attempting to access the camera and its features through Microsoft.Phone.Media.Extended.dll, but am only coming up with COM errors. Any help would be appreciated.
PhotoCamera cam = new PhotoCamera(CameraSource.PrimaryCamera);
when I go into debugging mode and inspect "cam" it shows that most of its properties are null. Does anybody know how to initialize this?
You can only access the camera from the photo Chooser task:
http://msdn.microsoft.com/en-us/library/microsoft.phone.tasks.cameracapturetask(v=VS.92).aspx
Sent from my HTC HD2 using XDA App
Blade0rz said:
You can only access the camera from the photo Chooser task
Click to expand...
Click to collapse
Using the official SDK APIs yes, but I'm talking about Microsoft.Phone.Media.Extended.dll
There are more methods inside of this dll than is normally available to developers.
Have you granted yourself the necessary permissions? You need to add ID_CAP_CAMERA to gain access to the PhotoCamera class.
kaspur said:
I'm attempting to access the camera and its features through Microsoft.Phone.Media.Extended.dll, but am only coming up with COM errors. Any help would be appreciated.
Click to expand...
Click to collapse
How did you get it load to solution? I getting error:
Code:
Could not load file or assembly 'Microsoft.Phone.Media.Extended, Version=7.0.0.0, Culture=neutral, PublicKeyToken=24eec0d8c86cda1e' or one of its dependencies. Strong name validation failed. (Exception from HRESULT: 0x8013141A)
You need to get the file from phone image. When you got it, you can reference it in your windows phone project.
To allows compiling your project you will need to remove the strong name check on media.extended.dll (in a visual studio command prompt sn -Vr pathto.dll)
Restart Visual Studio and you should be able to build your project
sn -Vr just whitelists the assembly on your PC. Why are your assemblies broken to begin with? All my GAC libraries work without errors (when referencing them). I suggest you work on extracting clean files.
With regards to COM -- what are the exceptions?
titaye said:
You need to get the file from phone image. When you got it, you can reference it in your windows phone project.
To allows compiling your project you will need to remove the strong name check on media.extended.dll (in a visual studio command prompt sn -Vr pathto.dll)
Restart Visual Studio and you should be able to build your project
Click to expand...
Click to collapse
Thanks! I remove a strong name (now I have no exceptions at design time) but the app doesn't load. Stack trace:
Code:
'taskhost.exe' (Managed): Loaded 'mscorlib.dll'
'taskhost.exe' (Managed): Loaded 'System.Windows.RuntimeHost.dll'
'taskhost.exe' (Managed): Loaded 'System.dll'
'taskhost.exe' (Managed): Loaded 'System.Windows.dll'
'taskhost.exe' (Managed): Loaded 'System.Core.dll'
'taskhost.exe' (Managed): Loaded 'System.Xml.dll'
'taskhost.exe' (Managed): Loaded '\Applications\Install\AF30D7A5-21BB-480F-94CC-658A0DCE171A\Install\CameraTest.dll', Symbols loaded.
'taskhost.exe' (Managed): Loaded 'Microsoft.Phone.Media.Extended.dll'
'taskhost.exe' (Managed): Loaded 'System.SR.dll'
The thread '<No Name>' (0x166f19be) has exited with code 0 (0x0).
The thread '<No Name>' (0xecf0ade) has exited with code 0 (0x0).
The program '[371728818] taskhost.exe: Managed' has exited with code 0 (0x0).
I've already added <Capability Name="ID_CAP_CAMERA"/>, no luck. Seems like I'm missing some important part. Unfortunately guys who already had camera working doesn't like to share experience with community...
WithinRafael said:
sn -Vr just whitelists the assembly on your PC. Why are your assemblies broken to begin with? All my GAC libraries work without errors (when referencing them). I suggest you work on extracting clean files.
Click to expand...
Click to collapse
Could you please post your dll's, test project and some instructions? I'm really curious to get video camera working.
I'm able to get this working. The trick seems to be to create a CameraVisualizer, and then SetSource to your camera object. The camera is then shown in the CameraVisualizer. (This is as far as I've got)
Here's a sample: dl.dropbox.com/u/12359/Flashlight.zip
You'll need to follow the instructions here to add Microsoft.Phone.Media.Extended: thounsell.co.uk/2010/11/avoiding-reflection-adding-the-interopservices-library-to-the-wp7-sdk/
Thank you, perfect, get it works!
sensboston said:
Thank you, perfect, get it works!
Click to expand...
Click to collapse
microsoft boots it after a zune sync...tells you to uninstall it... any ideas?
kawgirlval69 said:
microsoft boots it after a zune sync...tells you to uninstall it... any ideas?
Click to expand...
Click to collapse
run the unlocker again and it will work again .
ya.. thanks... found that out... was looking for a more "permanent" fix... still the nicest and most functional flashlight... better than that white screen crap hands down.. even having to reunlock every time..
kawgirlval69 said:
still the nicest and most functional flashlight...
Click to expand...
Click to collapse
Thanks, but it's not so functional and a little buggy (was written in couple of hours, just for academic purposes). HTC have a real nice flashlight, cool looking and functional but runs on HTC handsets only... They directly (probably using native code calls) manipulating LED.
Will see, may be in future we'll have more expanded API (I hope so!)...
Just a note, in case you didn't notice, or other people don't know, that we're leaking videos when using this as a flashlight. I'm pretty sure that videos and thumbnails are created in IsolatedStorage for the application. Uninstall/reinstall should clear them, but we should really delete them as soon as they're created. It'd be nice if there was an API that didn't actually record, but we'd need to see whats in PhotoLibEnt.dll to figure that out.
sensboston said:
Thanks, but it's not so functional and a little buggy (was written in couple of hours, just for academic purposes). HTC have a real nice flashlight, cool looking and functional but runs on HTC handsets only... They directly (probably using native code calls) manipulating LED.
Will see, may be in future we'll have more expanded API (I hope so!)...
Click to expand...
Click to collapse
lol i guess im not picky... it would be fine for me ... again only dislike is the having to reunlock after a zune sync... the other glitches are minor to me.. i mean it does whats needed... you tap..it opens..tap on it comes... tap off it goes.. that = functional to me... the cert thing is all i see bad..
You don't need to reinstall the applications each sync. Just re-unlock it before opening the apps, and if you've already opened the dialog to be greeted with the prompt to uninstall - just hit the Windows Key to cancel and go back to the Start screen.
sensboston said:
Thank you, perfect, get it works!
Click to expand...
Click to collapse
excellent! Thanks so much!
titaye said:
You need to get the file from phone image. When you got it, you can reference it in your windows phone project.
To allows compiling your project you will need to remove the strong name check on media.extended.dll (in a visual studio command prompt sn -Vr pathto.dll)
Restart Visual Studio and you should be able to build your project
Click to expand...
Click to collapse
Where I can find a visual studio command prompt in Express 2010 for Windows Phone?

[Q] VPN SSL AnyConnect on Froyo FRX07

Hello
I try to install Cisco AnyConnect on my Touch Pro (FRX07)
but when it start, I have error: failed to connect to VPN service.
Can you say me if you can run it, and how?
I want diag my problem, but log are not very explicite
Thank's for your help
I join the apk I use.
and my debug log
seems it's buz the bundle still not supports VPN
likounin said:
seems it's buz the bundle still not supports VPN
Click to expand...
Click to collapse
We've never supported VPN's. If there's some way to make them work, we will gladly implement the code. As always, patches welcome.
arrrghhh said:
We've never supported VPN's. If there's some way to make them work, we will gladly implement the code. As always, patches welcome.
Click to expand...
Click to collapse
ok, thank's. I understand now.
I am new on Android, but I known Linux
What patch may we do? kernel, daemon, ...
ejantzen said:
ok, thank's. I understand now.
I am new on Android, but I known Linux
What patch may we do? kernel, daemon, ...
Click to expand...
Click to collapse
First, if I knew it would already be patched lol. Second, I don't have any VPN to test with - so you're going to have to tell us what needs patched. It seems like a userland issue, but I honestly don't know. Perhas some kernel module is missing? Again, I don't know for sure. I don't have any way to test it, and I think that's the problem most have - they have no way of testing VPN, and I think most probably use OpenVPN if it's in their home. At work, it's probably mostly PPTP.
So if you find something to patch, please submit it. If you can't... well then we just won't be able to support VPN's. Pretty minor feature, but I'm sure it would be nice for some.
arrrghhh said:
It seems like a userland issue, but I honestly don't know. Perhas some kernel module is missing? Again, I don't know for sure.
Click to expand...
Click to collapse
ok, thank's
but on the debig file, we can't see where is the problem?
ejantzen said:
ok, thank's
but on the debig file, we can't see where is the problem?
Click to expand...
Click to collapse
If by "we" you mean me, no. I'm no expert on the matter of deciphering logs and determining what exactly needs to be fixed. I can usually pinpoint problems, but pinpointing exactly which element needs fixing... I'm pretty new to.
In my horrible estimation, these three lines are where it starts going badly:
Code:
09-04 10:27:28.770 I/vpnagent( 1847): Function: scanAvailableModule File: PluginLoader.cpp Line: 745 Scanning plugin libvpncommoncrypt.so
09-04 10:27:28.770 W/vpnagent( 1847): Function: STGetProcAddress File: HModuleMgr.cpp Line: 263 Invoked Function: dlsym Return Code: 0 (0x00000000) Description: Symbol not found:
09-04 10:27:28.770 E/vpnagent( 1847): Function: scanAvailableModule File: PluginLoader.cpp Line: 783 Invoked Function: CHModuleMgr::STGetProcAddress Return Code: -33554427 (0xFE000005) Description: GLOBAL_ERROR_NULL_POINTER
The "Scanning plugin libvpncommoncrypt.so" portion really interests me. Does this lib exist? Have you been able to find perhaps another version of it? I know very little about VPN's... never had the desire to use one on a phone. I don't even use 'em on computers really... my office has a VPN that requires a PC, and is far from a 'traditional' VPN.
Looking further thru the log, it seems the app is just going thru libs. It would appear we're either missing these libs, or the libs we have aren't playing nicely. I keep seeing the same "Symbol not found" errors... I'm betting we simply don't have the right libs for this type of VPN app.
thank's
I will try in this direction.

[APPX][v1.3] Reboot app

Built for Windows 10
USAGE:
Start app. Phone should reboot.
INSTALL:
Download latest Reboot_x.x.x.x_ARM.appx.zip & extract it.
Tap the appx in File Explorer app on phone & confirm trust. It should install
If it doesn't, try installing the dependencies first (extract zip and tap the appx:es)
CHANGELOG:
1.0 First release
1.1 Localization for: es, fr
1.2 Localization for: de it pt
1.3 Now rebooting using NRPC from Interop Tools
CAPABILITIES v1.3:
id_cap_oem_custom
SOURCE v1.3:
Code:
using Windows.UI.Xaml;
using ndtklib;
namespace RebootApp
{
sealed partial class App : Application
{
public App()
{
NRPC rpc = new NRPC();
rpc.Initialize();
rpc.SystemReboot();
Exit();
}
}
}
OLD VERSION 1.2 DETAILS:
CAPABILITIES v1.2:
ID_CAP_DIAGNOSTIC_CLIENT
ID_CAP_INTEROPSERVICES
SOURCE v1.2:
Code:
using Windows.UI.Xaml;
using System.Runtime.InteropServices;
namespace RebootApp
{
sealed partial class App : Application
{
public App()
{
Reboot();
}
[DllImport("FlightingClientDll.dll")]
public static extern int Reboot();
}
}
Thank you so much for your app. It works beautifully. I've been searching for something similar for ages. It's incredible that the only way to reboot a phone must be turning it off and on again.
I have two questions though. Is the result of this reboot similar to a soft reset (rebooting with physical keys) or just a turning off + turning on?
And the second question, could you localize the name of the app to a few languages? I'm not sure if that's a lot of work, but it would sure fit better with my other apps in Spanish.
Just nitpicking anyway, thanks again!
@epraes, I'm happy to hear it's working for you and that you like it!
epraes said:
I have two questions though. Is the result of this reboot similar to a soft reset (rebooting with physical keys) or just a turning off + turning on?
Click to expand...
Click to collapse
This app calls the Reboot() method of a library used by the Windows Insider app. If and how it differs from other ways to do it, I don't know.
epraes said:
And the second question, could you localize the name of the app to a few languages? I'm not sure if that's a lot of work, but it would sure fit better with my other apps in Spanish.
Click to expand...
Click to collapse
Sure! What do you want to see in the app list in Spanish (and in any other languages you speak)?
Thanks! It's just having "Reiniciar" instead of "Reboot" for the Spanish locale.
In french "Redémarrer"
Thanks
@epraes @titi66200 Try new version!
BTW can anyone confirm it's working on a non-Lumia phone?
Thank you for the great app. Works without any problem on Nokia 820 with 10.586.218.
Thanks again! Now it's "Reiniciar" as it should be
I suppose it's not very useful to say this, but it's working on a 640XL DS. No idea about non-Lumia phones, though.
Work perfectly without the dependencies on Lumia 1520 RM-937. Thanks a lot for the great app, this is the good app that can prolong the wear and tear on the power switch...
I get an error when trying to deploy to build 14328 (redstone)
Error - There is an error in XML document (2, 2).
@qzem, it's a Windows 10 UWP app, so try installing it by tapping the appx in the File Explorer app on your phone.
(If you want to install from PC you can use the Device Portal in web browser or WinAppDeployCmd.exe from command line.)
winphouser said:
@qzem, it's a Windows 10 UWP app, so try installing it by tapping the appx in the File Explorer app on your phone.
(If you want to install from PC you can use the Device Portal in web browser or WinAppDeployCmd.exe from command line.)
Click to expand...
Click to collapse
Thanks it worked. I installed it now directly from phone.
qzem said:
I get an error when trying to deploy to build 14328 (redstone)
Error - There is an error in XML document (2, 2).
Click to expand...
Click to collapse
Same error to me.
Please read before posting
winphouser said:
@qzem, it's a Windows 10 UWP app, so try installing it by tapping the appx in the File Explorer app on your phone.
(If you want to install from PC you can use the Device Portal in web browser or WinAppDeployCmd.exe from command line.)
Click to expand...
Click to collapse
In german : "Neustart"
thanks
Tks, make this shutdown and reboot pls
"Riavvia" in italian
"Reiniciar" in pt-BR pls
@LeonMobile @ADeltaX @denisf1981 New version adds: de, it, pt!
@denisf1981 I don't know a "power off" method..
winphouser said:
@LeonMobile @ADeltaX @denisf1981 New version adds: de, it, pt!
@denisf1981 I don't know a "power off" method..
Click to expand...
Click to collapse
thanks bro

Categories

Resources