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.

Newcomers DBPro Corner / Is there a DLL shut off your computer?

Author
Message
Agent766
17
Years of Service
User Offline
Joined: 23rd Dec 2006
Location: Even I don\'t know.
Posted: 27th Dec 2006 00:55
I'm making a password program that starts up with your computer so you can only get in with the right password?

Her's my code:


Also tell me if you can find any errors.

There are 3 kinds of people: Ones who can count, and ones who can't.

Did you know four out of five people have trouble with fractions?
Big Man
19
Years of Service
User Offline
Joined: 4th Feb 2005
Location: BEHIND YOU!!!! (but I live in England)
Posted: 27th Dec 2006 15:35
nope looks ok to me but the only thing i will say is that the disable system keys will only work with windows 98 and below but not win xp.

BM

Our aim is to keep the loo's clean, your aim can help.

TDK
Retired Moderator
22
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 27th Dec 2006 16:59
There's a ExitWindows API function in User32.dll.

TDK_Man

Agent766
17
Years of Service
User Offline
Joined: 23rd Dec 2006
Location: Even I don\'t know.
Posted: 27th Dec 2006 17:42
The Disable Windows Keys works with me as far as I know. If it doesn't I'll just make no username or password and you have press escape to get in.

TDK_Man. I have to get the upgrade for DBC to handle
dlls. can you modify my code with the DLL in? I don't really know how to do it.

There are 3 kinds of people: Ones who can count, and ones who can't.

Did you know five out of four people have trouble with fractions?
SimSmall
20
Years of Service
User Offline
Joined: 7th Aug 2004
Location: United Kingdom
Posted: 27th Dec 2006 21:30 Edited at: 27th Dec 2006 21:32
Quote: "Is there a DLL shut off your computer?"


Yes, there is .... msgina.dll
not easy to use mind you... but it exists in your system32 folder
I'm not going to tell you how to do it... that's for you to learn... but the answer is in that dll file

and here's an exe that uses it... using it will shutdown your computer... really

Attachments

Login to view attachments
Xenocythe
19
Years of Service
User Offline
Joined: 26th May 2005
Location: You Essay.
Posted: 27th Dec 2006 22:31
Ahh, the wonders of User32

-Mansoor Siddiquie

vibe runner
18
Years of Service
User Offline
Joined: 7th Aug 2006
Location: The Future
Posted: 28th Dec 2006 08:05
Is there a list of the functions contained in User32.DLL?

Are they all callable from DBPro if you put U32 in the user folder of DBP?

TDK
Retired Moderator
22
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 28th Dec 2006 13:47 Edited at: 29th Dec 2006 03:25
Quote: "I have to get the upgrade for DBC to handle dlls."


Doh! As you didn't say what you were using, we assumed it was DBPro.

That's why this exists:

http://forum.thegamecreators.com/?m=forum_view&t=23169&b=7

People really, really, really should read stickies!

All it needs is [DBC] or [DBP] in the post title so others will know what you are using and adjust their answers accordingly.

Try executing the file Shutdown.exe with:

Execute File "Shutdown.exe", "C:\Windows\System32",1

I've not tested it but it should work - in XP at least.

Quote: "Is there a list of the functions contained in User32.DLL?"


Yes - just Google "API User32.dll" (or whatever). But you'll find the majority of info is for either C++ or VB and you'll have to figure out what to do. I suggest you concentrate on the VB sites as they will be easier to convert to using with DB.

Quote: "Are they all callable from DBPro if you put U32 in the user folder of DBP?"


No need - it's in a Windows system folder so Windows (and therefore DB) automatically knows where it is. Just put "User32.dll" and DB will find it.

TDK_Man

Cash Curtis II
19
Years of Service
User Offline
Joined: 8th Apr 2005
Location: Corpus Christi Texas
Posted: 29th Dec 2006 21:32
Quote: "'m making a password program that starts up with your computer so you can only get in with the right password?"

Honestly, Windows does this already, and in the most secure manner available. I can only think of malevolent reasons to want to do this.


Come see the WIP!
GMan
18
Years of Service
User Offline
Joined: 16th Sep 2006
Location: TEXAS
Posted: 30th Dec 2006 19:23
You really should just allow windows to handle your password, (although there are simple ways to get around it...)

If your really want to I'm sure the DLL is the best way to go. However, just to throw other options out there. There is a 'command prompt' command that will shutdown your comp. It might be useful because it allows you to display a message to the user and set a countdown timer until the comp will shutdown allowing the user to save data so they won't lose anything. It also allows you to log off, or restart the comp instead of shuting down.

To access command prompt, click 'START > RUN : "command" '
type "shutdown" press enter. Don't worry, doing that wont start the shutdown, it will print all the info on the command to the screen.

for example: typing "shutdown -s -t 30" will shutdown your computer in 30 seconds. To use this in your program simply open notepad and type the "shutdown -s blablabla" in notepad and save it as "whatever.bat" then you can execute the batch file from your program.

NOTE: after the shutdown counter starts you can type "shutdown -a" to abort it.
-----------------------------------------------------------------

Just for fun, try typing "shutdown -s -t 10" and see if you can type "shutdown -a" before the timer runs out, LOL.

The right man in the wrong place can make all the difference in the world.

Login to post a reply

Server time is: 2024-11-26 05:47:19
Your offset time is: 2024-11-26 05:47:19