Click here to Skip to main content
15,886,362 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Retrieve HWND of a control that has focus Pin
_Flaviu10-Aug-18 4:36
_Flaviu10-Aug-18 4:36 
GeneralRe: Retrieve HWND of a control that has focus Pin
David Crow10-Aug-18 4:58
David Crow10-Aug-18 4:58 
AnswerRe: Retrieve HWND of a control that has focus Pin
leon de boer10-Aug-18 6:57
leon de boer10-Aug-18 6:57 
GeneralRe: Retrieve HWND of a control that has focus Pin
_Flaviu11-Aug-18 21:08
_Flaviu11-Aug-18 21:08 
GeneralRe: Retrieve HWND of a control that has focus Pin
Richard MacCutchan11-Aug-18 21:56
mveRichard MacCutchan11-Aug-18 21:56 
GeneralRe: Retrieve HWND of a control that has focus Pin
_Flaviu13-Aug-18 0:09
_Flaviu13-Aug-18 0:09 
GeneralRe: Retrieve HWND of a control that has focus Pin
Randor 13-Aug-18 1:51
professional Randor 13-Aug-18 1:51 
GeneralRe: Retrieve HWND of a control that has focus Pin
leon de boer12-Aug-18 3:47
leon de boer12-Aug-18 3:47 
GetForegroundWindow doesn't give a rats if your dialog has focus or not. At a guess you have the dialog in modal mode and the message queue is shutdown and your code isn't executing when it isn't focused Smile | :)

https://msdn.microsoft.com/en-us/library/windows/desktop/ms633505(v=vs.85).aspx[^]

It is quite specific it's the window that's currently getting input regardless of its relationship to the calling thread (aka your little APP). It has two choices the focus window (or the windows that contains the focus window depends on class) or null if the desktop itself has focus.

If you doubt it download and use spy++ and click on the focus window with the mouse to get its details
Introducing Spy++ - Visual Studio | Microsoft Docs[^]

You should also be able to confirm it with GetLastActivePopup.
GetLastActivePopup function (Windows)[^]

The call they have closed down is its sister call SetForegroundWindow() to steal focus from another process (unless that process has explicitly given permission via AllowSetForegroundWindow) because lots of web browser popups were abusing it.
In vino veritas


modified 12-Aug-18 22:40pm.

QuestionWhat is the magic incantation to select a row in a CListCtrl in report mode ? Pin
Maximilien9-Aug-18 9:09
Maximilien9-Aug-18 9:09 
GeneralRe: What is the magic incantation to select a row in a CListCtrl in report mode ? Pin
David Crow9-Aug-18 9:47
David Crow9-Aug-18 9:47 
GeneralRe: What is the magic incantation to select a row in a CListCtrl in report mode ? Pin
Maximilien9-Aug-18 12:06
Maximilien9-Aug-18 12:06 
GeneralRe: What is the magic incantation to select a row in a CListCtrl in report mode ? Pin
Maximilien21-Aug-18 5:11
Maximilien21-Aug-18 5:11 
Questionhow to use recursive descent algorithm to compute an arithmetical expression? Pin
tony_ming8-Aug-18 20:42
tony_ming8-Aug-18 20:42 
AnswerRe: how to use recursive descent algorithm to compute an arithmetical expression? Pin
Richard MacCutchan8-Aug-18 20:50
mveRichard MacCutchan8-Aug-18 20:50 
AnswerRe: how to use recursive descent algorithm to compute an arithmetical expression? Pin
Stefan_Lang8-Aug-18 22:07
Stefan_Lang8-Aug-18 22:07 
QuestionRe: how to use recursive descent algorithm to compute an arithmetical expression? Pin
David Crow9-Aug-18 4:55
David Crow9-Aug-18 4:55 
AnswerRe: how to use recursive descent algorithm to compute an arithmetical expression? Pin
CPallini9-Aug-18 10:38
mveCPallini9-Aug-18 10:38 
QuestionMovePrev() throwing 265926 error code (End Of RowsSet). Pin
Sampath5797-Aug-18 20:19
Sampath5797-Aug-18 20:19 
AnswerRe: MovePrev() throwing 265926 error code (End Of RowsSet). Pin
Jochen Arndt7-Aug-18 21:52
professionalJochen Arndt7-Aug-18 21:52 
GeneralRe: MovePrev() throwing -2147217837 error code Pin
Sampath5797-Aug-18 22:23
Sampath5797-Aug-18 22:23 
GeneralRe: MovePrev() throwing 265926 error code (End Of RowsSet). Pin
Jochen Arndt7-Aug-18 23:26
professionalJochen Arndt7-Aug-18 23:26 
GeneralRe: MovePrev() throwing 265926 error code (End Of RowsSet). Pin
Sampath5798-Aug-18 0:01
Sampath5798-Aug-18 0:01 
GeneralRe: MovePrev() throwing 265926 error code (End Of RowsSet). Pin
Jochen Arndt8-Aug-18 0:29
professionalJochen Arndt8-Aug-18 0:29 
GeneralRe: MovePrev() throwing 265926 error code (End Of RowsSet). Pin
Sampath5798-Aug-18 3:19
Sampath5798-Aug-18 3:19 
GeneralRe: MovePrev() throwing 265926 error code (End Of RowsSet). Pin
Jochen Arndt8-Aug-18 3:21
professionalJochen Arndt8-Aug-18 3:21 

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.