Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Codes related to the system

Status
Not open for further replies.

ameedoo3000

IS-IT--Management
Sep 20, 2016
233
EG
I want to know the codes of the related works
1- Turn on and Turn off monitor
2- Shutdown and Restart the computer
3- play audio or movies files on the form
 
1. I don't know any way of physically switching off a monitor via code. In fact, I feel sure it's not possible.

2. To shutdown and restart the computer, you can use the InitiateShutdown API call. Details here, including FoxPro sample:

3. To play audio or movies on form, drop an OLEContainer control onto the form. In the Insert Object dialogue, choose "Create from File", then browse to the audio or video file that you want to play.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
I want to play the audio or video file with the code
 
1. I agree, you have to rely on todays standard of monitors "going to sleep" when no signal is coming after you shutdown a computer.
2. Mike gave you a solution
3. See the VFP solutions sample 'Play multimedia files using MCI commands'

Chriss
 
I want to play the audio or video file with the code

Yes, I understood that.

Set the control's AutoActivate property to 0. Then, at the point where you want to play the file, execute the the object's DoVerb method, passing 0 as a parameter. This will execute the file's default action, which, for a movie or audio file, is usually "play".

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top