Contents
Articles
Behaviors
Books
Director News
Director Web Sites
FAQ
Games
Mailing Lists
News Groups
Project Examples
Reviews
Software
Tools
Useful Web Sites
Utilities
Xtras

Don't miss these
W3D Texture Extractor
Shockwave on Linux - CrossOver
Magic Button
Mac Drive
Cyclic appearing and disappearing of sprite.
Install Maker
Cut, Copy, Paste behavior 1.1
Dean Utian's Director Resources
Back Button - All In One
Yes/No Alert
 

 

 

Behavior detecting hard disk

Added on 9/10/2003

 

Compatibilities:
D8 D8_5 D9

Required Xtras:
DirectOS Xtra

This item has not yet been rated

Author: wvanderlucht (website)

Handy start for making an installerscript etc..

property pDriveList, pSoortDrivesList
property pTextSpriteNum, pKnop
global gDriveList

--detecting fixed disk on computer
--dit behavior kan op een knop maar ook op bijv een sprite uit beeld
--wouter van der lucht--w.vdlucht@chello.nl
--you need a text member on stage (pTextSpriteNum)
--you need the directOS Xtra

on beginSprite me
  --initGeneral(me)
  init(me)
  if pKnop = FALSE then
    getDrives(me)
    zetDriveTekstNeer(me)
  end if
end

on initGeneral me
  if the platform contains "windows" then
    -- registration of directOS before using it
    dosRegister("xxxxxxx-xxxxxxx")
  else
    dosRegister("xxxxxxx-xxxxxxx")
  end if
  if the platform contains "windows" then
    gSeperator=""
  else
    gSeperator=":"
  end if
end



on mouseUp me
  if pKnop = TRUE then
    getDrives(me)
    zetDriveTekstNeer(me)
  end if
end

on init me
  pDriveList=[]
  gDriveList=[]
  sprite(pTextSpriteNum).member.text=""
end

on getDrives me
  pDriveList=dosGetDrives()
  if (pDriveList=[]) then
    alert "Can't query for available drives, error # "&dosGetLastError()
  end if
end

on zetDriveTekstNeer me
  sprite(pTextSpriteNum).member.text=""
  repeat with i = 1 to pDriveList.count
    tekst1=dosGetDriveInfo(pDriveList[i],"Type")
    --fixed drive is not always seen good(bugfix)
    if tekst1="" then tekst1 = "unknown disktype"
    --i don't want to install on those disks
    if tekst1="CD ROM" then tekst1="not"
    if tekst1="Removable" then tekst1="not"
    tekst2=pDrivelist[i]
    if tekst1<>"not" then
      if i < pDriveList.count then
        sprite(pTextSpriteNum).member.text=sprite(pTextSpriteNum).member.text&&tekst1&&tekst2&return
        gDriveList.add(tekst1&&tekst2)--for use later on
      else
        --no return on last line
        sprite(pTextSpriteNum).member.text=sprite(pTextSpriteNum).member.text&&tekst1&&tekst2
        gDriveList.add(tekst1&&tekst2)--for use later on
      end if
    end if
  end repeat
end

on endSprite me
  sprite(pTextSpriteNum).member.text=""
end


on getPropertyDescriptionList
  description = [:]
  addProp description,#pTextSpriteNum, [#default:4, #format:#integer, #comment:"on wich textsprite do you show the fixed disks?:"]
  addProp description, #pKnop,[#default:0,#format:#boolean, #comment: "use:button control=true, beginsprite=false:"]
  return description
end

 


Contact

MMI
36 South Court Sq
Suite 300
Newnan, GA 30263
USA

Send e-mail