31 lines
686 B
C++
31 lines
686 B
C++
#include <rewindow/types/window.h>
|
|
|
|
|
|
LRESULT CALLBACK WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
|
|
|
|
|
|
LPTSTR szClassName = TEXT("GenericProgramWindowClass");
|
|
|
|
WNDCLASS wc = { };
|
|
wc.lpfnWndProc = WindowProc;
|
|
|
|
HWND hwnd;
|
|
|
|
RWindow::RWindow()
|
|
{
|
|
hwnd = CreateWindow();
|
|
}
|
|
|
|
|
|
void RWindow::raise() const {
|
|
SendMessage(hwnd, WM_SYSCOMMAND, SC_RESTORE, 0); // Restore
|
|
SetForegroundWindow(hwnd);
|
|
SetActiveWindow(hwnd);
|
|
SetWindowPos(hwnd, HWND_TOP, 0, 0, 0, 0, SWP_SHOWWINDOW | SWP_NOMOVE | SWP_NOSIZE);
|
|
// Redraw to prevent the window blank
|
|
RedrawWindow(hwnd, NULL, 0, RDW_FRAME | RDW_INVALIDATE | RDW_ALLCHILDREN);
|
|
}
|
|
|
|
void RWindow::lower() const {
|
|
|
|
} |