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 / [DBPro 7.7] Is there an external location to grab values from within the Windows environment?

Author
Message
WickedVixen
19
Years of Service
User Offline
Joined: 28th Mar 2007
Location: New Brisbane, Utopia Prime, VGC GHQ
Posted: 21st Feb 2014 19:29
Looking to capture several "outside the app" variable values for creating a few simple programs and allow for the pictures to be saved for later.

Can anyone help me with this?

Windows desktop height, width, depth (as they currently are and not set from within DBPro editor or the app itself).

Poll the 9-pin serial for additional 'joystick' input (if possible) w/o using USB.

There's a few others, but this is just something that's been bothering me for many months. Any help would be appreciated.

Thanks.

All trees have bark. All dogs bark. All dogs are trees.
Rudolpho
20
Years of Service
User Offline
Joined: 28th Dec 2005
Location: Sweden
Posted: 21st Feb 2014 23:20
Well, for the first one that's pretty simple:



But if you have version 7.7, then why not just use the built in functions desktopWidth() and desktopHeight() instead?

As for the second question this is probably possible but it would be extremely round about to do using pure dll calls to the windows api.


"Why do programmers get Halloween and Christmas mixed up?"
WickedVixen
19
Years of Service
User Offline
Joined: 28th Mar 2007
Location: New Brisbane, Utopia Prime, VGC GHQ
Posted: 22nd Feb 2014 01:31
The reason I didn't want to use them was to build a screensaver that doesn't change the dimensions of your desktop to an arbitrary value or to request it from the user on startup.

It's a lot like the 68k Mac stuff, back in the day, that had hooks in the OS for Mac-standard variables (like environment variables in Windows) that THINK! Pascal and the flavors of C it had, too.

Thanks for the info.

Cheers!

All trees have bark. All dogs bark. All dogs are trees.
Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 22nd Feb 2014 01:34
Quote: "why not just use the built in functions desktopWidth() and desktopHeight()"


I think you meant

Quote: "why not just use the built in functions desktop Width() and desktop Height() "


(note the spaces).



Powered by Free Banners
zeroSlave
17
Years of Service
User Offline
Joined: 13th Jun 2009
Location: Springfield
Posted: 22nd Feb 2014 01:45
Also, screen Depth()

Everybody is a genius. But if you judge a fish by its ability to climb a tree, it will live its whole life believing that it is stupid.
Rudolpho
20
Years of Service
User Offline
Joined: 28th Dec 2005
Location: Sweden
Posted: 22nd Feb 2014 01:56
@GG: True enough, too much C++ for me these days

Quote: "Also, screen Depth()"

I wonder how many people use anything but a 32 bit depth today... hehe.


"Why do programmers get Halloween and Christmas mixed up?"
zeroSlave
17
Years of Service
User Offline
Joined: 13th Jun 2009
Location: Springfield
Posted: 22nd Feb 2014 03:14
Quote: "I wonder how many people use anything but a 32 bit depth today"

I like to use it for compatibility sake, but you are very correct.

Everybody is a genius. But if you judge a fish by its ability to climb a tree, it will live its whole life believing that it is stupid.
Mobiius
Valued Member
23
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 22nd Feb 2014 15:14
Quote: "The reason I didn't want to use them was to build a screensaver that doesn't change the dimensions of your desktop to an arbitrary value "

Use a windowed fullscreen app then. Only fullscreen exclusive apps will resize the screen.

Attila
FPSC Reloaded TGC Backer
21
Years of Service
User Offline
Joined: 17th Aug 2004
Location:
Posted: 22nd Feb 2014 16:21
Most of the system-varibales can be obtained by using the DOS-commands.

this is an simple example to get the computers- and the user-name



This will work in DBClassic too, in DBpro im mostly using the matrix utilities to get the values. A list of the posiible variables and values is diplayed when you enter "set" at the DOS-Prompt.
WickedVixen
19
Years of Service
User Offline
Joined: 28th Mar 2007
Location: New Brisbane, Utopia Prime, VGC GHQ
Posted: 23rd Feb 2014 15:38
These are awesome!

I really appreciate all the help.



All trees have bark. All dogs bark. All dogs are trees.
WickedX
17
Years of Service
User Offline
Joined: 8th Feb 2009
Location: A Mile High
Posted: 23rd Feb 2014 17:36 Edited at: 24th Feb 2014 21:28
Nevermind
WickedVixen
19
Years of Service
User Offline
Joined: 28th Mar 2007
Location: New Brisbane, Utopia Prime, VGC GHQ
Posted: 28th Feb 2014 00:00
@Rudolpho: What are the other values that can be read from the user32.dll? I am curious to see what can be accomplished with just this one dynamic link library with a "CALL DLL" command...

All trees have bark. All dogs bark. All dogs are trees.
Rudolpho
20
Years of Service
User Offline
Joined: 28th Dec 2005
Location: Sweden
Posted: 28th Feb 2014 01:20
Quote: "What are the other values that can be read from the user32.dll?"

Far more than I can remember off the top of my head.
Basically I would say if you need some general purpose data there's a 75% chance you can get it from either User32 or Kernel32


"Why do programmers get Halloween and Christmas mixed up?"

Login to post a reply

Server time is: 2026-07-06 10:36:20
Your offset time is: 2026-07-06 10:36:20