# Use nonantialiased to remove the white edges around the text. Lf.lfHeight = int(round(dpiScale * fontSize)) Hdc, paintStruct = win32gui.BeginPaint(hWnd)ĭpiScale = win32ui.GetDeviceCaps(hdc, win32con.LOGPIXELSX) / 60.0 #win32gui.ShowWindow(hWindow, win32con.SW_SHOW)ĭef wndProc(hWnd, message, wParam, lParam):
Win32con.SWP_NOACTIVATE | win32con.SWP_NOMOVE | win32con.SWP_NOSIZE | win32con.SWP_SHOWWINDOW) Win32gui.SetWindowPos(hWindow, win32con.HWND_TOPMOST, 0, 0, 0, 0, Win32gui.SetLayeredWindowAttributes(hWindow, 0x00ffffff, 255, win32con.LWA_COLORKEY | win32con.LWA_ALPHA) Win32api.GetSystemMetrics(win32con.SM_CYSCREEN), # height Win32api.GetSystemMetrics(win32con.SM_CXSCREEN), # width Style = win32con.WS_DISABLED | win32con.WS_POPUP | win32con.WS_VISIBLE # Consider using: WS_DISABLED, WS_POPUP, WS_VISIBLE # Consider using: WS_EX_COMPOSITED, WS_EX_LAYERED, WS_EX_NOACTIVATE, WS_EX_TOOLWINDOW, WS_EX_TOPMOST, WS_EX_TRANSPARENT WndClassAtom = win32gui.RegisterClass(wndClass) # win32gui does not support RegisterClassEx WndClass.hbrBackground = win32gui.GetStockObject(win32con.WHITE_BRUSH) WndClass.hCursor = win32gui.LoadCursor(None, win32con.IDC_ARROW) WndClass.style = win32con.CS_HREDRAW | win32con.CS_VREDRAW import win32api, win32con, win32gui, win32ui
#JAK 3 PC BACKGROUND PROBLEMS WINDOWS#
I've included links to the relevant parts of the Windows API throughout the code. This makes it more complicated and less portable, but considerably more powerful. This example does everything through pywin32. Win32api.SetWindowLong(hWindow, win32con.GWL_EXSTYLE, exStyle) # The WS_EX_TRANSPARENT flag makes events (like mouse clicks) fall through the window.ĮxStyle = win32con.WS_EX_COMPOSITED | win32con.WS_EX_LAYERED | win32con.WS_EX_NOACTIVATE | win32con.WS_EX_TOPMOST | win32con.WS_EX_TRANSPARENT Label = Tkinter.Label(text='Text on the screen', font=('Times New Roman','80'), fg='black', bg='white')
![jak 3 pc background problems jak 3 pc background problems](https://res.cloudinary.com/lmn/image/upload/c_limit,h_360,w_640/e_sharpen:100/f_auto,fl_lossy,q_auto/v1/gameskinnyc/d/e/a/deathloop-0xc0000001d-fix-c5e40.png)
import Tkinter, win32api, win32con, pywintypes If win32api isn't available to you, then you can just remove that part of the code.
![jak 3 pc background problems jak 3 pc background problems](https://vistapointe.net/images/jak-3-7.jpg)
In this example, I do the majority of the work with Tkinter and use win32api to prevent the text from blocking mouse clicks. I haven't written up a Direct3D hook example, but I'll give two different solutions to the first problem. The only reliable way to show text over a full-screen application is to use a Direct3D hook. However, this won't work when there's a full-screen application running (such as a game). To show text over windows, you'll need to create an undecorated topmost window and chroma key the background. It turns out there are two entirely different problems here. Background transparency isn't alpha, so there's hard edges.
![jak 3 pc background problems jak 3 pc background problems](https://gamefabrique.com/storage/screenshots/ps3/jak-3-08.png)