Skip to content

Instantly share code, notes, and snippets.

View emmatyping's full-sized avatar
🐍
β–„β–„β–€β–€β–„β–„β–€β–€β–„β–„β–€β–€β–„β–„β–€κœš

Emma Smith emmatyping

🐍
β–„β–„β–€β–€β–„β–„β–€β–€β–„β–„β–€β–€β–„β–„β–€κœš
View GitHub Profile
/* Melody
* (cleft) 2005 D. Cuartielles for K3
*
* This example uses a piezo speaker to play melodies. It sends
* a square wave of the appropriate frequency to the piezo, generating
* the corresponding tone.
*
* The calculation of the tones is made following the mathematical
* operation:
*
import ctypes
from ctypes import wintypes
#imports
GetWindowLong=ctypes.windll.user32.GetWindowLongW
SetWindowLong=ctypes.windll.user32.SetWindowLongW
SetLayeredWindowAttributes=ctypes.windll.user32.SetLayeredWindowAttributes
GetShell=ctypes.windll.user32.GetShellWindow
EnumChildren = ctypes.windll.user32.EnumChildWindows
EnumWindows=ctypes.windll.user32.EnumWindows
#include "mainwindow.h"
#include "ui_mainwindow.h"
#include <QDebug>
#include <commoncontrols.h>
#include <CommCtrl.h>
#include <shellapi.h>
HICON JumboIcon(LPTSTR pszPath)
{
@emmatyping
emmatyping / getico.py
Created May 28, 2015 23:58
Get Icon for file (not working).
def geticon(PATH):
shfileinfostruct=SHFILEINFO()
SHGFI_ICON = 0x000000100
SHGFI_DISPLAYNAME = 0x000000200
SHGFI_TYPENAME = 0x000000400
SHGFI_ATTRIBUTES = 0x000000800
SHGFI_ICONLOCATION = 0x000001000
SHGFI_EXETYPE = 0x000002000
SHGFI_SYSICONINDEX = 0x000004000
SHGFI_LINKOVERLAY = 0x000008000
@emmatyping
emmatyping / PurepyHook.py
Last active December 13, 2023 02:02
This is a pure python (or as close as possible) keyboard hook module.
# Some of this adapted from BoppreH's answer here:http://stackoverflow.com/questions/9817531/applying-low-level-keyboard-hooks-with-python-and-setwindowshookexa
import ctypes
from ctypes import wintypes
from collections import namedtuple
KeyEvents=namedtuple("KeyEvents",(['event_type', 'key_code',
'scan_code', 'alt_pressed',
'time']))
handlers=[]
@emmatyping
emmatyping / PyExplorer.pyw
Created March 12, 2015 23:25
Windows only GPL licensed example of a taskbar with a start button (see http://www.deviantart.com/art/Windows-8-Metro-Orbs-320240575 for button) NOTE:not currently working part of https://github.com/IronManMark20/PyExplorer
import sys
import ctypes
from PyQt4.QtCore import *
from PyQt4.QtGui import *
from PIL import Image
from PIL.ImageQt import ImageQt
import pyautogui as pg
import platform
class Main(QWidget):