Results 1 to 3 of 3

Thread: Accessing system stuff with WinAPI

  1. #1

    Thread Starter
    New Member
    Join Date
    Apr 2001
    Location
    Australia
    Posts
    3

    Smile

    G'day,

    I've built a fairly basic voice activated program using Visual Basic and Microsofts voice stuff. It opens programs and responds to simple voice commands.

    I want to take it to the next level. (Eg; when I'm sleeping and I hear my renderer has finished beeping, I call out for the computer to shut down)

    How do I access these API's?
    Any help would be much appriciated

    - Sentry
    - All your base are belong to us -

  2. #2
    Member
    Join Date
    Feb 2001
    Posts
    52

    Lightbulb system stuff with winap1

    useage:
    to shut down:
    ExitWindowsEx EWX_FORCE Or EWX_SHUTDOWN, 0


    log off
    ExitWindowsEx EWX_FORCE Or EWX_LOGOFF, 0

    reboot
    ExitWindowsEx EWX_FORCE Or EWX_REBOOT, 0

    declares:Public Const SHUT_DOWN_WINDOWS As String = 123
    Public Const RESTART_WINDOWS As String = 789
    Public Const LOGOFF_WINDOWS As String = 456
    Public Declare Sub keybd_event Lib "user32" (ByVal bVk As Byte, ByVal bScan As Byte, ByVal dwFlags As Long, ByVal dwExtraInfo As Long)
    Public Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hWnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
    Public Const EWX_LOGOFF = 0
    Public Const EWX_SHUTDOWN = 1
    Public Const EWX_REBOOT = 2
    Public Const EWX_FORCE = 4
    Public Declare Function ExitWindowsEx Lib "user32" (ByVal uFlags As Long, ByVal dwReserved As Long) As Long
    lxs

  3. #3

    Thread Starter
    New Member
    Join Date
    Apr 2001
    Location
    Australia
    Posts
    3

    Thanks

    Thanks Ixs for the help
    - All your base are belong to us -

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width