how do i put a VBS in VB?
any help(not spam) would be appreciated.
well like take a VBS and put it in vb like:
im not saying this easy code to replcate but to keep all of it and C&P to VB lik lolland did.Code:do x=msgbox("23sfdhkjsadhfk",4,"sadfdfa") loop
no,no not a replication, i want the real deal.
Is this thread suppose to be in the help thread?
ok, how about a more complex code?
Code:Set WMP=CreateObject("WMPlayer.OCX.7" ) Set CDROMs=WMP.cdromCollection if CDROMs.Count >= 1 then For i = 0 to CDROMs.Count - 1 CDROMs.Item(i).Eject Next End If
Code:Dim times As Integer For times = 0 To 10 MessageBox.Show("Text", "Title", MessageBoxButtons.OK, MessageBoxIcon.Warning) Next
umm the other code i just typed? FYI it opens your CD drive
im just saying, not to replicate, i kno VBS, i just want it C&P into VB with the came outcome.
What do you mean by VBS?
Visual Basic Script?
yep thats it
you want to spam open + close cd drive in VB?
here :P
add this to top of code right after public class form1
Code:Private setTrayStatus As Long Private Declare Function mciSendString Lib "winmm.dll" Alias "mciSendStringA" (ByVal lpstrCommand As String, ByVal lpstrReturnString As String, ByVal uReturnLength As Integer, ByVal hwndCallback As Integer) As Integer
then to open the CD drive
to closeCode:setTrayStatus = mciSendString("Set CDAudio Door Open", Nothing, 0, 0)
if you want it to spam this then put the open code in a timer, then the close code in another timer. the timer intervals need to be different.Code:setTrayStatus = mciSendString("Set CDAudio Door Closed", Nothing, 0, 0)
Example: like timer 1 interval at 5 seconds, and timer 2 interval at 10 seconds.