Click here to Skip to main content
15,897,891 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Searching string not working Pin
Jochen Arndt18-Dec-17 22:57
professionalJochen Arndt18-Dec-17 22:57 
GeneralRe: Searching string not working Pin
Richard MacCutchan19-Dec-17 2:42
mveRichard MacCutchan19-Dec-17 2:42 
GeneralRe: Searching string not working Pin
Anonygeeker18-Dec-17 23:10
Anonygeeker18-Dec-17 23:10 
AnswerRe: Searching string not working Pin
CPallini18-Dec-17 23:26
mveCPallini18-Dec-17 23:26 
QuestionIn MFC how to achieve multilevel undo/redo operations for CRichEditCtrl? Pin
steffi12317-Dec-17 19:13
steffi12317-Dec-17 19:13 
AnswerRe: In MFC how to achieve multilevel undo/redo operations for CRichEditCtrl? Pin
Victor Nijegorodov17-Dec-17 21:03
Victor Nijegorodov17-Dec-17 21:03 
AnswerRe: In MFC how to achieve multilevel undo/redo operations for CRichEditCtrl? Pin
_Flaviu17-Dec-17 22:13
_Flaviu17-Dec-17 22:13 
QuestionHow to insert char* to char array - WITHOUT using string Pin
Vaclav_16-Dec-17 4:52
Vaclav_16-Dec-17 4:52 
GeneralRe: How to insert char* to char array - WITHOUT using string Pin
PIEBALDconsult16-Dec-17 4:57
mvePIEBALDconsult16-Dec-17 4:57 
AnswerRe: How to insert char* to char array - WITHOUT using string Pin
Victor Nijegorodov16-Dec-17 5:06
Victor Nijegorodov16-Dec-17 5:06 
AnswerRe: How to insert char* to char array - WITHOUT using string Pin
leon de boer16-Dec-17 5:08
leon de boer16-Dec-17 5:08 
GeneralRe: How to insert char* to char array - WITHOUT using string Pin
Vaclav_16-Dec-17 10:43
Vaclav_16-Dec-17 10:43 
GeneralRe: How to insert char* to char array - WITHOUT using string Pin
Victor Nijegorodov16-Dec-17 21:31
Victor Nijegorodov16-Dec-17 21:31 
GeneralRe: How to insert char* to char array - WITHOUT using string Pin
Vaclav_20-Dec-17 7:25
Vaclav_20-Dec-17 7:25 
AnswerRe: How to insert char* to char array - WITHOUT using string Pin
jschell16-Dec-17 8:55
jschell16-Dec-17 8:55 
AnswerRe: How to insert char* to char array - WITHOUT using string Pin
Richard MacCutchan16-Dec-17 9:51
mveRichard MacCutchan16-Dec-17 9:51 
AnswerRe: How to insert char* to char array - WITHOUT using string Pin
Munchies_Matt20-Dec-17 3:47
Munchies_Matt20-Dec-17 3:47 
GeneralRe: How to insert char* to char array - WITHOUT using string Pin
Vaclav_20-Dec-17 7:31
Vaclav_20-Dec-17 7:31 
GeneralRe: How to insert char* to char array - WITHOUT using string Pin
Munchies_Matt20-Dec-17 21:53
Munchies_Matt20-Dec-17 21:53 
QuestionHow know if a window is above another Pin
Schehaider_Aymen15-Dec-17 5:46
Schehaider_Aymen15-Dec-17 5:46 
AnswerRe: How know if a window is above another Pin
Rick York15-Dec-17 6:09
mveRick York15-Dec-17 6:09 
AnswerRe: How know if a window is above another Pin
Victor Nijegorodov15-Dec-17 9:28
Victor Nijegorodov15-Dec-17 9:28 
GeneralRe: How know if a window is above another Pin
Schehaider_Aymen15-Dec-17 11:07
Schehaider_Aymen15-Dec-17 11:07 
GeneralRe: How know if a window is above another Pin
Richard Andrew x6416-Dec-17 3:15
professionalRichard Andrew x6416-Dec-17 3:15 
AnswerRe: How know if a window is above another Pin
leon de boer16-Dec-17 5:36
leon de boer16-Dec-17 5:36 
Windows API has the function GetTopWindow
GetTopWindow function (Windows)[^]

From the TopWindow you want walk down thru the chain via GetNextWindow
GetNextWindow function (Windows)[^]

So in your case you want to ask the topWindow of the window that contains both FileZilla window and a Notepad Window. You can then walk along the chain using GetNextWindow and see which is above which just by asking the window title.

Something like this will work
C++
char buf[256];
HWND Wnd = GetTopWindow( /*handle of window containing both*/ );
GetWindowText(Wnd, &buf[0], sizeof(buf));
while (Wnd != 0 && !stricmp(&buf[0], "FileZilla") && !stricmp(&buf[0], "NotePad"))
{
   Wnd = GetNextWindow(Wnd, GW_HWNDNEXT); // Next window
   GetWindowText(Wnd, &buf[0], sizeof(buf)); // Get it's title
}
if (Wnd == 0) {
   /* Error neither window found */
}
else {
   /* Wnd is the topmost of 2 windows title and the string title is in buf */  
}

It is equivalent to
EnumChildWindows function (Windows)[^]
However for the simplicity you have it isn't worth setting up the enumeration function.
In vino veritas

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.