Click here to Skip to main content
15,895,812 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: why const pointer is NOT const? how to solve the problem? PinPopular
KingsGambit4-Aug-10 17:02
KingsGambit4-Aug-10 17:02 
AnswerRe: why const pointer is NOT const? how to solve the problem? Pin
Aescleal5-Aug-10 0:02
Aescleal5-Aug-10 0:02 
QuestionHow to get physical memory size available to a process? Pin
Code-o-mat4-Aug-10 11:25
Code-o-mat4-Aug-10 11:25 
QuestionRe: How to get physical memory size available to a process? Pin
norish5-Aug-10 4:38
norish5-Aug-10 4:38 
AnswerRe: How to get physical memory size available to a process? Pin
Code-o-mat5-Aug-10 4:54
Code-o-mat5-Aug-10 4:54 
GeneralRe: How to get physical memory size available to a process? Pin
norish5-Aug-10 19:48
norish5-Aug-10 19:48 
GeneralRe: How to get physical memory size available to a process? Pin
Code-o-mat5-Aug-10 21:55
Code-o-mat5-Aug-10 21:55 
QuestionGet/Kill focus in MFC Pin
geoyar4-Aug-10 9:23
professionalgeoyar4-Aug-10 9:23 
I have a CDialog class with controls (e.g. CMySlider:public CSliderCtrl).
If I right click on the control area, the layered popup window is created, moved, and displayed.

Code is:
in MySlider::OnRButtonDown
bRes = CreateEx(WS_EX_LAYERED|WS_EX_TRANSPARENT|WS_EX_TOPMOST|WS_EX_NOACTIVATE,
AfxRegisterWndClass(CS_HREDRAW|CS_VREDRAW|CS_SAVEBITS),
NULL,
WS_POPUP|WS_VISIBLE,
0, 0, 0, 0,
NULL,
NULL,
0);
...........
if (bRes)
{
CRect tipWndRect = SetTipWndRects(...);
.........
SetLayeredWindowAttributes(RGB(...)), 0, LWA_COLORKEY);
MoveWindow(&tipWndRect, FALSE); // Tip is not visible because init. rect is empty
..........

RedrawWindow(NULL, NULL, RDW_INVALIDATE | RDW_UPDATENOW | RDW_NOERASE);
GetOwner()->SetFocus();

}

All is working. Problem is that the popup window immediately gets focus and before the control acquires
focus back, I see flicker: the dialog box loses focus, its non-client area changes colors, and all returnes to th state when popup is visible and the control keeps focus.
How can I show the popup in block the transfer of focus?
I tried OnSetFocus, OnKillFocus, but it seems that these functions are called after events.
geoyar

AnswerRe: Get/Kill focus in MFC Pin
Code-o-mat4-Aug-10 11:15
Code-o-mat4-Aug-10 11:15 
GeneralRe: Get/Kill focus in MFC Pin
geoyar5-Aug-10 12:19
professionalgeoyar5-Aug-10 12:19 
GeneralRe: Get/Kill focus in MFC Pin
Code-o-mat5-Aug-10 21:52
Code-o-mat5-Aug-10 21:52 
GeneralRe: Get/Kill focus in MFC Pin
geoyar6-Aug-10 7:29
professionalgeoyar6-Aug-10 7:29 
GeneralRe: Get/Kill focus in MFC Pin
Code-o-mat6-Aug-10 8:35
Code-o-mat6-Aug-10 8:35 
GeneralRe: Get/Kill focus in MFC Pin
geoyar6-Aug-10 10:01
professionalgeoyar6-Aug-10 10:01 
GeneralRe: Get/Kill focus in MFC Pin
Code-o-mat6-Aug-10 10:06
Code-o-mat6-Aug-10 10:06 
GeneralRe: Get/Kill focus in MFC Pin
geoyar6-Aug-10 11:31
professionalgeoyar6-Aug-10 11:31 
GeneralRe: Get/Kill focus in MFC Pin
Code-o-mat6-Aug-10 11:36
Code-o-mat6-Aug-10 11:36 
GeneralRe: Get/Kill focus in MFC Pin
geoyar6-Aug-10 15:41
professionalgeoyar6-Aug-10 15:41 
GeneralRe: Get/Kill focus in MFC Pin
geoyar6-Aug-10 16:08
professionalgeoyar6-Aug-10 16:08 
GeneralRe: Get/Kill focus in MFC Pin
Code-o-mat6-Aug-10 22:40
Code-o-mat6-Aug-10 22:40 
GeneralRe: Get/Kill focus in MFC Pin
geoyar7-Aug-10 10:01
professionalgeoyar7-Aug-10 10:01 
GeneralRe: Get/Kill focus in MFC Pin
Code-o-mat7-Aug-10 10:17
Code-o-mat7-Aug-10 10:17 
QuestionPosting a lot of data messages to MFC-based GUI Pin
kirilo_l4-Aug-10 5:30
kirilo_l4-Aug-10 5:30 
AnswerRe: Posting a lot of data messages to MFC-based GUI Pin
Chris Meech4-Aug-10 6:46
Chris Meech4-Aug-10 6:46 
Questiondebugging sprintf -VS/C++ Pin
Alan Kurlansky4-Aug-10 5:07
Alan Kurlansky4-Aug-10 5:07 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.