Link to home
Start Free TrialLog in
Avatar of vfxyb
vfxyb

asked on

Use Windows DLL

Anyone can tell me how to use MS Windows DLL (for example, i want to shutdown Windows using my Delphi program).
Avatar of Mohammed Nasman
Mohammed Nasman
Flag of Palestine, State of image

Hello

  Delphi made a great job, you can use most of functions of DLL (API) without declare them, they Encapsulate  most of them in delphi units, like windows, messages, and more, but u still could to declare them and use any api function
if you want to shutdown the computer u can simply call the ExitWindowsEx, it found in the windows unit, if you press ctrl and move teh mouse above the ExitWindowsEx, when u see it in blue in underline click the on it by the mouse and it will take u to the windows unit for the declartion


ExitWindowsEx( EWX_FORCE or EWX_SHUTDOWN, 0 );


if you want to see the API reference from delphi help menu, choose windows SDK

Mohammed
Avatar of vfxyb
vfxyb

ASKER

I already read the windows sdk but i still confused is ExitWindowsEx a function in delphi's unit or in user32.dll. If i'm not wrong it's from user32.dll. so it's not a delphi unit. How can i use it?
ASKER CERTIFIED SOLUTION
Avatar of Mohammed Nasman
Mohammed Nasman
Flag of Palestine, State of image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
MS's "Win32 Programmer's Reference" help file, which comes with Delphi, explains the meaning and use of all the API calls.
Avatar of vfxyb

ASKER

thank you for your comment, now i will try it at home. if you have a sample delphi program about using windows dll, please send it to vfxyb@yahoo.com
Thanks
Yopie