Hello everyone.
I am new to C++ and, I guess trying to pool task that is to advanced.
I have a MDI application written in PowerBuilder. One of the child windows in that application has MultiTab control with several tabs on it. What I’m trying to do is to add another tab to that window using APIs. I am getting windows information using Spy++ and until last statement everything works fine.
When I’m, actually trying to add a window, GetLatsError() returns 1407. I Googled error and from my findings it is indicates that one of the parameters is wrong.
Please, help. Thank you
Here is the code:
HWND parentWin=0,mdiWin=0,ansestWin=0,targetWin=0,resultWin;
parentWin = FindWindow("FNWND390","TEST *** NOT PRODUCTION ***");
mdiWin=FindWindowEx(parentWin,NULL,"MDIClient","");
ansestWin = FindWindowEx(mdiWin,NULL,"FNWND390","Central Information");
targetWin=FindWindowEx(ansestWin,NULL,"PBTabControl32_90","");
resultWin=CreateWindowEx(
WS_EX_LEFT || WS_EX_LTRREADING || WS_EX_RIGHTSCROLLBAR,
"FNUDO390",
"MyTabs",
WS_CHILDWINDOW || WS_CLIPSIBLINGS ||WS_CLIPCHILDREN,
1, 1, 300, 300, targetWin, NULL, hins, NULL);
DWORD dw = GetLastError();
if(dw!=NULL){
char buf[16];
LPCSTR psz = NULL;
wsprintf(buf,"%d",dw);
psz = buf;
int msgboxID = MessageBox(
NULL,
psz ,
"ERROR: No creation",
MB_ICONERROR);