Last active
July 13, 2022 11:30
-
-
Save habibg1232191/8d618b0f08b13f593cb9d1380968b7f5 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include "juliwindow2.h" | |
| bool JuliWindow2::nativeEvent(const QByteArray &eventType, void *message, long *res) { | |
| if(eventType == "windows_generic_MSG") { | |
| MSG* ms = (MSG*) message; | |
| res = (long*) WndProc(ms->hwnd, ms->message, ms->wParam, ms->lParam); | |
| } | |
| return true; | |
| } | |
| LRESULT CALLBACK JuliWindow2::WndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) | |
| { | |
| switch (message) { | |
| case WM_NCLBUTTONDOWN: { | |
| qDebug() << "WM_NCLBUTTONDOWN"; | |
| ReleaseCapture(); | |
| return DefWindowProc(hwnd, message, wParam, lParam); | |
| } | |
| case WM_NCHITTEST: { | |
| qDebug() << "WM_NCHITTEST"; | |
| return HTCAPTION; | |
| } | |
| case WM_NCCALCSIZE: { | |
| qDebug() << "WM_NCHITTEST"; | |
| return 0; | |
| } | |
| } | |
| return DefWindowProc(hwnd, message, wParam, lParam); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #ifndef JULIWINDOW2_H | |
| #define JULIWINDOW2_H | |
| #include <QQuickWindow> | |
| #include "windows.h" | |
| class JuliWindow2 : public QQuickWindow | |
| { | |
| Q_OBJECT | |
| public: | |
| bool nativeEvent(const QByteArray &eventType, void *message, long *res); | |
| LRESULT WndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam); | |
| }; | |
| #endif // JULIWINDOW2_H |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment