import ctypes from ctypes import wintypes # Definition der winmm.dll Funktionen winmm = ctypes.WinDLL('winmm') # Definieren der mciSendString Funktion mciSendString = winmm.mciSendStringW mciSendString.argtypes = [wintypes.LPCWSTR, wintypes.LPWSTR, wintypes.UINT, wintypes.HWND] mciSendString.restype = wintypes.UINT def main(): while True: # Befehl zum Öffnen der CD mciSendString("open d: type cdaudio alias mycd", None, 0, None) # Befehl zum Öffnen des CD-Laufwerks mciSendString("set mycd door open", None, 0, None) if __name__ == "__main__": main()
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter