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.

Author
Message
Big Arth
23
Years of Service
User Offline
Joined: 28th Jan 2003
Location:
Posted: 22nd Oct 2003 06:33
i need to reference the id number of the app instance in dbpro...any 1337 coders out there know of a way?
TheOneRing
22
Years of Service
User Offline
Joined: 28th Aug 2003
Location: Right here.
Posted: 22nd Oct 2003 17:59
If I remember correctly, this code should get the HINSTANCE of an application. It is in C++, and I don't think you could do it easily in DBP.



Hope it helps a little.
Van B
Moderator
23
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 22nd Oct 2003 18:39 Edited at: 22nd Oct 2003 18:42
Check the FindWindow library from the VB6 code I've attached, I reckon DBPro might let you do something similar using User32.dll - good luck.

[EDIT] I reckon OneRing and myself are telling you the same thing, use FindWindow from the User32.dll, you will have to load the dll into DBPro - but I think you should be able to get something working, the actual function call is simple, pass the application window title (from task manager) to the FindWindow function and it returns the ID.


Van-B

empty
23
Years of Service
User Offline
Joined: 26th Aug 2002
Location: 3 boats down from the candy
Posted: 22nd Oct 2003 18:54
It's probably better to use GetActiveWindow instead of FindWindow.
Here's the source.



I awoke in a fever. The bedclothes were all soaked in sweat.
She said "You've been having a nightmare and it's not over yet"
OSX Using Happy Dude
22
Years of Service
User Offline
Joined: 21st Aug 2003
Location: At home
Posted: 22nd Oct 2003 19:26
I've got a plug-in that returns the HINSTANCE value of the running program.


Avatar & Logo by Indi. Insert witty comment here...
CattleRustler
Retired Moderator
22
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 22nd Oct 2003 19:46
a suggested good read is a book by Dan Appleman Guide to the Win32API. This is a plethora of win32 functions found in win dll's that we can all use from dbp by loading the required dll (ie user, kernel, etc)

I have the Visual Basic Programmers Guide To The Win32 API but I am pretty sure there is generic/C++ based version - although either one will explain the functions, their args, and their returns.

-RUST-
Big Arth
23
Years of Service
User Offline
Joined: 28th Jan 2003
Location:
Posted: 29th Oct 2003 09:43
thanks everyone

Login to post a reply

Server time is: 2026-07-26 16:03:03
Your offset time is: 2026-07-26 16:03:03