Skip to content

Commit 7b0293e

Browse files
authored
Create README.md
1 parent bb809d1 commit 7b0293e

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

examples/SFML/README.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Create SFML Overlay Transparent Window
2+
Create a window as transparent background and ctopmost and unclickable window form.
3+
4+
```c++
5+
sf::RenderWindow window;
6+
7+
sf::ContextSettings settings;
8+
settings.antialiasingLevel = 8;
9+
10+
11+
window.create(sf::VideoMode(screen_width, screen_height), "Amiral Router", sf::Style::None, settings);
12+
13+
window.setFramerateLimit(120);
14+
15+
window.setVerticalSyncEnabled(false);
16+
17+
HWND hWnd = window.getSystemHandle();
18+
19+
SetWindowLong(hWnd, GWL_EXSTYLE, WS_EX_TRANSPARENT | WS_EX_LAYERED);
20+
SetLayeredWindowAttributes(hWnd, 0, 255, LWA_ALPHA);
21+
22+
MARGINS margin = { -1 };
23+
DwmExtendFrameIntoClientArea(hWnd, &margin);
24+
25+
::SetWindowPos(hWnd, HWND_TOPMOST, 1,1, screen_width, screen_height, SWP_SHOWWINDOW);
26+
UpdateWindow(hWnd);
27+
```

0 commit comments

Comments
 (0)