I have posted this question before, and couldn't solve it...So i'm trying again, and this time trying to explain it better.

I have a configuration window that consists of a parent dialog, and several child dialogs.
I have an array in the parent containing the handles of the child windows, and an array of data structures passed as parameters to the children.
These arrays are declared as static variables in global scope in the parent window:
// Global declares in parentform
static HWND hwThis, hWndParent, hwChild[9];
static ThData *dat=0;
static TermData trm[10];
//Creating the child forms
hwChild[chCnt] = (HWND)frmTrmSetup(hwThis, dat, &trm[chTermCnt]);
hwChild[chCnt] = (HWND)frmTrmSetup(hwThis, dat, &trm[chTermCnt]);
In the child windows are several functions/variables declared in the following way:
static BOOL CALLBACK TermProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);static HWND hwThis;static static ThData *trmDat;
static TermData *trmLoc;

int frmTrmSetup(HWND hWnd, ThData *data, TermData *tr){
	trmLoc = tr;
	trmDat = data;
	return((int)CreateDialog(GetModuleHandle(0), MAKEINTRESOURCE(FRM_TRMSETUP), hWnd, TermProc));
The problem is that the only data i get in return, is that of the last created form...Any suggestions?
I think this has something to do with the global variables, or the structs passed to the children