0

It looks as an MDI application (I can open multiple documents within a window). However I cannot get the handles of the opened documents (MDI children?). I tried with FindWindowsEx(..) and EnumChildWindows(..) and could not find any children. Then I tried with Spy++ and I got that the handle of each child is equal to the handle of the parent (MDI application?). Is this application a MDI application at all? Are these opened documents some kind of fake windows since they do not have handles? How can I access them?

Thank you very much for any help!

2
Contributors
2
Replies
3
Views
6 Years
Discussion Span
Last Post by Irina77
0

Show us some code

static HWND child[10];
static int st = 0;

BOOL CALLBACK WindowEnumProc(HWND hwnd, LPARAM lParam) {
  static bool first = 1;
  if (first) {
    dbe = hwnd;
    first = 0;
  }
  child[st] = hwnd;
  st++;
  return 1;
}

main () {
  HWND dbe = NULL;
  char title[50];
  strcpy_s(title, "ApplicationName - C:\\a\\Document1");
  while (dbe == NULL) {
    dbe = FindWindow(NULL, LPCSTR(title));
  }
  HWND child1 = NULL;
  HWND child2 = NULL;
  child1 = FindWindowEx(dbe, NULL, "MDIClient", NULL);
  child2 = FindWindowEx(dbe, NULL, NULL, NULL);

  LPARAM l=NULL;
  EnumChildWindows(dbe, WindowEnumProc, l);

  for ( int j = 0; j < st; j++ ) {
    cout << "child[st]= " << child[j] << endl;
  }
}

Both child1 and child2 remain NULL, and the variable st equal to 0.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.