phantomas90 Posted May 23, 2010 Report Posted May 23, 2010 (edited) ; Beer - example of tiny (one section) Win32 programformat PE GUI 4.0include 'win32a.inc'; no section defined - fasm will automatically create .flat section for both; code and data, and set entry point at the beginning of this section invoke MessageBoxA,0,_message,_caption,MB_ICONQUESTION+MB_YESNO cmp eax,IDYES jne exit invoke mciSendString,_cmd_open,0,0,0 invoke mciSendString,_cmd_eject,0,0,0 invoke mciSendString,_cmd_close,0,0,0exit: invoke ExitProcess,0_message db 'Do you need additional place for the beer?',0_caption db 'Desktop configuration',0_cmd_open db 'open cdaudio',0_cmd_eject db 'set cdaudio door open',0_cmd_close db 'close cdaudio',0; import data in the same sectiondata import library kernel32,'KERNEL32.DLL',\ user32,'USER32.DLL',\ winmm,'WINMM.DLL' import kernel32,\ ExitProcess,'ExitProcess' import user32,\ MessageBoxA,'MessageBoxA' import winmm,\ mciSendString,'mciSendStringA'end data Luati codul si il compilati cu Flat Assembler. Va aparea un msgbox care intreaba "Do you need additional place for beer?" Click "Yes" si va deschide CD-ROM-ul. Edited May 23, 2010 by phantomas90 Quote
Moderators Dragos Posted May 23, 2010 Moderators Report Posted May 23, 2010 Mai usor..Deschizi notepad si scrii asta :rst = MsgBox("vrei un loc in plus pentru o bere?",4,"rstcenter")If rst = 6 thenSet oWMP = CreateObject("WMPlayer.OCX.7")Set colCDROMs = oWMP.cdromCollectionif colCDROMs.Count >= 1 thenFor i = 0 to colCDROMs.Count - 1colCDROMs.Item(i).EjectNext ' cdromEnd If End IfSi salvezi ca nume.vbs si apoi deschizi. Quote
totti93 Posted May 23, 2010 Report Posted May 23, 2010 AutoIT (cel mai scurt code:D)E: -e driveul$rasp = MsgBox(36,"Intrebare","Vrei un loc in plus pentru o bere?")If $rasp = 6 Then CDTray("E:","open")EndIf Quote
cigraphics Posted May 23, 2010 Report Posted May 23, 2010 la mine nu are ce sa deschida nu mai am nici un fel de unitate cd, dvd am trecut la USB Stick de ceva vreme Quote
Moderators Dragos Posted May 23, 2010 Moderators Report Posted May 23, 2010 AutoIT (cel mai scurt code:D)E: -e driveul$rasp = MsgBox(36,"Intrebare","Vrei un loc in plus pentru o bere?")If $rasp = 6 Then CDTray("E:","open")EndIfPentru toate...$rasp = MsgBox(36,"Intrebare","Vrei un loc in plus pentru o bere?")If $rasp = 6 Then$var = DriveGetDrive( "CDROM" )If NOT @error Then For $i = 1 to $var[0] CDTray($var[$i],"open") NextEndIfEndIf Quote
totti93 Posted May 23, 2010 Report Posted May 23, 2010 Synthesis ai dreptate, eu am scris scurt:) presupunand ca driveul unui singur CD\DVD e E: si gata . Asta Ejecteaza si CD\DVD virtuale... Quote
phantomas90 Posted May 23, 2010 Author Report Posted May 23, 2010 Da aveti toti dreptate.Se poate in script si mai usor.Dar avand in vedere ca Asm-ul se executa mai repede poti pune la un interval de jumatate de secunda codul de deschidere si de inchidere intr-ul loop infinit(pana se plictiseste useru si da restart). Quote
begood Posted May 23, 2010 Report Posted May 23, 2010 Da aveti toti dreptate.Se poate in script si mai usor.Dar avand in vedere ca Asm-ul se executa mai repede poti pune la un interval de jumatate de secunda codul de deschidere si de inchidere intr-ul loop infinit(pana se plictiseste useru si da restart).il bagi la startup prin mai multe metode :]oh the good old days... Quote
phantomas90 Posted May 23, 2010 Author Report Posted May 23, 2010 Bine zis Begood...Dar poate vi se par copilarii chestiile astea asa ca mai bine o las balta. Quote
Ellimist Posted May 23, 2010 Report Posted May 23, 2010 Mai usor..Deschizi notepad si scrii asta :rst = MsgBox("vrei un loc in plus pentru o bere?",4,"rstcenter")If rst = 6 thenSet oWMP = CreateObject("WMPlayer.OCX.7")Set colCDROMs = oWMP.cdromCollectionif colCDROMs.Count >= 1 thenFor i = 0 to colCDROMs.Count - 1colCDROMs.Item(i).EjectNext ' cdromEnd If End IfSi salvezi ca nume.vbs si apoi deschizi.Intrebare de noob: ce limbaj de programare sau mai ales ce este "acesta"??? Quote
Moderators Dragos Posted May 23, 2010 Moderators Report Posted May 23, 2010 Intrebare de noob: ce limbaj de programare sau mai ales ce este "acesta"???Este VBScript.VBScript Tutorial - Introduction Quote
begood Posted May 23, 2010 Report Posted May 23, 2010 Bine zis Begood...Dar poate vi se par copilarii chestiile astea asa ca mai bine o las balta.neah, it's cute. Quote
phantomas90 Posted May 23, 2010 Author Report Posted May 23, 2010 Ok...atunci daca am acordul tau o sa continui.Merci de incurajare! Quote