mIRC Home    About    Download    Register    News    Help

Print Thread
#70263 04/02/04 05:14 AM
Joined: Mar 2003
Posts: 187
S
Vogon poet
OP Offline
Vogon poet
S
Joined: Mar 2003
Posts: 187
I'm using EnumChildWindows(), and I want the hwnd of the 18th child window, this is the proc I'm using;

BOOL CALLBACK EnumChildProc(HWND hwndChild, LPARAM lParam)
{
int idChild;
char buffer[999];

counter++;

if (counter == 18) {

idChild = GetWindowLong(hwndChild, GWL_ID);

GetWindowText(hwndChild,buffer,999);

return TRUE;
}
return 0;
}

Howdo I return 'buffer'???

#70264 04/02/04 11:16 AM
Joined: Dec 2002
Posts: 774
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Dec 2002
Posts: 774
how about asking this in some programming forum.. this is about mIRC SCRIPTING


Code:
//if ( khaled isgod ) echo yes | else echo no
#70265 04/02/04 12:27 PM
Joined: Feb 2004
Posts: 124
T
Vogon poet
Offline
Vogon poet
T
Joined: Feb 2004
Posts: 124
Developer Forum
This forum is for scripters, and for developers of applications that work with mIRC. Feel free to post your ideas, ask questions, and discuss scripting issues here.


I do believe he's making a mirc dll

#70266 04/02/04 01:50 PM
Joined: Mar 2003
Posts: 187
S
Vogon poet
OP Offline
Vogon poet
S
Joined: Mar 2003
Posts: 187
This ia developer forum. I am making a mIRC DLL. And I actually meant to say I want to return the hwnd of the 18th child window...

#70267 04/02/04 02:18 PM
Joined: Feb 2004
Posts: 124
T
Vogon poet
Offline
Vogon poet
T
Joined: Feb 2004
Posts: 124
That's what I said.

#70268 04/02/04 05:51 PM
Joined: Mar 2003
Posts: 187
S
Vogon poet
OP Offline
Vogon poet
S
Joined: Mar 2003
Posts: 187
ok i've scrapped the enumchildwindows idea and gone for a while loop, although im not sure if i'm getting the hwnd i want or not:

counter = 0;

while (counter <= 18) {
child = GetWindow(window,GW_CHILD);

if (IsChild(window,child)) {
GetWindow(child,GW_HWNDNEXT);
counter++;
}
else { counter++; }
}

HDC hdc = GetDC(child);

wsprintf(data,"%d",(INT)child);

return 3;

}

however now that i have that hwnd, i want to get the data it has but i have no idea on how to do it

#70269 06/02/04 02:24 PM
Joined: Nov 2003
Posts: 2,327
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Nov 2003
Posts: 2,327
not that i know much of any language, other than vb.. but wouldn't this still work:

Code:

counter = 0;

while (counter &lt;= 18) {
child = GetWindow(window,GW_CHILD);

if (IsChild(window,child)) {
GetWindow(child,GW_HWNDNEXT);
}
counter++;
}

HDC hdc = GetDC(child);

wsprintf(data,"%d",(INT)child);

return 3;

}


the while loop looks like it will still work and looks cleaner to me


New username: hixxy
#70270 06/02/04 08:11 PM
Joined: Mar 2003
Posts: 187
S
Vogon poet
OP Offline
Vogon poet
S
Joined: Mar 2003
Posts: 187
ive had to scrap this project. i cant get any text from the child hwnd im getting.

#70271 17/02/04 10:02 PM
Joined: Jun 2003
Posts: 195
N
Vogon poet
Offline
Vogon poet
N
Joined: Jun 2003
Posts: 195
actually you were close from the start.

Go back with Enum* and pass your buffer as the LPARAM argument. ie

char buffer[512];
EnumChildWindows(hwnd,(LPARAM)buffer);

your enum proc simply typecasts the lp arg to a char * and you fill it.


Have Fun smile

Link Copied to Clipboard