Results 1 to 5 of 5

Thread: Very basic windows programming help...

  1. #1
    Senior Member SilentDeath's Avatar
    Join Date
    Aug 2003
    Posts
    4,745
    Thanks
    38
    Thanked
    16 times in 11 posts

    Very basic windows programming help...

    Id like to make a program, which will lock a windows 2k/xp machine as if you had just dont ctrl+alt+del and enter.. and then exit.

    Im not sure if there is a win api command for it (dont seem to have the latest win32 api help).

    I think it has to be done by telling windows that those keys have been pressed?

    I know a bit of delphi or msvc++6, which would be easyer to do it in?

  2. #2
    Taz
    Taz is offline
    Senior Member Taz's Avatar
    Join Date
    Jan 2005
    Location
    London
    Posts
    2,117
    Thanks
    55
    Thanked
    26 times in 25 posts
    • Taz's system
      • Motherboard:
      • Gigabyte Z270 HD3P
      • CPU:
      • Intel Core i5 7600K
      • Memory:
      • Corsair CMK16GX4M2B3200C16R Vengeance LPX 16 GB
      • Storage:
      • Samsung 960 EVO M.2-2280 500GB (PCIe) + 1TB Sandisk Ultra II SSD (SATA)
      • Graphics card(s):
      • Asus NVIDIA GeForce GTX 1070 OC
      • PSU:
      • Corsair CS550M 550W Hybrid
      • Case:
      • NZXT Source 340
      • Operating System:
      • Windows 10 Pro
      • Monitor(s):
      • 34" Asus Designo Curve MX34VQ UWQHD Monitor
      • Internet:
      • Virgin Media Vivid 200
    Okay, there's a really easy way to do this without writing a program:

    Create a shortcut on your desktop (right-click...etc.)
    Enter the following as the program to run for the shortcut:

    rundll32.exe user32.dll, LockWorkStation

    Call the shortcut anything you like. Then double click on it to lock your machine.

    I know you want to write a program to do this so maybe someone can convert the above into a C or C++ program? It looks like you need to call the LockWorkStation function in user32.dll.

  3. #3
    Senior Member SilentDeath's Avatar
    Join Date
    Aug 2003
    Posts
    4,745
    Thanks
    38
    Thanked
    16 times in 11 posts
    perfect

    knowing how it can be done is good. Looks very easy to add into a program but for now a shortcut will do.

    Im going to one day set up a spare pc to go infront of the tv so having a way to lock from the remote is why I need it.

    Ive yet to work out how to unlock from the remote (ati remote wonder) as it doesnt have a keyboard and while pc is locked, no input device can control it apart from keyboard.. but thats not much of a problem..

  4. #4
    Senior Members' Member Matt1eD's Avatar
    Join Date
    Feb 2005
    Location
    London
    Posts
    2,462
    Thanks
    0
    Thanked
    0 times in 0 posts
    • Matt1eD's system
      • Motherboard:
      • MSI K9N6SGM-V GeForce 6100
      • CPU:
      • Athlon 64 LE-1620 2.41GHz
      • Memory:
      • 2 GB DDR2
      • Storage:
      • 1.25 TB
      • Graphics card(s):
      • Onboard
      • PSU:
      • eBuyer Extra Value 500W!
      • Operating System:
      • XP Pro
    I love you Taz.

    Thin Clients @ School..... to lower bandwidth from having locked computers, blocked in AD. I do this and it locks it fine.

    Thankyou

  5. #5
    Senior Members' Member Matt1eD's Avatar
    Join Date
    Feb 2005
    Location
    London
    Posts
    2,462
    Thanks
    0
    Thanked
    0 times in 0 posts
    • Matt1eD's system
      • Motherboard:
      • MSI K9N6SGM-V GeForce 6100
      • CPU:
      • Athlon 64 LE-1620 2.41GHz
      • Memory:
      • 2 GB DDR2
      • Storage:
      • 1.25 TB
      • Graphics card(s):
      • Onboard
      • PSU:
      • eBuyer Extra Value 500W!
      • Operating System:
      • XP Pro

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 63
    Last Post: 14-11-2011, 09:17 AM
  2. FYI: No Service Pack 5 for Windows 2000
    By Paul Adams in forum Software
    Replies: 7
    Last Post: 01-12-2004, 03:03 PM
  3. Windows XP Email?
    By joshwa in forum Software
    Replies: 9
    Last Post: 18-01-2004, 09:38 AM
  4. Windows Update flaw 'left PCs open' to MSBlast
    By Bunjiweb in forum Software
    Replies: 10
    Last Post: 19-08-2003, 02:44 PM

Posting Permissions

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