Indigo Rose Software

Professional Software Development Tools

 
Results 1 to 1 of 1
  1. #1
    Join Date
    Apr 2007
    Posts
    3

    Lightbulb Making a Play DVD button for version 6.0

    ok.....
    I was putting together advertising for websites to be added to our DVD for our magazine. We wanted to make the program as "dummy proofed" as possible.
    so we wanted a button that took you from the auto run file and opened up the default software.

    Now I did find some snip-its of code for doing this under version 4.0. Now I ran up against rewriting the code.
    For your pleasure here is the new version of that code as i finished slapping it together

    I'm sure some of you scripting junkies can easily come up with a more robust but equally effective script.
    Refine the script below as you need and past in your post if you want.

    Code:
    --Get the software info from the registery
    DVDKEY = Registry.GetValue(HKEY_CLASSES_ROOT, "DVD\\shell", "", true);
    DVDPATH = Registry.GetValue(HKEY_CLASSES_ROOT, "DVD\\shell\\"..DVDKEY.."\\command", "", true);
    
    --Change the source drive
    DVDPATH = String.Replace(DVDPATH, "%L", _SourceDrive, false);
    DVDPATH = String.Replace(DVDPATH, "%1", _SourceDrive, false);
    
    --Split the DVDPATH string and ready it for running
    ENDOFDVDSOFTWARE = String.Find(DVDPATH, "\" ", 1, false);
    RIGHTSIDEARGUMENTS = String.Length(DVDPATH);
    RIGHTSIDEARGUMENTS = RIGHTSIDEARGUMENTS - ENDOFDVDSOFTWARE;
    DVDPROGRAM = String.Left(DVDPATH, ENDOFDVDSOFTWARE);
    ARGUMENTS = String.Right(DVDPATH, RIGHTSIDEARGUMENTS);
    ARGUMENTS = String.Replace(ARGUMENTS, "\"", "", false);
    ENDOFDVDSOFTWARE = ENDOFDVDSOFTWARE - 1;
    DVDPROGRAM = String.Left(DVDPROGRAM, ENDOFDVDSOFTWARE);
    ENDOFDVDSOFTWARE = ENDOFDVDSOFTWARE - 1;
    DVDPROGRAM = String.Right(DVDPROGRAM, ENDOFDVDSOFTWARE);
    ARGUMENTSLENGTH = String.Length(ARGUMENTS);
    ARGUMENTSLENGTH = ARGUMENTSLENGTH - 1;
    ARGUMENTS = String.Right(ARGUMENTS, ARGUMENTSLENGTH);
    
    
    --test code for testing contents of the strings
    --Result = Dialog.Message("Title", "DVDKEY = "..DVDKEY.." DVDPATH ="..DVDPATH, Ok, Question)
    --Result = Dialog.Message("Title", "DVDPROGRAM"..DVDPROGRAM, Ok, Question)
    --Result = Dialog.Message("Title", "ARGUMENTS"..ARGUMENTS, Ok, Question)
    
    
    --If there is no software installed it will error out
    if ((DVDKEY == "") or (DVDKEY == "\"\"") or (DVDPATH == "") or (DVDPATH == "\"\""))
    then
    Result = Dialog.Message("Could not find DVD Player Program", "This computer does not have DVD video software loaded.", Ok, MB_ICONEXCLAMATION);
    
    --If there is software installed it will start the DVD software and shut down the auto run pages
    else
    result = File.Run(DVDPROGRAM, ARGUMENTS, "", SW_MAXIMIZE, false);
    Application.Exit();
    end
    For use in the scripting on version 6.0
    Last edited by MideanTsukasa; 04-20-2007 at 01:47 PM. Reason: more to add to thoughts

Similar Threads

  1. Need audio play button that stays "highlighted"
    By Ed Stanley in forum AutoPlay Media Studio 6.0
    Replies: 9
    Last Post: 04-07-2007, 04:30 PM
  2. button play and stop
    By white sky in forum AutoPlay Media Studio 5.0
    Replies: 11
    Last Post: 10-25-2005, 04:41 PM
  3. Button to play audio cd
    By Friendly User in forum AutoPlay Media Studio 6.0
    Replies: 1
    Last Post: 10-03-2005, 12:25 AM
  4. Example: Creating an on/off button to toggle background audio
    By Jonas DK in forum AutoPlay Media Studio 5.0 Examples
    Replies: 0
    Last Post: 07-10-2004, 02:54 PM
  5. play flash file with click of a button HELP
    By Jaymz in forum AutoPlay Media Studio 4.0
    Replies: 3
    Last Post: 03-19-2004, 09:04 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts