Link to home
Start Free TrialLog in
Avatar of ManAtNext
ManAtNext

asked on

Top most CDialog application - includes being over the taskbar

I have a dialog application, my user wants to be able to drag the dialog anyway on the screen and for it to remain on top.

When they drag it over the taskbar/start bar, the dialog goes behind the bar - how can I get it to go over the bar (in the same way as the task manager does)?
ASKER CERTIFIED SOLUTION
Avatar of mahesh1402
mahesh1402
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of ManAtNext
ManAtNext

ASKER

That works really well, thank you.

However, my main dialog creates another window (derived from CWnd), when I do that your solution stops being effective. Also, I thought I'd try it out on the newly created CWnd derived class too - with that window it didn't work, the create process for that window looks like this:

    BOOL result = CreateEx(0,
        AfxRegisterWndClass(NULL, NULL, (HBRUSH)GetStockObject(NULL_BRUSH), NULL),
        _T(""), WS_POPUP | WS_BORDER,
        CRect (0, 0, Size, Size),
        &parentWnd, NULL, NULL);

Any ideas why?

PS: I will be awarding the points to you regardless is due course - your answer was spot on for my original question.
Well then have you tried calling SetWindowPos again for your dialog after creating new window ?

-MAHESH
Found it - the process control returns to the parent dialog, and when it does, the window stops being top most - I've re-grabbed it WM_MOUSEMOVE (naughty I know, but it works for what I want).

Thanks again for your help.