Dock a control in native C++ - c++

I know how to do this in .Net but in native Win32, how does one dock a control. I'm trying to dock a trackbar I made like vlc's trackbar.
Thanks
dock it to the bottom of its parent window

You write the code to do it, or use a library which provides that functionality. If you are intent on using raw Win32, handle the WM_SIZE message for the container, calculate where the trackbar should be, and put it there. Roughly (0,height-trackbar_height,width,trackbar_height).
Apparently, Pearl Jam are still touring.

Related

How to minimize a frameless window which has been set size to fixed by method setFixedSize in Qt?

How to minimize a frameless window which has been set size to fixed by method setFixedSize in Qt?
Hi,
I'm using C++ code to make a Qt application. I set the window to frameless by
this->setWindowFlags(Qt::FramelessWindowHint);
So I can't click the minimize button support by Operating System and I made a customed one. But, when I want to use
this.showMinimized();
I found that it can't work with window which has been set fixed size by
this.setFixedSize(width, height);
So my question is, is there some other ways to make the window minimized which can be used by a window that set fixed size?
This is almost definitely not what you are looking for, but most if not all modern operating systems contain a minimize-all keyboard shortcut or show desktop button. You may have the button on your task bar, if you have one. If not, try windows-key+d or control-alt-d. If you want to learn about how to minimize a qt window from within your code(what I think you probably want), I recommend you check out the surprisingly clear documentation at doc.qt.io.

C++ docking windows

is there any way to dock two windows(like Winamp does with panels), but one window is from my application(WinApi) and second is from other(not connected with my app) application? So if I move window from other app my window will "glue" with it and move same direction.
Yes, that's fairly easy. Use SetWindowsHookEx(WH_CALLWNDPROCRET, otherHWND) to get the WM_MOVE message that will be generated whenever otherHWND moves.
I don't know if this is possible in C++ because I program in C# but what you could try is:
Make 2 panels.
Dock panel2 to the bottom.
dock panel1 to fill.
Place a splitter above panel2 so it can be resized.
I've used this solution before and it worked pretty well :).

Constraining other application's window sizes through Qt Application

I'm looking for a way in Qt to constrain other application window's (some will not be Qt) so that when maximized don't overlap my Qt application. Essentially I want to create the Windows Taskbar. I'd like the applications edge to dock to the appropriate edge of my Qt Taskbar in the same way that applications dock to the Windows taskbar when they are maximized. I envision this taskbar to exist along the top edge of the screen, but would like to allow users to decide which edge it will live on.
I know it isn't hard to make a window that is always on top it's more the auto docking issue I'm having a hard time figuring out.
I'm right now only looking to accomplish this on Windows.
Thank for any help.
Detailed explanation on how to do it would be too long for an answer here, but MSDN documentation on SHAppBarMessage should get you started. Taskbar created like that can even be part of winows taskbar ;)

Borderless window in clutter(mm)

I'm trying to use cluttermm to create a borderless window (for example, something like this).
In other words, I want to draw a rectangle on screen and some text on it, but NOT in a window, and NOT with borders.
Is clutter a really bad choice for this, or how can I do this?
Thanks!
Clutter itself doesn't offer any API to do this, and defers to the platform's API to control the actual window.
you can use Clutter-GTK and the GtkWindow API to remove the decoration from the window embedding the stage.

Qt Tray Icon Drag and Drop

Does anyone know if it is possible to use drag and drop with a tray icon using Qt?
I've been doing some research and here is what I have come up with:
A QSystemTrayIcon cannot explicitly handle a drag/drop event. However there is a workaround based on the Spifftastic tray icon location method.
You create a uniquely colored icon
and place it as the icon for a brief
moment and take a screenshot of it.
Given that you know the color
sequence for the icon, you can
search through the screenshot and
locate the particular icon's
location.
A transparent widget is positioned
over the icon and is used as the
drop target.
I have yet to work at a few of the finer details of the operation but that is the gist of it. All things considered it is a hacky way of things but given that there are no other ways to do this I think it is acceptable.
Fluffy App (written in C#) uses the Spifftastic method to locate the tray icon. I'm assuming the part about the transparent window is how they accomplish that but I have yet to decompile and examine their system.
Since QSystemTrayIcon is a QObject, not a QWidget, my guess is this is not possible. The system tray icon isn't really owned by Qt - it's passed on to the 'desktop', i.e whatever part of the Gnome/KDE/Windows/Mac is drawing the relevant area. At least on Mac, you'd be dropping on the menu-bar, which would be a very strange UI. For Gnome and KDE it's a FreeDesktop.org standard, but again I don't think its your process which actually does the drawing, and hence there's no way for Qt to get events such as drag and drop to you.