Comments (3)
For anyone trying to get this working, this was the change I made to pass the icon from the app to the window:
//webview_edge.cpp
browser_window(msg_cb_t cb, const char* title, int width, int height, bool resizable)
: m_cb(cb)
{
HINSTANCE hInstance = GetModuleHandle(nullptr);
HWND currentWindow = GetActiveWindow();
// "1" is the default icon resource name used by winres
HICON parentIcon = (HICON)LoadImage(
hInstance,
MAKEINTRESOURCE(1),
IMAGE_ICON,
0,
0,
LR_DEFAULTSIZE
);
WNDCLASSEX wc;
ZeroMemory(&wc, sizeof(WNDCLASSEX));
wc.cbSize = sizeof(WNDCLASSEX);
wc.hInstance = hInstance;
wc.lpfnWndProc = WebviewWndProc;
wc.lpszClassName = L"webview";
wc.hIcon = parentIcon; // add the icon here
RegisterClassEx(&wc);
This is my rust build script:
\\build.rs
use winres;
fn main() {
let mut res = winres::WindowsResource::new();
res.set_icon("Micro.ico");
res.compile().unwrap();
}
I can't think of an easy way to locate the icon used by the taskbar (and so have had to refer to the icon resource by name).
One possibility would be to agree upon a default resource name to be used for the window icon (rather than just 1!). winres
supports setting the resource id so this wouldn't cause issues for Rust users.
from web-view.
You mean the icon that appears in the title bar and task bar?
Doesn't it use the exe icon for that?
from web-view.
It uses the exe icon for the task bar, but not for the upper left hand side corner.
https://gyazo.com/5e00afd945c9d862d6734cb23686555e
https://gyazo.com/ae15922cb6247b2ff3240ddcf1750796
from web-view.
Related Issues (20)
- How to load url?
- Facilitate using step() while processing other events
- alert(), confirm(), and console.log() extremely slow and distorted on Ubuntu 20.04 HOT 1
- Way to get current URL?
- Debug mode dumps HTML on every console message HOT 1
- Is there a ready event?
- Is this browser ready?
- Is there a way to access the true file system path when using a "Browse" button on webview?
- [Solved] Compilation fails with Edge feature enabled HOT 1
- Hovering over an image for alt text causes `NSException` on macOS 12.1 w/ M1
- Is multitouch supported? HOT 1
- Android? iOS?
- Make a fork and cooperate to maintain this crate! HOT 1
- box-shadow wrongly displayed
- iframe support?
- Corrupted files
- Is there a way to open two webview windows without crashing? HOT 1
- external.invoke returns undefined instead of promise on Windows 10 HOT 1
- Rust Webview JavaScript interface
- how to create handler? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from web-view.