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.

DLL Talk / Retrieving Program's window handle

Author
Message
REJLA
20
Years of Service
User Offline
Joined: 8th Nov 2004
Location:
Posted: 9th Nov 2004 21:52
I've been trying to use the Windows Api with darkbasic pro. bu i noticed that many of them require for the current program's window handle to be passed as an argument.

To get the window handle i use the folloing code



This code requires for the program's window to be the one focused.
Althogh this might be true for most case it is not for certain.

Is there a better way to do this?.

It is logic to choose with your heart
CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 9th Nov 2004 22:25
theres probably an api to get the hwnd from the window name/text.


DBP_NETLIB_v1.4.3 DarkTOPIA site coming soon!
OSX Using Happy Dude
21
Years of Service
User Offline
Joined: 21st Aug 2003
Location: At home
Posted: 9th Nov 2004 23:56 Edited at: 9th Nov 2004 23:56
You should always used the one in g_pGlob (g_pGlob->hWnd). Whilst GetActiveWindow works, it is slow (and why call a function to get a windows handle when its already present? Unless, your not doing a plug-in).

Walk softly... and carry a big gun...
the_winch
21
Years of Service
User Offline
Joined: 1st Feb 2003
Location: Oxford, UK
Posted: 10th Nov 2004 02:09
You can use FindWindow instead.



Quote: "this is not a quote"
Shadow Robert
22
Years of Service
User Offline
Joined: 22nd Sep 2002
Location: Hertfordshire, England
Posted: 10th Nov 2004 03:12 Edited at: 10th Nov 2004 03:12
or



so many ways to do one thing


IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 10th Nov 2004 04:31
Get it from DBPro:



*** Coming soon - Network Plug-in - Check my site for info ***
For free Plug-ins, source and the Interface library for Visual C++ 6, .NET and now for Dev-C++ http://www.matrix1.demon.co.uk

Login to post a reply

Server time is: 2024-11-21 14:26:39
Your offset time is: 2024-11-21 14:26:39