Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / Finding a Windows Name

Author
Message
GIDustin
18
Years of Service
User Offline
Joined: 30th May 2008
Location:
Posted: 26th Aug 2012 00:13 Edited at: 26th Aug 2012 00:15
I am trying to design my game to run alongside another program that I did not write and the source and author are not available. The information I need from that program is in the title bar. So, I was thinking that every second or so, I loop all the available windows looking for that one, and parsing data from the title text. Works in theory, not in practice.

Here is what I have so far. It is supposed to loop all the windows after the current, and then all the ones before the current one, and run CheckWindowName() on the window's title text. It is crashing while running Result = CALL DLL(DLL_User32,"GetNextWindow",Handle,2).
Any Suggestions?

Andrew_Neale
16
Years of Service
User Offline
Joined: 3rd Nov 2009
Location: The Normandy SR-2
Posted: 26th Aug 2012 02:03 Edited at: 26th Aug 2012 02:04
The DLL calls should be:
Result = CALL DLL(DLL_User32,"GetWindow",Handle,2)
Result = CALL DLL(DLL_User32,"GetWindow",Handle,3)

Source: http://social.msdn.microsoft.com/Forums/en-US/vbgeneral/thread/5badcf2a-328e-4f47-97d6-080fb7c7c325/

[Edit]Just so you know, I tested it with that change and it worked fine. [/Edit]


Previously TEH_CODERER.
MrValentine
AGK Backer
15
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 26th Aug 2012 02:19
or use STYXs window functions...

GIDustin
18
Years of Service
User Offline
Joined: 30th May 2008
Location:
Posted: 26th Aug 2012 03:23
Quote: "Just so you know, I tested it with that change and it worked fine. "


Yup. That seems to have fixed the problem. Thanks!
Andrew_Neale
16
Years of Service
User Offline
Joined: 3rd Nov 2009
Location: The Normandy SR-2
Posted: 26th Aug 2012 13:31
No problem.


Previously TEH_CODERER.

Login to post a reply

Server time is: 2026-07-23 02:36:42
Your offset time is: 2026-07-23 02:36:42