Solved

[Q]: focus affecting keystroke cursor adjustment

Posted on 1997-11-25
4
220 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
List out all word 7 358
zeroFront challenge 7 136
matchUp  challenge 9 134
Not needed 13 134
Introduction: Displaying information on the statusbar.   Continuing from the third article about sudoku.   Open the project in visual studio. Status bar – let’s display the timestamp there.  We need to get the timestamp from the document s…
Introduction: Hints for the grid button.  Nested classes, templated collections.  Squash that darned bug! Continuing from the sixth article about sudoku.   Open the project in visual studio. First we will finish with the SUD_SETVALUE messa…
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.

734 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