Solved

[Q]: focus affecting keystroke cursor adjustment

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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Installing Microsoft R server on REDHAT or SUSE Linux 4 136
Doc'in system (example?) BA 7 107
has22 challenge 11 93
Execute multiple curl cmds with sleep and send output to file 10 97
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. …
Introduction: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
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.
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…

786 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