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 / disabling the maximize function on a db window

Author
Message
TheComet
16
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 14th May 2009 21:17
Hello!

How do I disable the middle button of the three buttons on the top right corner, so the user can not maximize the window, but minimize and exit it?

TheComet

Peachy, and the Chaos of the Gems

Latch
17
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 14th May 2009 22:49
The following will deactivate the maximize button:



Enjoy your day.
t10dimensional
15
Years of Service
User Offline
Joined: 22nd Mar 2009
Location: Code Cave, USA
Posted: 15th May 2009 16:55 Edited at: 15th May 2009 16:57
WHen i tryed that code my computer said
Quote: "
Program Error

DB.exe has generated errors and will be closed by Windows. You
will need to restart the program.


An error log is being created
...........................|----------------|
...........................|......(OK).......|
...........................|----------------|
"


Whats wrong with my computer?

If at first you don't succeed-Pause-Go to last checkpoint
Libervurto
17
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 15th May 2009 17:28
Isn't there a SET WINDOW thing that lets you hide the buttons?

Riddle: The more you take, the more you leave behind. What are they? Answer
Caleb1994
15
Years of Service
User Offline
Joined: 10th Oct 2008
Location: The Internet you idiot!
Posted: 15th May 2009 17:30 Edited at: 15th May 2009 17:32
Thats a error in the WinAPI Commands not your computer.



Edit:


Wait nevermind just ran it thats something with your computer.


Hey latch. how do you make it so the button is grayed? cuz right now it just doesn't work.

New Site! Check it out \/
spt games
15
Years of Service
User Offline
Joined: 14th Apr 2009
Location: United Kingdom
Posted: 15th May 2009 17:53
Are you running the Lite version of DB? DB Lite is not compatible with the enhancement pack (See DB Lite info).

This might mean that DLLs cannot be loaded and as a result cause a fatal error. Can anyone confirm this to be true?
Latch
17
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 15th May 2009 18:16
Quote: "Isn't there a SET WINDOW thing that lets you hide the buttons?"

It's an all or nothing command in DBC - set window layout - you can't pick and choose individual buttons.

Quote: "Hey latch. how do you make it so the button is grayed? cuz right now it just doesn't work."


Did you try clicking on the maximize button? It will not let you maximize the screen and then grey out. In order to see the button become grey the window has to be refreshed with the new settings in place.

So, add this command to the end:

RESTORE WINDOW

and the max button will appear grey.





Enjoy your day.
t10dimensional
15
Years of Service
User Offline
Joined: 22nd Mar 2009
Location: Code Cave, USA
Posted: 15th May 2009 18:21 Edited at: 15th May 2009 18:45
IT JUST MADE ME LOSE ALL MY CODE

Alright got my code back

I think it's just my suckey computer it has a old grafics card that

can only do set display mode 640,480,16 and usally thats it.

If at first you don't succeed-Pause-Go to last checkpoint
Latch
17
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 15th May 2009 18:41 Edited at: 15th May 2009 18:44
That's very strange. Anyone else having that problem?

What version of DB are you using, and what version of windows? And are you using DarkEdit or the default black screen editor? I noticed my code vanishes when I use the db editor, but if I move thslider on the side, it all reappears.

Try typing this at the top of a new DB program as the only command

SET WINDOW ON

and press F5

It should open the CLI in windowed mode.

Now type one line at a time from the above program pressing ENTER after each line in the CLI.

You'll know which line is causing the problem after you type it and press enter. Make sure you've saved anything you want to keep in case the bad behaviour returns.

Enjoy your day.
t10dimensional
15
Years of Service
User Offline
Joined: 22nd Mar 2009
Location: Code Cave, USA
Posted: 15th May 2009 18:48 Edited at: 15th May 2009 18:52
SET WINDOW ON

It could not do it.I can only do

SET DISPLAY MODE 640,480,16

is that why

version 1.12

windows 2000 i think

If at first you don't succeed-Pause-Go to last checkpoint
Latch
17
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 15th May 2009 18:54
Do you have a trial version of DB or something? The SET WINDOW ON command shouldn't cause trouble.

And using SET DISPLAY MODE, you should be able to set any display that your graphics card and monitor can handle.

Enjoy your day.
t10dimensional
15
Years of Service
User Offline
Joined: 22nd Mar 2009
Location: Code Cave, USA
Posted: 15th May 2009 19:12 Edited at: 15th May 2009 19:16
I guess I have a terrible graphics card because i can't do 32bits

or almost any other displaye modes.I think I could get a better

graphic card from school they have a bunch of computers they are

thinking of just trashing.

no, I have the full version of db v1.12

If at first you don't succeed-Pause-Go to last checkpoint
Latch
17
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 15th May 2009 19:26
I see. Here, try this screen display mode selector that was written by TDK_Man a few years ago . Though we're getting off topic a bit, you should be able to see all the available scree n modes and be able to click and select one:



Enjoy your day.
Caleb1994
15
Years of Service
User Offline
Joined: 10th Oct 2008
Location: The Internet you idiot!
Posted: 15th May 2009 19:32
WOW! is that windows 98 latch!?


and i forgot about repainting the window lol whoops.

althought the Restore and Minimize window commands never work correctly for me. if i have to do that i use ShowWindow function from winAPI that works nicely

New Site! Check it out \/
TheComet
16
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 15th May 2009 19:35
It worked perfectly for me, thanks Latch!

And while we are at windows, how can I make it that if the window is minimized or behind other windows that it doesn't take up 100% CPU usage?

TheComet

Peachy, and the Chaos of the Gems

Latch
17
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 15th May 2009 19:43
@TheComet

100% CPU usage

Quote: "WOW! is that windows 98 latch!?"

The ideal environment for DarkBASIC Classic! If you have an old machine around, try it out. You'll be amazed at the performance of DB without having to implement any work arounds.

Enjoy your day.
t10dimensional
15
Years of Service
User Offline
Joined: 22nd Mar 2009
Location: Code Cave, USA
Posted: 15th May 2009 19:50
it only works on the ones with 16 on the end and i can only do about half of them

If at first you don't succeed-Pause-Go to last checkpoint
TheComet
16
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 15th May 2009 20:03
@Latch

Wow! I got it down to 12% CPU usage!

Thanks a lot again!!

TheComet

Peachy, and the Chaos of the Gems

Caleb1994
15
Years of Service
User Offline
Joined: 10th Oct 2008
Location: The Internet you idiot!
Posted: 15th May 2009 20:16
That makes sense i geuss sense it was made for 98 right? I think we still have a 98 disk laying around. but no extra computer haha

New Site! Check it out \/
Caleb1994
15
Years of Service
User Offline
Joined: 10th Oct 2008
Location: The Internet you idiot!
Posted: 15th May 2009 20:53 Edited at: 15th May 2009 20:55
OMG! i just tried the System Sleep thing (Hadn't tried yet) i got 1-5 cpu usage and at most a 35 percent spike! dang! thats amzing!


Wow never noticed in the task manager it said how many handles there were.... dange 13643 hahaha erey thing is made oup of those so it's understandable lol


I'm going to watch the number as i close firefox lol

New Site! Check it out \/
Latch
17
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 15th May 2009 21:21
For the 100% CPU cap, I think Benjamin came up with the kernel sleeping method and Robert The Robot tested out different scenarios and put together a nice complete solution for DBC use.

Enjoy your day.
Caleb1994
15
Years of Service
User Offline
Joined: 10th Oct 2008
Location: The Internet you idiot!
Posted: 16th May 2009 00:24
Sweet

All the original questions are answered on this post right? cuz we are off topic i think.

New Site! Check it out \/

Login to post a reply

Server time is: 2024-05-09 18:35:15
Your offset time is: 2024-05-09 18:35:15