tryphotino / photino.NET

https://tryphotino.io
Apache License 2.0
885 stars 73 forks source link

How to listen to window events/messages ? #127

Closed Crauzer closed 3 months ago

Crauzer commented 1 year ago

I want to be able to register an event handler for Window's WM_DROPFILES message, which seems to be doable manually by using the window handle but It'd be helpful if this was somehow possible to integrate into photino itself.

I'm not sure how Linux/Mac handles window events or if it's even possible to make it cross-compatible

Crauzer commented 1 year ago

I tried hijacking WndProc like this: image

but as you can see, it doesn't quite work:

https://user-images.githubusercontent.com/18646077/220966098-9f9be398-490d-4831-9922-cfbb7c97b459.mp4

philippjbauer commented 3 months ago

I recognize this issue has been open for a long time. Excuse the delay in response, we somehow overlooked it.

For anyone wondering about drag and drop functionality, this can be achieved using the browser control's drag and drop capabilities using Javascript.

DrPleaseRespect commented 2 months ago

@philippjbauer About the drag and drop functionality, Is it possible to obtain the true path of a dropped file? In WebView2 it seems like the path of a file gets replaced with a "C:\fakepath{filename}". Is there an API to obtain the real path of a file inside JS or .NET?