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 / Is it possibe to use windows api with dark basic pro

Author
Message
Terabyte
23
Years of Service
User Offline
Joined: 28th Dec 2002
Location: UK
Posted: 1st Apr 2003 10:16
^ its just that i would like to have windows style buttons on my games. could i do this by calling widnows api dll's. or is it that you just cant do anything to do with windows whilst using direct x. Please dont reply telling me how to make my own buttons!! i know how to imitate windows style buttons. but the code to do this is rather lengthy.
I have a word of advice...
..don't piss on an electric fence!
MrTAToad
23
Years of Service
User Offline
Joined: 26th Aug 2002
Location: United Kingdom
Posted: 1st Apr 2003 10:20
People are currently working on it. Its not easy as DBPro doesn't allow callback functions.

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: 1st Apr 2003 13:51
Though one could possibly write a DLL to interface between the Windows API and DBPro. I am working on and off a GUI DLL, so if it gets anywhere I'll let you know.

Actually, all that needs to happen is you create and maintain the menu / button objects inside the loaded DLL and just apply them to the Window (get it using FindWindow and SetMenu for the menus for example).

Current Project: Retro Compo. Entry.
Terabyte
23
Years of Service
User Offline
Joined: 28th Dec 2002
Location: UK
Posted: 1st Apr 2003 18:03
ok then [img][/img]

I have a word of advice...
..don't piss on an electric fence!
Rob K
Retired Moderator
23
Years of Service
User Offline
Joined: 10th Sep 2002
Location: Surrey, United Kingdom
Posted: 1st Apr 2003 23:07
Grrr... dammit, does anyone know how to implement windows messages in DBPro? - I need to process WM_COMMAND to find out when a menu item has been clicked.

Current Project: Retro Compo. Entry.
HAL
23
Years of Service
User Offline
Joined: 28th Aug 2002
Location:
Posted: 1st Apr 2003 23:34
Rob K, me too i just can't work-out how to do it. i tried lots of functions to return any kind of message, but nothing seems to work.
GuySavoie
23
Years of Service
User Offline
Joined: 26th Aug 2002
Location:
Posted: 1st Apr 2003 23:45
Do some research on subclassing. If you subclass your DBPro window, you can trap the Windows messages in your DLL.

It still doesn't clear up the DX redraw issues, though. Those will be dealt with through later additions to DBPro.

The Wendigo
23
Years of Service
User Offline
Joined: 13th Sep 2002
Location: A hole near the base of a tree in the US
Posted: 1st Apr 2003 23:54
I have a listbox and a command button that work and return values in a single line of code. Does that help??

RESULT = Button(ButtonID, SpriteID, buttonx, buttony, imgButtonUp, imgButtonDown, imgButtonHover)

you just put it in your main loop and watch it go . If you guys want my "VGUI" as I call it. let me know!

1.00 GHZ processor, 256 MB RAM, GeForce 3 64MB, SB Live!, 8 cans of soda per day
IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 2nd Apr 2003 00:07
Rob, Guys suggestion is the way to go. Have a look at 'SetWindowLong' on msdn to see how to assign your own WndProc to the DBPro window handle. You'll be suprised at how easy it is.
minkus
23
Years of Service
User Offline
Joined: 18th Jan 2003
Location: My House
Posted: 2nd Apr 2003 05:04
without at dll, you could do a "mouseover" function (make it up yourself), to make a flashy change when the mouse is over it (change the sprite, etc.), and within that make an "if mouseclick" thing to do what the button says it does, but a window without a dll, you would have to have 4 variables:

top_left_x
top_right_y
bottom_left_x
bottom_right_y

and if the mouse is within those variables, you track mousemovey() and mousemovex(), you increase and decrease those varaibles as the mouse moves if the clicker is down, and position the sprite/bitmap where the new top_left_x is and the new top_left_y is...

They say I'm crazy
but I'm actually REALLY crazy

Login to post a reply

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