Solved

[Q]: focus affecting keystroke cursor adjustment

Posted on 1997-11-25
4
215 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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

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…
Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
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.
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

758 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now