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 / CreateWindow in DLL.

Author
Message
Bulleyes
22
Years of Service
User Offline
Joined: 3rd Nov 2002
Location: Cyberjaya, Malaysia
Posted: 7th Mar 2004 15:18
Does anyone ever write a TPC DLL that create a pop up window on top of the DBpro window? I don't really see how I can put the window message pump in the DLL that handles my window event. Thanks!

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

http://www.badnose.com/
Cryptoman
21
Years of Service
User Offline
Joined: 24th Nov 2003
Location: Utah Mountains
Posted: 8th Mar 2004 05:48
The easy way is to make sure your darkbasic program has focus then call "GetActiveWindow" in User32.dll. This will give you the handle to your Darkbasic program. Then you can call the "MessageBox" hWnd, txt$, caption$, typ in User32.dll.
Dave J
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Feb 2003
Location: Secret Military Pub, Down Under
Posted: 8th Mar 2004 06:46
I don't think that's what he wanted to do, but even so, you don't even need to know the HWND, just use NULL.


"Computers are useless they can only give you answers."
Bulleyes
22
Years of Service
User Offline
Joined: 3rd Nov 2002
Location: Cyberjaya, Malaysia
Posted: 8th Mar 2004 19:42
Thanks everyone! I just figured out how. The main window handler and instance handler are all in the global core pointer. I don't even need the message pump, as it will be in your game executable. I just need to hook up my window procedure.

Just if you are curious what am I doing. I actually working on a console window for outputing diagnostic text. Since the DBpro debugger is so buggy, I need to create a way so that I can output some diagnostic text easily. I know there is a PRINT command, but it doesn't work properly as soon as you switch to 3D mode. TEXT command is fine, but I need to specified the X, Y coordinate everytime I need to output a text.

All I have to do right now is,

WRITE CONSOLE "The value of A is " + str$(A)

Then this text will be output to a so-called console window overlapped on top of your game window when you run it. (Of course this can only be used when you are in Non-Exclusive Fullscreen Mode, where most debugging is usually done in this mode.) You don't even need to called SYNC or anything since it is a separate window. (Which you need to if you are using PRINT or TEXT command.)

It is almost ready, I just wanna spice up a little bit with other relevant tools in it to make a complete tools set that is useful for debugging, like log file, prompt message in a message box, etc.

If you feel there are some other useful features that are worth adding in, tell me more and I will see how it can fit in.

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

http://www.badnose.com/

Login to post a reply

Server time is: 2025-06-04 19:39:39
Your offset time is: 2025-06-04 19:39:39