PDA

View Full Version : TuT to make prank in visual basic 2008



HazXod3d
09-30-2009, 04:35 PM
Bored?! then I have the right TuT for you i will make simple prank in visual basic 2008.
i will make 2 pranks. the first is to minimize all the programs every 10 sec or something... you deside. the secound is to open/close the cd/dvd - tray ^^

first start up visual basic 2008, make a new project windows forms application.

http://img169.imageshack.us/img169/8035/newproject.jpg

now add:

4 buttons
2 groupboxes
2 timers

make it look like this:
http://img42.imageshack.us/img42/4005/form1x.jpg

now we can start coding ^^

first i must tell you i will make you one part that you only need to press a button and the timers will do the rest(minimize & open/close the tray) and then the other part will you open/close, minimize manually.

we start with the manually part go on open tray button and dubble click.

Now in the code event type the following text:

setTrayStatus = mciSendString("Set CDAudio Door Open", Nothing, 0, 0)

and in the close button :

setTrayStatus = mciSendString("Set CDAudio Door Closed", Nothing, 0, 0)

now add below Public Class form1
and before the first event:

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

now it will look something like this:
http://img42.imageshack.us/img42/8913/code1u.jpg



start to dubbel click the minimize button at the form adn add this in the event:
keybd_event(VK_LWIN, 0, 0, 0)
keybd_event(77, 0, 0, 0)
keybd_event(VK_LWIN, 0, KEYEVENTF_KEYUP, 0)

now below the Public Class Form1 add this part
Private Declare Sub keybd_event Lib "user32" (ByVal bVk As Byte, ByVal bScan As Byte, _
ByVal dwFlags As Long, ByVal dwExtraInfo As Long)
Private Const KEYEVENTF_KEYUP = &H2
Private Const VK_LWIN = &H5B

now it will look like this:
http://img98.imageshack.us/img98/8498/code2k.jpg



And now we only a propertly application now we will make it more advance by adding timers also you rember the Use timer for...? yea now dubbelclick it and add the following code:

Button1.Enabled = False
Button2.Enabled = False
Button4.Enabled = False

Timer1.Start()
minimizer.Start()

now goto timer1 and dubbelclick it type this:

If setTrayStatus = mciSendString("Set CDAudio Door Closed", Nothing, 0, 0) Then
setTrayStatus = mciSendString("Set CDAudio Door Open", Nothing, 0, 0)
ElseIf setTrayStatus = mciSendString("Set CDAudio Door Open", Nothing, 0, 0) Then
setTrayStatus = mciSendString("Set CDAudio Door Closed", Nothing, 0, 0)
End If

now at the timer2(minimizer) type this:

keybd_event(VK_LWIN, 0, 0, 0)
keybd_event(77, 0, 0, 0)
keybd_event(VK_LWIN, 0, KEYEVENTF_KEYUP, 0)

and now it would look like this:
http://img246.imageshack.us/img246/6240/codeall.jpg



now you can change the timers interval. if you have like less then 1000 millisecound (1 sec) you cant do a thing i like 5 - 10 sec at the open close tray timer have the interval at like 5 sec or something so you dont overload the program so it crashes.

WarLord
09-30-2009, 04:40 PM
UHM....LET ME TRY TO DO THIS ONE :D it looks fun!
don't understand =.= is this c++?
how to make a box???? help =.=

HazXod3d
09-30-2009, 04:43 PM
UHM....LET ME TRY TO DO THIS ONE :D it looks fun!

i may make tut for make your programs add in the autorun registry so it starts then you starts the computer ^^ tell me if i should

WarLord
09-30-2009, 04:45 PM
hmmmmm....... can u upload it :D that will be faster for me lol :D

HazXod3d
10-01-2009, 10:13 AM
UHM....LET ME TRY TO DO THIS ONE :D it looks fun!
don't understand =.= is this c++?
how to make a box???? help =.=


is in visual basic 2008. if you meen that the box is the form thats creats then you make a new project> windows forms application

WarLord
10-01-2009, 10:26 AM
u said: now add:

4 buttons
2 groupboxes
2 timers

how? =.=

Zanza
10-01-2009, 11:54 AM
u said: now add:

4 buttons
2 groupboxes
2 timers

how? =.=

some coding expirience.

someguy23
10-01-2009, 02:52 PM
some coding expirience.

Or simply some smarts. The "Toolbox" would be a good place to look linh...