Okay, so here's the challenge. I want a continously running program that will automatically close all running programs, log off the user account and shut down the computer when the batterly life of my laptop reaches a certain amount. First of all, can that be done with visual basic and second of all, how would it be done?
sk8ndestroy14 294 Posting Virtuoso
Recommended Answers
Jump to PostYou need to use the SysInfo Control. It has properties for ACStatuse, BatteryFullTime, BatteryLifePercent, BatteryLifeTime, and BatteryStatus. It will also tell you when the power status changes, among many other things.
Jump to Post'5 command buttons: 'cmdRestart; cmdLogOff; cmdForceLogOff; cmdShutdown; cmdForceShutdown Option Explicit Private Const EWX_LogOff As Long = 0 Private Const EWX_SHUTDOWN As Long = 1 Private Const EWX_REBOOT As Long = 2 Private Const EWX_FORCE As Long = 4 Private Const EWX_POWEROFF As Long = 8 Private Declare …
All 8 Replies
sk8ndestroy14 294 Posting Virtuoso
cld~dotdot 0 Newbie Poster
sk8ndestroy14 294 Posting Virtuoso
SCBWV 71 Junior Poster
enigmatic24 0 Newbie Poster
cometburn 2 Junior Poster
technogeek_42 -20 Posting Whiz in Training
Jx_Man 987 Nearly a Senior Poster Featured Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.