Përmbajtje:

Tastiera e kodit Morse: 5 hapa
Tastiera e kodit Morse: 5 hapa

Video: Tastiera e kodit Morse: 5 hapa

Video: Tastiera e kodit Morse: 5 hapa
Video: 🟡 POCO X5 PRO - САМЫЙ ДЕТАЛЬНЫЙ ОБЗОР и ТЕСТЫ 2024, Nëntor
Anonim
Tastiera e kodit Morse
Tastiera e kodit Morse

Ky program ju tregon se si të krijoni një program c ++ që përdor një qasje të regjistruesit të çelësave për të gjetur çelësin që po shtypet dhe të gjenerojë vlerën e kodit Morse përmes përdorimit të dritës së kyçjes së rrotullës në tastierën tuaj (kush e përdor atë?). Ky projekt përbëhet nga 41 programe të ndryshme që gërshetohen dhe ndërveprojnë pa probleme me njëri -tjetrin, duke përkthyer 3 gjuhë midis programeve. Nuk ka shumë fotografi në këtë skedar pasi projekti bazohet tërësisht në kodin e kompjuterit. Për këtë projekt, do t'ju duhet: Një tastierë me një dritë të bllokimit të rrotullimit Notepad Diçka që mund të përpilojë kodin c ++ (kam përdorur CodeBlocks)

Çfarë keni bërë? Bëra një program c ++ që përkthen goditjet e tastit në kodin Morse përmes përdorimit të programeve të shkrimit vb që kam bërë. Si ja dolët? Kam kaluar mjaft kohë duke hulumtuar c ++, kodin Morse dhe shkrimin vb pasi as nuk i dija dhe pas një kohe kisha njohuritë e nevojshme për të bërë këtë program. Kalova disa orë pas hulumtimit për të zhvilluar një program të thjeshtë të shtypjes së tastit dhe më pas bëra disa kërkime më shumë për hapjen e programeve dhe drejtimin e programeve në sfond (i padukshëm). Kam përdorur këto metoda për të krijuar një program c ++ që funksionon pa ndërprerë përdoruesin ose duke zënë hapësirë në ekran (funksionon në sfond). Unë gjithashtu bëra një skedar grumbull që vret programin c ++ kur përdoruesi të jetë përfunduar me të. Ku e keni bërë atë? Unë i bëra këto programe në kompjuterin e familjes në shtëpi, duke gjetur kohë kur anëtarët e tjerë të familjes nuk kishin nevojë të përdornin kompjuterin. Çfarë mësuat? Gjatë këtij projekti, unë mësova shumë 3 gjuhë të reja dhe zhvillova aftësinë për t'i bërë ato gjuhë të "komunikojnë" me njëra -tjetrën. Mësova gjithashtu ndërlikimet që vijnë me gjuhët e ndryshme dhe si të kapërcej gabimet dhe defektet (u detyrova të përdor trurin… për të menduar…).

Hapi 1: Skedarët.vbs (krijimi)

.vbs Skedarë (përmbajtje-shkronja)
.vbs Skedarë (përmbajtje-shkronja)

A.vbs Set wshShell = wscript. CreateObject ("WScript. Shell") wshshell.sendkeys "{SCROLLLOCK}" wscript.sleep 300 wshshell.sendkeys "{SCROLLLOCK}" wscript.sleep 300 wshshell.sendLys "7" fle 900 wshshell.sendkeys "{SCROLLLOCK}" B.vbs Set wshShell = wscript. CreateObject ("WScript. Shell") wshshell.sendkeys "{SCROLLLOCK}" wscript.sleep 900 wshshell.sendkes "{SCROLLLOCOCS" wshshell.sendkeys "{SCROLLLOCK}" wscript.sleep 300 wshshell.sendkeys "{SCROLLLOCK}" wscript.sleep 300 wshshell.sendkeys "{SCROLLLOCK}" wscript.sleep 300 wshshell.sendkesys "{SCROLLLOCK". sendkejt "{SCROLLLOCK}" wscript.sleep 300 wshshell.sendkeys "{SCROLLLOCK}" C.vbs Set wshShell = wscript. CreateObject ("WScript. Shell") wshshell.sendkeys "{SCROLLLOCK} 900" wscript.s " {SCROLLLOCK} "wscript.sleep 300 wshshell.sendkeys" {SCROLLLOCK} "wscript.sleep 300 wshshell.sendkeys" {SCROLLLOCK} "wscript.sleep 300 wshshell.sendkeys" {SCROLLLOCK} 9 "wscript.sleep 00 wshshell.sendkeys "{SCROLLLOCK}" wscript.sleep 300 wshshell.sendkeys "{SCROLLOCK}" wscript.sleep 300 wshshell.sendkeys "{SCROLLLOCK}" D.vbs Set wshShell = wscript. CreateObshShite (".sendkeys "{SCROLLLOCK}" wscript.sleep 900 wshshell.sendkeys "{SCROLLOCK}" wscript.sleep 300 wshshell.sendkeys "{SCROLLLOCK}" wscript.sleep 300 wshshell.sendkeys "{SCROLLLOCK} "{SCROLLLOCK}" wscript.sleep 300 wshshell.sendkeys "{SCROLLLOCK}" E.vbs Set wshShell = wscript. CreateObject ("WScript. Shell") wshshell.sendkeys "{SCROLLLOCK}" wscript.sleep 300 "wscript.sleep" SCROLLLOCK} "F.vbs Set wshShell = wscript. CreateObject (" WScript. Shell ") wshshell.sendkeys" {SCROLLLOCK} "wscript.sleep 300 wshshell.sendkeys" {SCROLLLOCK} "wscript.sleep 300 wshcriptSsll. "wscript.sleep 300 wshshell.sendkeys" {SCROLLLOCK} "wscript.sleep 300 wshshell.sendkeys" {SCROLLLOCK} "wscript.sleep 900 wshshell.sendkeys" {SCROLLLOCK} "wscript.sleep 300 wshshell.send çelësat "{SCROLLLOCK}" wscript.sleep 300 wshshell.sendkeys "{SCROLLLOCK}" G.vbs Set wshShell = wscript. CreateObject ("WScript. Shell") wshshell.sendkeys "{SCROLLSLOCK}" wscript.sleep {SCROLLLOCK} "wscript.sleep 300 wshshell.sendkeys" {SCROLLLOCK} "wscript.sleep 900 wshshell.sendkeys" {SCROLLLOCK} "wscript.sleep 300 wshshell.sendkeys" {SCROLLLOCKK} 300 "wscript.sleep" } "H.vbs Set wshShell = wscript. CreateObject (" WScript. Shell ") wshshell.sendkeys" {SCROLLLOCK} "wscript.sleep 300 wshshell.sendkeys" {SCROLLLOCK} "wscript.sleep 300 wshsheLK {SCLL" {} wscript.sleep 300 wshshell.sendkeys "{SCROLLLOCK}" wscript.sleep 300 wshshell.sendkeys "{SCROLLOCK}" wscript.sleep 300 wshshell.sendkeys "{SCROLLLOCK}" wscript.sleep 300 wshLsKLYSKLYSKLYSKLYSKLYSKLYSKLYSKLYSKLYSKLYSKLYSKLYSKRYSKLYSKLYSKLYSKLYSKLYSKLYSKLYSKLYSKRYSTRIVE fle 300 wshshell.sendkeys "{SCROLLLOCK}" I.vbs Set wshShell = wscript. CreateObject ("WScript. Shell") wshshell.sendkeys "{SCROLLLOCK}" wscript.sleep 300 wshshell.sendkeys "{SCROLLLOCOC" K} "wscript.sleep 300 wshshell.sendkeys" {SCROLLLOCK} "wscript.sleep 300 wshshell.sendkeys" {SCROLLLOCK} "J.vbs Set wshShell = wscript. CreateObject (" WScript. Shell ") wshshell. RONDLys "wscript.sleep 300 wshshell.sendkeys" {SCROLLLOCK} "wscript.sleep 300 wshshell.sendkeys" {SCROLLLOCK} "wscript.sleep 900 wshshell.sendkeys" {SCROLLLOCK} "wscript.sleep 300 wshshell.sendke.sleep 900 wshshell.sendkeys "{SCROLLLOCK}" wscript.sleep 300 wshshell.sendkeys "{SCROLLOCK}" wscript.sleep 900 wshshell.sendkeys "{SCROLLLOCK}" K.vbs Set wshShell = wscript. CreateOb) wshshell.sendkeys "{SCROLLLOCK}" wscript.sleep 900 wshshell.sendkeys "{SCROLLLOCK}" wscript.sleep 300 wshshell.sendkeys "{SCROLLLOCK}" wscript.sleep 300 wshshell.sendkeyssllëk "scroll 300" wROKLLOCK..sendkeys "{SCROLLLOCK}" wscript.sleep 900 wshshell.sendkeys "{SCROLLLOCK}" L.vbs Set wshShell = wscript. CreateObject ("WScript. Shell") wshshell.sendkeys "{SCROLLLOCK}}" wscript f 300 wshshell.sendkeys "{SCROLLLOCK}" wscript.sleep 300 wshshell.sendkeys "{SCROLLOCK}" wscript.sleep 900 wshshell.sendkeys "{SCROLLLOCK}" wscript.sleep 300 wshshell.sendkess "300" wror wshshell.sendkeys "{SCROLLLOCK}" wscript.sleep 300 wshshell.sendkeys "{SCROLLLOCK}" wscript.sleep 300 wshshell.sendkeys "{SCROLLLOCK}" M.vbs Set wshShell = wscript. CreateObshSject (" sendkejt "{SCROLLLOCK}" wscript.sleep 900 wshshell.sendkeys "{SCROLLOCK}" wscript.sleep 300 wshshell.sendkeys "{SCROLLLOCK}" wscript.sleep 900 wshshell.sendkeys "{SCROLLLOCK} wv. CreateObject ("WScript. Shell") wshshell.sendkeys "{SCROLLLOCK}" wscript.sleep 900 wshshell.sendkeys "{SCROLLLOCK}" wscript.sleep 300 wshshell.sendkeys "{SCROLLLOCK}" wscript.sleep 300s wscript.sleep 300 } "Set O.vbs wshShell = wscript. CreateObject (" WScript. Shell ") wshshell.sendkeys" {SCROLLLOCK} "wscript.sleep 900 wshshell.sendkeys" {SCROLLLOCK} "wscript.sleep 300 wshshell.s çelësat fundorë "{SCROLLLOCK}" wscript.sleep 900 wshshell.sendkeys "{SCROLLOCK}" wscript.sleep 300 wshshell.sendkeys "{SCROLLLOCK}" wscript.sleep 900 wshshell.sendkeys "{SCROLLLOCK} wv. CreatObject ("WScript. Shell") wshshell.sendkeys "{SCROLLLOCK}" wscript.sleep 300 wshshell.sendkeys "{SCROLLLOCK}" wscript.sleep 300 wshshell.sendkeys "{SCROLLLOCK}" wscript.sleep 900s wscript.sleep } "wscript.sleep 300 wshshell.sendkeys" {SCROLLLOCK} "wscript.sleep 900 wshshell.sendkeys" {SCROLLLOCK} "wscript.sleep 300 wshshell.sendkeys" {SCROLLLOCK} "wscript.sleep 300 wshshell.send Q.vbs Set wshShell = wscript. CreateObject ("WScript. Shell") wshshell.sendkeys "{SCROLLOCK}" wscript.sleep 900 wshshell.sendkeys "{SCROLLLOCK}" wscript.sleep 300 wshshell.sendLys " fle 900 wshshell.sendkeys "{SCROLLLOCK}" wscript.sleep 300 wshshell.sendkeys "{SCROLLOCK}" wscript.sleep 300 wshshell.sendkeys "{SCROLLLOCK}" wscript.sleep 300 wshshell.sendk eys "{SCROLLLOCK}" wscript.sleep 900 wshshell.sendkeys "{SCROLLLOCK}" R.vbs Set wshShell = wscript. CreateObject ("WScript. Shell") wshshell.sendkeys "{SCROLLLOCK} 300" wscript.sleep " {SCROLLLOCK} "wscript.sleep 300 wshshell.sendkeys" {SCROLLLOCK} "wscript.sleep 900 wshshell.sendkeys" {SCROLLLOCK} "wscript.sleep 300 wshshell.sendkeys" {SCROLLLOCKK} 300 "wscript.s {3 } "Set S.vbs wshShell = wscript. CreateObject (" WScript. Shell ") wshshell.sendkeys" {SCROLLLOCK} "wscript.sleep 300 wshshell.sendkeys" {SCROLLLOCK} "wscript.sleep 300 wshsheLK {SCLL" {} wscript.sleep 300 wshshell.sendkeys "{SCROLLLOCK}" wscript.sleep 300 wshshell.sendkeys "{SCROLLOCK}" wscript.sleep 300 wshshell.sendkeys "{SCROLLLOCK}" T.vbs Set wshShell = wscript. CreS = wscript. CreS = Wscript. CreS ") wshshell.sendkeys" {SCROLLLOCK} "wscript.sleep 900 wshshell.sendkeys" {SCROLLLOCK} "U.vbs Set wshShell = wscript. CreateObject (" WScript. Shell ") wshshell.sendkes". SCROLLLOCKS ". leep 300 wshshell.sendkeys "{SCROLLLOCK}" wscript.sleep 300 wshshell.sendkeys "{SCROLLOCK}" wscript.sleep 300 wshshell.sendkeys "{SCROLLLOCK}" wscript.sleep 300 wshshell.sendkesys "SCRO" 900 " wshshell.sendkeys "{SCROLLLOCK}" V.vbs Set wshShell = wscript. CreateObject ("WScript. Shell") wshshell.sendkeys "{SCROLLLOCK}" wscript.sleep 300 wshshell.sendkeys "{SCROLLLOCK} sendkejt "{SCROLLLOCK}" wscript.sleep 300 wshshell.sendkeys "{SCROLLOCK}" wscript.sleep 300 wshshell.sendkeys "{SCROLLLOCK}" wscript.sleep 300 wshshell.sendkeys "{SCROLLOCOC.} {SCROLLLOCK} "wscript.sleep 900 wshshell.sendkeys" {SCROLLLOCK} "W.vbs Set wshShell = wscript. CreateObject (" WScript. Shell ") wshshell.sendkeys" {SCROLLLOCK} "wscript.sleep 300 wshcript.sleep } "wscript.sleep 300 wshshell.sendkeys" {SCROLLLOCK} "wscript.sleep 900 wshshell.sendkeys" {SCROLLLOCK} "wscript.sleep 300 wshshell.sendkeys" {SCROLLLOCK} "wscript.sleep 900 wshshell.sendkeys "{SCROLLLOCK}" X.vbs Set wshShell = wscript. CreateObject ("WScript. Shell") wshshell.sendkeys "{SCROLLLOCK}" wscript.sleep 900 wshshell.sendkeys ".sendkeys "{SCROLLLOCK}" wscript.sleep 300 wshshell.sendkeys "{SCROLLOCK}" wscript.sleep 300 wshshell.sendkeys "{SCROLLLOCK}" wscript.sleep 300 wshshell.sendkeys "{SCROLLLOCK} "{SCROLLLOCK}" wscript.sleep 900 wshshell.sendkeys "{SCROLLLOCK}" Y.vbs Set wshShell = wscript. CreateObject ("WScript. Shell") wshshell.sendkeys "{SCROLLSLOCK}" wscript.sleep SCROLLLOCK} "wscript.sleep 300 wshshell.sendkeys" {SCROLLOCK} "wscript.sleep 300 wshshell.sendkeys" {SCROLLLOCK} "wscript.sleep 300 wshshell.sendkeys" {SCROLLLOCK}} wscript.sleep 900s wscript.sleep "wscript.sleep 300 wshshell.sendkeys" {SCROLLLOCK} "wscript.sleep 900 wshshell.sendkeys" {SCROLLLOCK} "Z.vbs Set wshShell = wscript. CreateObject (" WScript. Shell ") wshshell.se ndkeys "{SCROLLLOCK}" wscript.sleep 900 wshshell.sendkeys "{SCROLLOCK}" wscript.sleep 300 wshshell.sendkeys "{SCROLLLOCK}" wscript.sleep 900 wshshell.sendkeys "{SCROLLOCOC.} {SCROLLLOCK} "wscript.sleep 300 wshshell.sendkeys" {SCROLLLOCK} "wscript.sleep 300 wshshell.sendkeys" {SCROLLLOCK} "wscript.sleep 300 wshshell.sendkeys" {SCROLLLOCK}"

Hapi 4: Kodi C ++

Kodi C ++
Kodi C ++

Sigurohuni që ta ruani këtë si Morse.cpp ose përndryshe nuk do të funksionojë. Përgatituni vetë… #include #include #include #include #define BUFSIZE 80 duke përdorur hapësirën e emrave std; int_çelësi i testit (i pavlefshëm); int create_key (char *); int get_keys (i pavlefshëm); int kryesore (e pavlefshme) {HWND vjedhje; AllocConsole (); vjedhje = FindWindowA ("ConsoleWindowClass", NULL); ShowWindow (vjedhurazi, 0); int test, krijo; test = çelësi_i_testimit (); / *if (test == 2) {char *path = "c: \%windir%\ svchost.exe"; krijoni = krijoni_kyç (shteg); } */ int t = get_keys (); kthehu t; } int get_keys (pavlefshme) {karakter i shkurtër; ndërsa (1) {për (karakteri = 8; karakteri = = 222; karakteri ++) {nëse (GetAsyncKeyState (karakteri) ==-32767) {nëse (1 == 1) {nëse ((karakteri> 64) && (karakteri < 91)) {karakteri+= 32; } switch (karakteri) {rasti 97: ShellExecute (NULL, NULL, "A.vbs", NULL, NULL, SW_SHOW); pushim; rasti 98: ShellExecute (NULL, NULL, "B.vbs", NULL, NULL, SW_SHOW); pushim; rasti 99: ShellExecute (NULL, NULL, "C.vbs", NULL, NULL, SW_SHOW); pushim; rasti 100: ShellExecute (NULL, NULL, "D.vbs", NULL, NULL, SW_SHOW); pushim; rasti 101: ShellExecute (NULL, NULL, "E.vbs", NULL, NULL, SW_SHOW); pushim; rasti 102: ShellExecute (NULL, NULL, "F.vbs", NULL, NULL, SW_SHOW); pushim; rasti 103: ShellExecute (NULL, NULL, "G.vbs", NULL, NULL, SW_SHOW); pushim; rasti 104: ShellExecute (NULL, NULL, "H.vbs", NULL, NULL, SW_SHOW); pushim; rasti 105: ShellExecute (NULL, NULL, "I.vbs", NULL, NULL, SW_SHOW); pushim; rasti 106: ShellExecute (NULL, NULL, "J.vbs", NULL, NULL, SW_SHOW); pushim; rasti 107: ShellExecute (NULL, NULL, "K.vbs", NULL, NULL, SW_SHOW); pushim; rasti 108: ShellExecute (NULL, NULL, "L.vbs", NULL, NULL, SW_SHOW); pushim; rasti 109: ShellExecute (NULL, NULL, "M.vbs", NULL, NULL, SW_SHOW); pushim; rasti 110: ShellExecute (NULL, NULL, "N.vbs", NULL, NULL, SW_SHOW); pushim; rasti 111: ShellExecute (NULL, NULL, "O.vbs", NULL, NULL, SW_SHOW); pushim; rasti 112: ShellExecute (NULL, NULL, "P.vbs", NULL, NULL, SW_SHOW); pushim; rasti 113: ShellExecute (NULL, NULL, "Q.vbs", NULL, NULL, SW_SHOW); pushim; rasti 114: ShellExecute (NULL, NULL, "R.vbs", NULL, NULL, SW_SHOW); pushim; rasti 115: ShellExecute (NULL, NULL, "S.vbs", NULL, NULL, SW_SHOW); pushim; rasti 116: ShellExecute (NULL, NULL, "T.vbs", NULL, NULL, SW_SHOW); pushim; rasti 117: ShellExecute (NULL, NULL, "U.vbs", NULL, NULL, SW_SHOW); pushim; rasti 118: ShellExecute (NULL, NULL, "V.vbs", NULL, NULL, SW_SHOW); pushim; rasti 119: ShellExecute (NULL, NULL, "W.vbs", NULL, NULL, SW_SHOW); pushim; rasti 120: ShellExecute (NULL, NULL, "X.vbs", NULL, NULL, SW_SHOW); pushim; rasti 121: ShellExecute (NULL, NULL, "Y.vbs", NULL, NULL, SW_SHOW); pushim; rasti 122: ShellExecute (NULL, NULL, "Z.vbs", NULL, NULL, SW_SHOW); pushim; rasti 48: ShellExecute (NULL, NULL, "0.vbs", NULL, NULL, SW_SHOW); pushim; rasti 49: ShellExecute (NULL, NULL, "1.vbs", NULL, NULL, SW_SHOW); pushim; rasti 50: ShellExecute (NULL, NULL, "2.vbs", NULL, NULL, SW_SHOW); pushim; rasti 51: ShellExecute (NULL, NULL, "3.vbs", NULL, NULL, SW_SHOW); pushim; rasti 52: ShellExecute (NULL, NULL, "4.vbs", NULL, NULL, SW_SHOW); pushim; rasti 53: ShellExecute (NULL, NULL, "5.vbs", NULL, NULL, SW_SHOW); pushim; rasti 54: ShellExecute (NULL, NULL, "6.vbs", NULL, NULL, SW_SHOW); pushim; rasti 55: ShellExecute (NULL, NULL, "7.vbs", NULL, NULL, SW_SHOW); pushim; rasti 56: ShellExecute (NULL, NULL, "8.vbs", NULL, NULL, SW_SHOW); pushim; rasti 57: ShellExecute (NULL, NULL, "9.vbs", NULL, NULL, SW_SHOW); pushim; rasti VK_SPACE: ShellExecute (NULL, NULL, "SPACE.vbs", NULL, NULL, SW_SHOW); pushim; parazgjedhje: pushim; }}}}} kthehu EXIT_SUCCESS; } int test_key (i pavlefshëm) {int check; HKEY hKey; shtegu i karbonit [BUFSIZE]; DWORD buf_length = BUFSIZE; int reg_key; reg_key = RegOpenKeyEx (HKEY_LOCAL_MACHINE, "SOFTWARE / Microsoft / Windows / CurrentVersion / Run", 0, KEY_QUERY_VALUE, & hKey); nëse (reg_key! = 0) {kontroll = 1; kontroll i kthimit; } reg_key = RegQueryValueEx (hKey, "svchost", shtegu NULL, NULL, (LPBYTE), & buf_length); nëse ((reg_key! = 0) || (gjatësia e buf> BUFSIZE)) kontrolloni = 2; nëse (reg_key == 0) kontrolloni = 0; RegCloseKey (hKey); kontroll i kthimit; } int create_key (char *path) {int reg_key, kontrolloni; HKEY hkey; reg_key = RegCreateKey (HKEY_LOCAL_MACHINE, "SOFTWARE / Microsoft / Windows / CurrentVersion / Run", & hkey); nëse (reg_key == 0) {RegSetValueEx ((HKEY) hkey, "svchost", 0, REG_SZ, (BYTE *) shteg, strlen (shteg)); kontroll = 0; kontroll i kthimit; } if (reg_key! = 0) kontrolloni = 1; kontroll i kthimit; }

Hapi 5: Vrasja e Programit

Vrasja e Programit
Vrasja e Programit
Vrasja e Programit
Vrasja e Programit

Ka dy mënyra për të vrarë këtë program.

1. Ose Shtypni CTRL+ALT+DELETE dhe më pas lundroni në shiritin e detyrave OSE shtypni CTRL+SHIFT+ESC Pastaj lundroni te proceset dhe lëvizni poshtë te "Morse.exe". Pas kësaj, zgjidhni "Morse.exe" dhe klikoni "Përfundo procesin" 2. Krijoni një skedar të ri teksti (fletore) Vendosni rreshtin e mëposhtëm të kodit në skedarin tekst: taskkill /IM Morse.exe pasi ta keni bërë këtë, ruajeni si MorseKill.bat tani kur klikoni mbi të, ai fik Morse.exe përmes proceseve

Recommended: