MyTetra Share
Делитесь знаниями!
Useful Windows DLL functions (Kernel32.dll, User32.dll, Advapi32.dll)
Время создания: 23.06.2018 08:36
Текстовые метки: dark basic useful dll functions
Раздел: Dark Basic


FORUM HOMESEARCHPROFILEMESSAGES (0)MY THREADSLOGOUT

developer forums Banner image

DLL Talk / Useful Windows DLL functions (Kernel32.dll, User32.dll, Advapi32.dll)

Author

Message


Wheeler 989

13 YEARS OF SERVICE

User Offline

Joined: 28th Apr 2005

Location:

Earn Badges

Posted: 1st May 2005 03:36 Link

Heres a couple of dll functions for everyone. Including Username, computername, mouse information and processor power(fast or slow)


load dll "User32.dll", 1

CleanBoot = call dll(1, "GetSystemMetrics", 67)

MouseWheel = call dll(1, "GetSystemMetrics", 19)

MouseButtonsCount = call dll(1, "GetSystemMetrics", 43)

MouseButtonsInverted = call dll(1, "GetSystemMetrics", 23)

SlowProcessor = call dll(1, "GetSystemMetrics", 73)

delete dll 1

load dll "advapi32.dll", 1

NameSize = make memory(4)

*NameSize = 255

UserName$ = space$( *NameSize )

result = call dll(1, "GetUserNameA", UserName$, NameSize)

delete memory NameSize

delete dll 1

load dll "Kernel32.dll", 1

NameSize = make memory(4)

*NameSize = 255

ComputerName$ = space$( *NameSize )

result = call dll(1, "GetComputerNameA", ComputerName$, NameSize)

WindowsDir$ = space$( *NameSize )

result = call dll(1, "GetWindowsDirectoryA", WindowsDir$, NameSize)

delete memory NameSize

delete dll 1


print "Username: ";UserName$

print "Computername: ";ComputerName$

print "Windows Directory: ";WindowsDir$

`print "Local Time: ";LocalTime$

if SlowProcessor = 0 then print "Computer has a fast processor"

if SlowProcessor <> 0 then print "Computer has a slow processor"

if CleanBoot = 0 then print "The computer booted normally"

if CleanBoot = 1 then print "The computer booted into Safe mode"

if CleanBoot = 2 then print "The computer booted into Safe mode with networking"

if MouseButtonsInverted = 0 then print "Mouse Buttons Inverted: false"

if MouseButtonsInverted = 1 then print "Mouse Buttons Inverted: true"

if MouseWheel = 0 then print "Mouse Wheel Detected: false"

if MouseWheel = 1 then print "Mouse Wheel Detected: true"

print "Mouse Buttons Count: ";MouseButtonsCount

wait key

+ Code Snippet


load dll "User32.dll", 1

CleanBoot = call dll(1, "GetSystemMetrics", 67)

MouseWheel = call dll(1, "GetSystemMetrics", 19)

MouseButtonsCount = call dll(1, "GetSystemMetrics", 43)

MouseButtonsInverted = call dll(1, "GetSystemMetrics", 23)

SlowProcessor = call dll(1, "GetSystemMetrics", 73)

delete dll 1

load dll "advapi32.dll", 1

NameSize = make memory(4)

*NameSize = 255

UserName$ = space$( *NameSize )

result = call dll(1, "GetUserNameA", UserName$, NameSize)

delete memory NameSize

delete dll 1

load dll "Kernel32.dll", 1

NameSize = make memory(4)

*NameSize = 255

ComputerName$ = space$( *NameSize )

result = call dll(1, "GetComputerNameA", ComputerName$, NameSize)

WindowsDir$ = space$( *NameSize )

result = call dll(1, "GetWindowsDirectoryA", WindowsDir$, NameSize)

delete memory NameSize

delete dll 1

print "Username: ";UserName$

print "Computername: ";ComputerName$

print "Windows Directory: ";WindowsDir$

`print "Local Time: ";LocalTime$

if SlowProcessor = 0 then print "Computer has a fast processor"

if SlowProcessor <> 0 then print "Computer has a slow processor"

if CleanBoot = 0 then print "The computer booted normally"

if CleanBoot = 1 then print "The computer booted into Safe mode"

if CleanBoot = 2 then print "The computer booted into Safe mode with networking"

if MouseButtonsInverted = 0 then print "Mouse Buttons Inverted: false"

if MouseButtonsInverted = 1 then print "Mouse Buttons Inverted: true"

if MouseWheel = 0 then print "Mouse Wheel Detected: false"

if MouseWheel = 1 then print "Mouse Wheel Detected: true"

print "Mouse Buttons Count: ";MouseButtonsCount

wait key


Post any useful functions that you use in your games and apps.

EddieB

13 YEARS OF SERVICE

User Offline

Joined: 29th Sep 2004

Location: United Kingdom

Earn Badges

Posted: 2nd May 2005 13:51 Edited at: 3rd Jun 2005 08:53 Link

That is very neat


Of course Mine said Computer has a fast processor lol


Thanks for this

Eddie

This thread has not been posted in for more than 90 days and has been locked!


Server time is: 2018-06-23 04:30:21

Your offset time is: 2018-06-23 15:30:21

© Copyright 2018

Acceptable Usage Policy

Так же в этом разделе:
 
MyTetra Share v.0.53
Яндекс индекс цитирования