Skip to content

Commit

Permalink
Fix issue (#10)
Browse files Browse the repository at this point in the history
  • Loading branch information
marticliment committed Nov 20, 2022
1 parent 258638a commit 96d9282
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
13 changes: 8 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@ python -m pip install win32mica
## Usage:

```python
#####################################################################
# #
# Those examples are oversimplified, please see the examples folder #
# for detailed usage with each UI library. #
# #
#####################################################################

hwnd = qtwindow.winId().__int__() # On a PyQt/PySide window
hwnd = tkwindow.frame() # On a tkinter window
Expand Down Expand Up @@ -57,11 +63,8 @@ _Those are PySide2 windows with custom widgets._
For more information about possible errors/mistakes, make sure to add the following before using win32mica:


```
```python
# Add these lines at the very start of your script
import win32mica
win32mica.debugging = True
win32mica.ApplyMica(...)
```
5 changes: 4 additions & 1 deletion src/win32mica/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@ def ApplyMica(HWND: int, ColorMode: bool = MICAMODE.LIGHT) -> int:
HWND -- a handle to a window (it being an integer value)
ColorMode -- MICAMODE.DARK or MICAMODE.LIGHT, depending on the preferred UI theme. A boolean value can also be passed, True meaning Dark and False meaning Light
"""
HWND = int(HWND)
try:
HWND = int(HWND)
except ValueError:
HWND = int(str(HWND), 16)

if sys.platform == "win32" and sys.getwindowsversion().build >= 22000:
user32 = ctypes.windll.user32
Expand Down

0 comments on commit 96d9282

Please sign in to comment.