Download the free trial version
Basic4android Video
Features
Tutorials and manuals
Showcase
Screenshots

Go Back   Android Development Forum - Basic4android > Basic4ppc (Windows Mobile) > Code Samples & Tips > Additional Libraries
Documentation Wiki Register Members List B4P Search Today's Posts Mark Forums Read

Additional Libraries Users contributed libraries.
This sub-forum is only available to licensed users.

PowerNotify Beta

Reply
 
LinkBack Thread Tools Display Modes
  #21 (permalink)  
Old 09-01-2010, 05:00 PM
Junior Member
 
Join Date: Mar 2010
Posts: 28
Default Problem using PwerNotify.DLL

I have an issue when using PwerNotify.DLL, I have used it to show the battery status in my app, it worked with no problems, the only issue I have noticed is: when my app is running; if I try to terminate it via task manager the device will get stock (the screen and hardware bottoms will be unresponsive) therefore device soft reset is required.

If I keep my application exactly the same, but just remove the battery status and not use the PwerNotify.DLL library, then my application has no issues when trying to terminate it via task manager

The code, which I used to get the battery status:
=======================================
Sub App_Start
pwr.New1
pwr.Start
End Sub



Sub Form1_Close
pwr.Stop
End Sub



Sub pwr_Battery

ImageButton1.Text = pwr.BatteryPercent & " %"

End Sub
========================================
Can any body help me with this regard?

Thank you all
Reply With Quote
  #22 (permalink)  
Old 09-01-2010, 05:15 PM
Basic4ppc Veteran
 
Join Date: May 2008
Location: Newcastle Upon Tyne - England
Posts: 271
Awards Showcase
Beta Tester 
Total Awards: 1
Default

In your Sub Form1_Close; try adding a pwr.Dispose after the pwr.Stop.

Also, have a look at Power Status by Andrew Graham.

Last edited by Zenerdiode : 09-01-2010 at 05:23 PM.
Reply With Quote
  #23 (permalink)  
Old 09-07-2010, 07:39 PM
Junior Member
 
Join Date: Sep 2007
Posts: 18
Default Formless?

Hi,

Mabey a stupid question, but can this be used with a formless project?

I need to monitor the AcLineStatus but don't want a form or anyhing, all I need to do is change some registry settings.

TIA,

Kind regards,
Cactus
Reply With Quote
  #24 (permalink)  
Old 09-08-2010, 08:06 PM
Junior Member
 
Join Date: Sep 2007
Posts: 18
Default

K,

Not trying to bumb or anything (or do I?) but a closed main form would do to

TIA,
Cactus
Reply With Quote
  #25 (permalink)  
Old 09-09-2010, 08:43 AM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 6,072
Awards Showcase
Innovator medal Beta Tester Forum Contributer 
Total Awards: 3
Default

You cannot have a Formless Basic4ppc program. App_Start will terminate the program when it returns unless there is a Form present to run the application message loop. I think some people have achieved something similar to what you want by making the Form not visible but I haven't played with that myself. Doing that sort of thing you risk losing control of the application and needing to reboot in order to kill it.
__________________
Sorry, but I don't answer questions by PM or email.
Please post your queries in the forum.
Reply With Quote
  #26 (permalink)  
Old 09-09-2010, 05:34 PM
Junior Member
 
Join Date: Sep 2007
Posts: 18
Default

Hi,

I tried to run a loop with a wait statement after closing the form. The program still ran, but the events (or at least the messagbox I let it popup) didn't show up.

Is that normal? Are events always bound to a form?

TIA,
Cactus
Reply With Quote
  #27 (permalink)  
Old 09-09-2010, 05:39 PM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 6,072
Awards Showcase
Innovator medal Beta Tester Forum Contributer 
Total Awards: 3
Default

Without a message loop you won't get any events as they are passed as windows messages.
__________________
Sorry, but I don't answer questions by PM or email.
Please post your queries in the forum.
Reply With Quote
  #28 (permalink)  
Old 09-09-2010, 10:51 PM
Junior Member
 
Join Date: Sep 2007
Posts: 18
Default

Hi,

Maybe there are better ways (if someone knows please let me know) but I'm using sitajony's splashscreen example now, and with an added endless loop I now have a formless AcLineStatus event driven application. It run's in the background and does exactly what I want.

Thansk for the tips,

Cheers,
Cacti
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Beta testers medal Erel Announcements 0 06-26-2009 02:02 PM
V6.80 released to beta testers Erel Beta Versions 3 06-07-2009 07:55 PM
Beta testers group Erel Announcements 14 04-26-2009 08:38 AM
Basic4ppc V6.80 - first beta is released Erel Announcements 0 04-24-2009 05:58 AM
Beta versions Erel Beta Versions 0 08-26-2008 09:32 PM


All times are GMT. The time now is 06:51 AM.


Powered by vBulletin® Version 3.6.12
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0