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 / Rather advanced question - Maybe i should ask Lee

Author
Message
flibX0r
23
Years of Service
User Offline
Joined: 14th Feb 2003
Location: Western Australia
Posted: 18th May 2003 06:51 Edited at: 18th May 2003 06:54
Alright, if you don't know windows programming in C, look away now

And please, no Raven crap

I am making a level editor and i am making some dlls to do the dirty work. But to make it a look like a real windows program, i want to have a real menu, not an emulated one.

Heres the hard bit. How do i access the hWnd (pointer to the window) DBPro creates, and is there anyway of changing which window DBPro renders to?

Anyone got any ideas??? *looks around the forums, nothing but silence*

PS: What is Lee's email address?

"But we couldn't do that Mr Flibble," questioned Rimmer. "Who'd clean up the mess?"
--Twin P4 Xeon 2.0 Ghz, GeForce Quadro4 XGL 128MB, 1Gb DDR RAM, 19" Flat Screen--
Shadow Robert
23
Years of Service
User Offline
Joined: 22nd Sep 2002
Location: Hertfordshire, England
Posted: 18th May 2003 08:36
#include "globstruct.h"
HWND hWnd = g_pGlob->hWnd

you'll find the file you need in [DBP DIR]/HELP/DOCUMENTATION/TPC/TESTCOMMANDS2

i would like to know what you mean by "Raven crap" though

Within the Epic battle of the fates the Shadow and the Angel will meet. With it will harbinger the very fight of good vs evil!
Zep
23
Years of Service
User Offline
Joined: 31st Aug 2002
Location: From PA, USA. Currently reside in Hanoi, Vietnam
Posted: 18th May 2003 11:10
ravencrap="I'm gonna do this and that and then convert that and make a plug in for this and blah blah blah"

Except nothing ever comes of it, but talk.

You asked....


Zep--

Bulleyes
23
Years of Service
User Offline
Joined: 3rd Nov 2002
Location: Cyberjaya, Malaysia
Posted: 18th May 2003 11:57
Hmmm... getting the window handle of your DBpro program is possible, but it must be done in Win API (at least to my knowledge). You can use the function FindWindow() in Win API which take the window caption title as parameter.

> is there anyway of changing which window DBPro renders to?
Nope, I don't think so. Unless you ask Lee to add this function into DBpro, which I doubt he had better things to do now (smashing bugs) rather than adding new function.

Bad Nose Entertainment - Where games are forged from the flames of talent and passion.

http://www.badnose.com/
Rob K
Retired Moderator
23
Years of Service
User Offline
Joined: 10th Sep 2002
Location: Surrey, United Kingdom
Posted: 18th May 2003 12:14 Edited at: 18th May 2003 12:17
@Mr_Fibble

Download my menus plugin > check my sig. It works with DBP apps, but you can use it with any program (just pass the relevant caption to the CREATE MENU command)

To get the Hwnd of the DBP window, I used the FindWindow API:
FindWindow(nil,DBPWindowCaption)

The DBPWindowCaption is the title of your DBP window, which you specify at compile time or using the SET WINDOW TITLE command.

Do you want Windows menus in your DBP apps? - Get my plugin: http://snow.prohosting.com/~clone99/downloads/tpc_menus_102.zip
MrTAToad
23
Years of Service
User Offline
Joined: 26th Aug 2002
Location: United Kingdom
Posted: 18th May 2003 12:38
I tend to use the globstruct.h way...

Good news everyone! I really am THAT good...
http://www.nickk.nildram.co.uk/ for great plug-ins - oh my, yes!
Rob K
Retired Moderator
23
Years of Service
User Offline
Joined: 10th Sep 2002
Location: Surrey, United Kingdom
Posted: 18th May 2003 12:45
That is easier for the end user, but using FindWindow it can be used on other apps beside DBP ones.

Do you want Windows menus in your DBP apps? - Get my plugin: http://snow.prohosting.com/~clone99/downloads/tpc_menus_102.zip
kfoong
23
Years of Service
User Offline
Joined: 28th Jan 2003
Location: Australia
Posted: 18th May 2003 12:50
Rob K i cant download it. It says that it is an html file not a zip...

Quote from my brother:
Quote: " Patience is a virtue... I know that but how does that help me? "

http://www.stellarblue.vze.com/
IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 18th May 2003 13:53
If you are going to use a TPC DLL, then you can use either Ravens or Robs method (Ravens is easier).

If you are going to use the older LOAD DLL method, then only Robs will work for you. Personally though, in this case, I'd use either 'GetActiveWindow' or 'GetForegroundWindow' to get the handle - neither needs arguments, and both look at the current process only.
flibX0r
23
Years of Service
User Offline
Joined: 14th Feb 2003
Location: Western Australia
Posted: 18th May 2003 13:53
Thanks all! now i can do all sorts of cool crap!

And yes Raven, you were helpful. You can put that on your list.

How many are on that list now...Three?

"But we couldn't do that Mr Flibble," questioned Rimmer. "Who'd clean up the mess?"
--Twin P4 Xeon 2.0 Ghz, GeForce Quadro4 XGL 128MB, 1Gb DDR RAM, 19" Flat Screen--
David T
Retired Moderator
23
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 18th May 2003 13:54
Quote: "Rob K i cant download it. It says that it is an html file not a zip..."


Click the link.....

You are the th person to view this signature.
Programmers don't die, they just Gosub without return....
Rob K
Retired Moderator
23
Years of Service
User Offline
Joined: 10th Sep 2002
Location: Surrey, United Kingdom
Posted: 18th May 2003 15:05
Do not "right click and save as", that won't work. You click on the link, click on the link again in the new Window.

Failing that, check the "Windows Menus Plugin" thread in the Program Announcments board, and use the alternate link given in the first post.

Do you want Windows menus in your DBP apps? - Get my plugin: http://snow.prohosting.com/~clone99/downloads/tpc_menus_102.zip
Shadow Robert
23
Years of Service
User Offline
Joined: 22nd Sep 2002
Location: Hertfordshire, England
Posted: 19th May 2003 01:39
list? what list?
you guys seriously confuse me sometimes, ya'll are weird.
and ya know whenever i say i'll make something i always explain what you need to do anyway - so anything i made you just be a working example of what i've already explained.

don't know why people don't just try from the explainations they always sit around waiting for someone to do it first. (your losses i suppose)

that said GetActiveWindow as Ian has said is a good choice as unless you've clicked off of it - it should get the DBpro instance.
though there are alot more reasons to use the global stucture than just getting the hWnd

Within the Epic battle of the fates the Shadow and the Angel will meet. With it will harbinger the very fight of good vs evil!
MrTAToad
23
Years of Service
User Offline
Joined: 26th Aug 2002
Location: United Kingdom
Posted: 19th May 2003 19:53 Edited at: 19th May 2003 19:53
Plus it causes problems if the DLL is used with a non-DBPro program (unless you know the function name), which should be regarded as a good thing.

Good news everyone! I really am THAT good...
http://www.nickk.nildram.co.uk/ for great plug-ins - oh my, yes!

Login to post a reply

Server time is: 2026-07-11 04:22:40
Your offset time is: 2026-07-11 04:22:40