Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import os
- import sys
- import time
- import win32gui
- from win32con import *
- # Adjust this path for your installation
- kodppath = r"S:\Program Files\King of Dragon Pass\Launch King of Dragon Pass.lnk"
- def ecwCallback(hwnd, extra):
- if win32gui.GetClassName(hwnd) == "AfxFrameOrView40s":
- win32gui.MoveWindow(hwnd, 0, 0, 640, 480, 1)
- return 1
- def toWindow(hwnd):
- # Fix Window Title
- win32gui.SetWindowText(hwnd, r"King of Dragon Pass")
- # Remove pointless menu
- win32gui.SetMenu(hwnd, None)
- # Add window decoration
- style = win32gui.GetWindowLong(hwnd, GWL_STYLE)
- win32gui.SetWindowLong(hwnd, GWL_STYLE, style | WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX)
- win32gui.SetWindowPos(hwnd, HWND_TOP,
- 16, 12, 652, 514,
- SWP_NOOWNERZORDER | SWP_FRAMECHANGED)
- # Find the innermost window which actually draws the game
- win32gui.EnumChildWindows(hwnd, ecwCallback, 0)
- os.startfile(kodppath)
- for dummy in range(30):
- hwnd = win32gui.FindWindow(None, r"mTropolis Windows Player - mPlayer")
- if hwnd !=0:
- toWindow(hwnd)
- break
- time.sleep(1)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement