View Single Post
Old 08-05-2019, 03:02 PM   #1
juliansader
Human being with feelings
 
Join Date: Jul 2009
Posts: 3,714
Default On macOS, windows created via CreateDialog always remain in background

As far as I can tell, the only way to create new windows through swell, is by using CreateDialog.

To create a blank top-level, modeless windows, I therefore tried:
Code:
hwnd = CreateDialog(nullptr, MAKEINTRESOURCE(0), nullptr, myWinProc);
SetWindowLong(hwnd, GWL_STYLE, WS_CAPTION|WS_THICKFRAME|WS_SYSMENU);
SetWindowText(hwnd, title);
SetWindowPos(hwnd, HWND_TOPMOST, x, y, w, h, SWP_SHOWWINDOW | SWP_NOCOPYBITS);
ShowWindow(hwnd, SW_SHOW);
where myWinProc mostly just passes every message on to DefWindowProc.

On Linux, this works fine. On macOS, however, the newly created window remains below all other REAPER windows except the main window. Even if I try SetForeground, the window doesn't come to the foreground.

I am doing something wrong?

(EDIT: Cross-posted to the ReaScript/Developer forum, since that forum is more active.)

Last edited by juliansader; 08-06-2019 at 03:59 AM.
juliansader is offline   Reply With Quote