Solved

[Q]: focus affecting keystroke cursor adjustment

Posted on 1997-11-25
4
219 Views
Last Modified: 2013-11-20
-----------------------------
environment: vc++ 5.0 / win95
-----------------------------

using MFC, we are writing an MDI application with a custom "floating palette" popup window which exists outside and on top of the main frame window, much as the normal CMiniDockFrameWnd/CDockBar/CControlBar implementation serves to work. the reasons we chose to implement this window without using this kind of a setup is (1) we never dock inside the main frame window, so we don't need the overhead of CDockBar, and (2) we wanted to draw a half-height caption bar without the [dimmed-out] mini-system menu icon we get with the CMiniFrameWnd derivative.
0
Comment
Question by:kavan
  • 2
4 Comments
 

Author Comment

by:kavan
ID: 1310837
this is a (hopefully) better explanation of my previous question.
0
 
LVL 3

Expert Comment

by:jaba
ID: 1310838
You have to dispatch WM_NCACTIVATE message to prevent toolbar activation.
0
 
LVL 10

Expert Comment

by:RONSLOW
ID: 1310839
I would go back to the MFC CDockBar etc classes.

Your reasons for not using them were:

(1) didn't want the overheads...
I don't see how that would be a problem as the code is all in MFC dll's anyway, so its there whether you use it or not.

(2) want to get rid of system menu...
You can do that anyway - see http://www.codeguru.com/toolbar/no_sysmenu.shtml for an idea on how to do it... The key is
pMiniFrame = GetParentFrame();
pMiniFrame->ModifyStyle(WS_SYSMENU, NULL);

0
 
LVL 10

Accepted Solution

by:
RONSLOW earned 100 total points
ID: 1310840
Look at the PreTranslateMessage for CControlBar.

It does some magic to ensure that the owning windows get a look in first...

      while (pOwner != NULL)
      {
            // allow owner & frames to translate before IsDialogMessage does
            if (pOwner->PreTranslateMessage(pMsg))
                  return TRUE;

            // try parent frames until there are no parent frames
            pOwner = pOwner->GetParentFrame();
      }

I suggest you try something like that yourself .. in face, I'd copy the PreTranslateMessage from the CControlBar and remove the bits that don't effect you and see how that goes.

Without your source code for your special palette bar, there is little else I can offer.

0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli…
Introduction: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.

820 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question