Two Plus Two Older Archives  

Go Back   Two Plus Two Older Archives > Internet Gambling > Software

Reply
 
Thread Tools Display Modes
  #1  
Old 06-29-2005, 05:03 PM
BradleyT BradleyT is offline
Senior Member
 
Join Date: Dec 2003
Location: Milwaukee
Posts: 512
Default vb.net win32Api enumchildwindows help

I can get ENUMWINDOWS to work and give me a list of all available windows and their title text. However I can't get ENUMCHILDWINDOWS to work. All examples I see are vb6 and don't convert to vb.net. I'm an asp.net (using vb.net) programmer so I never have to deal with callback functions or win32APIs so I'm lost here.

All I need to do is pass it a known hwnd (say PokerStars.exe) and it gives me the handles for all of the childs. Sounds easy but it's not for a dummy like me.

If anyone has some sample code that works I'd greatly appreciate it.
Reply With Quote
  #2  
Old 06-29-2005, 05:15 PM
Vern Vern is offline
Member
 
Join Date: Feb 2004
Posts: 46
Default Re: vb.net win32Api enumchildwindows help

Don't use child window, use thread window

Use GetProcessByName to get the process ID ex: "PokerStars"
Use GetWindowThreadProcessID to get the main processes window thread ID
Then use EnumThreadWindows with that Process ID to generate a callback you can capture all the sub window handles from.

Vern

P.S. Win32 API calls suck [img]/images/graemlins/smile.gif[/img]
Reply With Quote
  #3  
Old 06-29-2005, 06:18 PM
OrcaDK OrcaDK is offline
Member
 
Join Date: Nov 2004
Posts: 42
Default Re: vb.net win32Api enumchildwindows help

[DllImport("User32.dll")]
static extern Boolean EnumChildWindows(int hWndParent,PChildCallBack lpEnumFunc,int lParam);

delegate bool PChildCallBack(int hWnd,int lParam);

private bool EnumChildWindowCallBack(int hwnd, int lParam)
{
// Do some crazy stuff in here
}

--

Call EnumChildWindows like this:
EnumChildWindows(windowHandle, new PChildCallBack(EnumChildWindowCallBack), intSomeInteger);

intSomeInteger can be any integer value, might be an ID of the owner window f.example.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 05:25 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.