Exemplo n.º 1
0
 def on_create(self, hwnd, message, wparam, lparam):
     set_timer(30000, self.on_timer)
     SetWindowLong(hwnd, GWL_STYLE, WS_POPUP | WS_CHILD)
     SetWindowLong(hwnd, GWL_EXSTYLE,
                   WS_EX_LAYERED | WS_EX_TOPMOST | WS_EX_TOOLWINDOW)
     SetWindowPos(self.hwnd, 0, 0, 0, 200, 200, SWP_NOMOVE | SWP_NOZORDER)
     SetWindowPos(self.hwnd, HWND_TOPMOST, 0, 0, 0, 0,
                  SWP_NOMOVE | SWP_NOSIZE)
     SetWindowPos(self.hwnd, 0, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOZORDER)
     ShowWindow(self.hwnd, SW_SHOW)
Exemplo n.º 2
0
def SetClickthrough(windowname="Healslut Hypnotherapy"): #I want this to be in HP, but doesnt work when imported
	try:
		hwnd = FindWindow(None, windowname)
		windowStyles = WS_EX_LAYERED | WS_EX_TRANSPARENT
		SetWindowLong(hwnd, GWL_EXSTYLE, windowStyles)
	except Exception as e:
		HP.HandleError(format_exc(2), e, 'Hypnotherapy_SetClickthrough', subj='')		
Exemplo n.º 3
0
def RemoveClickthrough(windowname="Healslut Hypnotherapy"):
    try:
        hwnd = FindWindow(None, windowname)
        windowStyles = WS_EX_LAYERED
        SetWindowLong(hwnd, GWL_EXSTYLE, windowStyles)
    except Exception as e:
        HandleError(format_exc(2), e, 'RemoveClickthrough', subj='')
Exemplo n.º 4
0
    def __init__(self, *rect):
        """\
        Parameters
        ----------
        rect (list[int, int, int, int], optional): [default=None] if provided, must be [left, top, right, bottom] of current window
        """

        topWin = GetForeWin()
        x, y, w, h = rect if len(rect) == 4 else GetWindowRect(topWin)
        root = Tk()
        root.overrideredirect(True)
        root.title("-*Filter*-")
        root.config(bg='red')
        root.attributes('-transparentcolor', 'black', '-topmost', True,
                        '-alpha', 0.5)
        root.geometry('{}x{}+{}+{}'.format(w, h, x, y))
        f = Frame(root, bg='black')
        f.place(anchor='center',
                relx=0.5,
                rely=0.5,
                width=-6,
                relwidth=1,
                height=-6,
                relheight=1)
        root.update_idletasks()
        SetWindowLong(GetForeWin(), -8, topWin)

        root.mainloop()
Exemplo n.º 5
0
 def buildPlayer(self) -> None:
     # initialize variables
     self.marquees = list()
     self.btns = dict()
     self.isPlaying = False
     self.spotifyMini = False
     self.track = StringVar()
     self.track.set(STARTUP_TEXT_L)
     self.artist = StringVar()
     self.artist.set(STARTUP_TEXT_R)
     # build GUI elements
     self.createPlayer()
     self.updateLabels()
     self.update()
     pMenu = PlayerMenu(self)
     # start spotify
     self.spotify = SpotifyApp(self)
     # make GUI child of taskbar
     self.update_idletasks()
     hwnd = FindWindow(None, "Spotify Taskbar Player")
     trayhwnd = FindWindow('Shell_TrayWnd', None)
     SetWindowLong(hwnd, -8, trayhwnd)
     # start threads
     WaitExit(self).start()
     self.threads = (WatchMini(self),
                     WatchUpdate(self, self.spotify.startTitle))
     for thread in self.threads:
         thread.start()
     # bind keys
     self.bind_all('<MouseWheel>', self.sendInput)
     self.bind_all('<ButtonRelease-3>', pMenu.show)
Exemplo n.º 6
0
 def setClickthrough(self, hwnd):
     print("setting window properties")
     try:
         styles = GetWindowLong(hwnd, GWL_EXSTYLE)
         styles = WS_EX_LAYERED | WS_EX_TRANSPARENT
         SetWindowLong(hwnd, GWL_EXSTYLE, styles)
         SetLayeredWindowAttributes(hwnd, 0, 255, LWA_ALPHA)
     except Exception as e:
         print(e)
Exemplo n.º 7
0
    def BuildWindow(self):
        width = 400
        height = 100
        self.dialog = CreateWindowEx(
            win32con.WS_EX_TOPMOST,
            WC_DIALOG,
            self.title + ' (0%)',
            win32con.WS_VISIBLE | win32con.WS_OVERLAPPEDWINDOW,
            int(round(
                GetSystemMetrics(win32con.SM_CXSCREEN) * .5 - width * .5)),
            int(round(
                GetSystemMetrics(win32con.SM_CYSCREEN) * .5 - height * .5)),
            width,
            height,
            0,
            0,
            self.hinst,
            None)
        self.progbar = CreateWindow(
            #                             win32con.WS_EX_DLGMODALFRAME,
            'msctls_progress32',
            '',
            win32con.WS_VISIBLE | win32con.WS_CHILD,
            10,
            10,
            width - 30,
            20,
            self.dialog,
            0,
            0,
            None)
        if self.can_abort:
            self.button = CreateWindow(
                #                             win32con.WS_EX_DLGMODALFRAME,
                'BUTTON',
                'Cancel',
                win32con.WS_VISIBLE | win32con.WS_CHILD | win32con.BS_PUSHBUTTON,  # @IgnorePep8
                int(width / 2.75),
                40,
                100,
                20,
                self.dialog,
                0,
                0,
                None)
        self.oldWndProc = SetWindowLong(
            self.dialog,
            win32con.GWL_WNDPROC,
            self.DlgProc)
        SendMessage(self.progbar, PBM_SETRANGE, 0, MAKELPARAM(0, self.max_val))
#        win32gui.SendMessage(self.progbar, PBM_SETSTEP, 0, 10)
#        win32gui.SendMessage(self.progbar, PBM_SETMARQUEE, 0, 0)
        ShowWindow(self.progbar, win32con.SW_SHOW)
Exemplo n.º 8
0
def WindowClickThrough(MyWindow):
	hwnd = FindWindow(None, MyWindow)
	windowStyles = WS_EX_LAYERED | WS_EX_TRANSPARENT
	SetWindowLong(hwnd, GWL_EXSTYLE, windowStyles)