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 Discussion / getting info from exit button?

Author
Message
Caleb1994
17
Years of Service
User Offline
Joined: 10th Oct 2008
Location: The Internet you idiot!
Posted: 20th Mar 2009 00:42
is there anyway through a dll call or something to get the state of the exit button in windowed mode?

so if something isn't saved you can say its not and ask to save before closing.

New Site! Check it out \/
That1Smart Guy
17
Years of Service
User Offline
Joined: 26th Feb 2009
Location: Somewhere...... yep
Posted: 20th Mar 2009 02:29 Edited at: 20th Mar 2009 02:34
id just use a flag such as:



i know theyrs a lot left 4 u to figure out but im working so i dont have time to think
Latch
19
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 20th Mar 2009 02:44
Or perhaps,
Use a message box instead and get the return value of the button:



Enjoy your day.
That1Smart Guy
17
Years of Service
User Offline
Joined: 26th Feb 2009
Location: Somewhere...... yep
Posted: 20th Mar 2009 02:46
**** i wish i understood half of ur last 2 examples, latch
Latch
19
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 20th Mar 2009 02:59
Well this one loads a DLL


The user32=1 is just so it's easy to keep track of the dll and what number it is assigned. So dll 1 is the user32 - I can see that just by looking at the variable name. If I had 100s of dlls, I wouldn't know what dll 1 was from dll 95, so I make the variable reflective of the actual dll name.

This command from inside the Function messagebox

is thactual call to the Windows messagebox function. The hwnd identifies the DBC window, the lptext$ is a string that contains the message we want displayed, lpcaption$ is the title that will show on the message box, and utype is the type of buttons to display on the message box.



I send the parameters to my function. bt has a value that means add a yes and a no button to the message box. I had to look this value up. Once the values are sent to the parameters, I call the dll function and it makes the message box. When a button is clicked, a numeric value is returned to the result variable.

That's how it works. Make any sense?

Enjoy your day.
That1Smart Guy
17
Years of Service
User Offline
Joined: 26th Feb 2009
Location: Somewhere...... yep
Posted: 20th Mar 2009 03:04
more so, but ive never used or read tutorials for DLLs before so im still not very understanding of them, but the rest is pretty clear
Caleb1994
17
Years of Service
User Offline
Joined: 10th Oct 2008
Location: The Internet you idiot!
Posted: 20th Mar 2009 03:13 Edited at: 20th Mar 2009 03:14
Not exactly what i was asking.


i was wondering if you could get the state of the X button at the rop right of the window.

i know how to call a message box from user32 lol thats easy. but thnks anyways.

New Site! Check it out \/
Latch
19
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 20th Mar 2009 03:22
Ohhh I thought you meant the EXIT PROMPT box that you can add to DBC apps.

Enjoy your day.
That1Smart Guy
17
Years of Service
User Offline
Joined: 26th Feb 2009
Location: Somewhere...... yep
Posted: 20th Mar 2009 03:23
just do something like this (yes more fill in the blanks, but i dont have enough info to fill em in):

Caleb1994
17
Years of Service
User Offline
Joined: 10th Oct 2008
Location: The Internet you idiot!
Posted: 20th Mar 2009 03:30
Latch:

nah that doesn't really do that much hahaha

that1smartguy:

the problem is the "fill in the blank" part is the part i don't know hahaha

New Site! Check it out \/
Latch
19
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 20th Mar 2009 03:43
You'd want to retrieve the WM_CLOSE command. Once you get this command, you'd know to start your cleanup - confirm closing down the application, saving unsaved data etc. But the only way I can think of getting it is by subclassing the window. Maybe try GetMessage or PeekMessage.

Enjoy your day.
That1Smart Guy
17
Years of Service
User Offline
Joined: 26th Feb 2009
Location: Somewhere...... yep
Posted: 20th Mar 2009 03:43
ill tell u but i need some info 1st, is the buton a sprite all by itself or i it part of a larger sprite, if its pasted or drawn, what are the coordinates of the top left corner and wat r the dimmensions?
Caleb1994
17
Years of Service
User Offline
Joined: 10th Oct 2008
Location: The Internet you idiot!
Posted: 20th Mar 2009 06:48 Edited at: 20th Mar 2009 07:02
@smart guy

no i mean the windows button. the one thats on all windows windows wait that sounds weird lol but the one on all the windows FORMS there thats better. i didn't make it.


@latch

ok thank you i didn't even know where to start that will help thanks!


Edit:

ok i found peek and get message. but how do i know if the window is in the "threads message queue" or how do i add it.

and am i supposed to pass values into the function from the memblock(pointer to msg structure) or is it just to receive stuff?

New Site! Check it out \/
That1Smart Guy
17
Years of Service
User Offline
Joined: 26th Feb 2009
Location: Somewhere...... yep
Posted: 20th Mar 2009 18:50
ok i lost u, i thot u were trying to make ur own fake windows window (ur right that does sound weird), but i guess not so nvm then.
Quirkyjim
17
Years of Service
User Offline
Joined: 18th Oct 2008
Location: At my computer
Posted: 20th Mar 2009 22:24
Yeah, he's using calls to the Windows API.

~QJ
That's what they WANT you to think...
Caleb1994
17
Years of Service
User Offline
Joined: 10th Oct 2008
Location: The Internet you idiot!
Posted: 20th Mar 2009 22:38
That one smart guy:

sorry for the mixup

QuirkyJim:


ya cuz in windowed mode i can't find a way to get the X button on the top right of the windows state(clicked or not) and do something then close it.

i'm researching the calls latch suggested. hopefully something will turn up

New Site! Check it out \/
Quirkyjim
17
Years of Service
User Offline
Joined: 18th Oct 2008
Location: At my computer
Posted: 21st Mar 2009 01:41
Sucks for me, cus with ?Vista? sumthing or other, the form bar is over the top of the DirectX window.

~QJ
That's what they WANT you to think...
Latch
19
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 21st Mar 2009 01:48
@Caleb
What about using
SET WINDOW LAYOUT 0,0,0

and drawing your own title bar? That way you can use your own buttons and have your app respond how you want while still maintaining windowed mode. In fact, that would make using popup menus more practical than a Windows fixed menu bar - because you wouldn't be able to draw your own titlebar if you included a standard menu.

Enjoy your day.
Caleb1994
17
Years of Service
User Offline
Joined: 10th Oct 2008
Location: The Internet you idiot!
Posted: 21st Mar 2009 07:58
True i might try that thanks latch

New Site! Check it out \/
TheComet
18
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 21st Mar 2009 17:38
When you click the exit or X button in windowed mode, it does the same as pressing escape. So at the start of your program use disable escapekey.

Then, further on, check if the user wants to exit with if escapekey()=1.

Is that what you wanted?

TheComet

Peachy, and the Chaos of the Gems

Caleb1994
17
Years of Service
User Offline
Joined: 10th Oct 2008
Location: The Internet you idiot!
Posted: 21st Mar 2009 18:46
i've tried disabling escapekey it doesn't work in the computer they do the samething but they are differentbuttons

New Site! Check it out \/

Login to post a reply

Server time is: 2026-07-21 19:08:33
Your offset time is: 2026-07-21 19:08:33