sc4ry Posted July 3, 2009 Posted July 3, 2009 Hey, is it possible, to catch the combo of WIN + L (which locks directly the PC)? It want to do a function before the PC really is locked ... after this i can call another function which locks the pc after that. have anyone an idea? i found a reg-hack, but im not able to write this into the registry, so that wont work. thank you for your help.
Developers Jos Posted July 3, 2009 Developers Posted July 3, 2009 Hey, is it possible, to catch the combo of WIN + L (which locks directly the PC)?It want to do a function before the PC really is locked ... after this i can call another function which locks the pc after that.have anyone an idea?i found a reg-hack, but im not able to write this into the registry, so that wont work.thank you for your help...and why do you need this type of function? SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past.
sc4ry Posted July 3, 2009 Author Posted July 3, 2009 nothing illegal =) ok, here we go. we got a tel-client on work. there we have the posibility to say we are active or in pause. we should do pause when we are not at our desk. because i forgot every time to change in pause-mode, i want to write a tool, which automate this. i always lock my pc, when im not at my desk. but the client does not change automativcly to pause-mode when pc is locked ... so i have to catch the combo of WIN + L, set client in pause-mode and the lock my pc.
Yashied Posted July 3, 2009 Posted July 3, 2009 nothing illegal =) ok, here we go. we got a tel-client on work. there we have the posibility to say we are active or in pause. we should do pause when we are not at our desk. because i forgot every time to change in pause-mode, i want to write a tool, which automate this. i always lock my pc, when im not at my desk. but the client does not change automativcly to pause-mode when pc is locked ... so i have to catch the combo of WIN + L, set client in pause-mode and the lock my pc.#Include <HotKey.au3> Global Const $VK_ESCAPE = 0x1B Global Const $VK_L = 0x4C _HotKeyAssign(BitOR($CK_WIN, $VK_L), 'MyFunc') _HotKeyAssign(BitOR($CK_CONTROL, $VK_ESCAPE), 'Quit') While 1 Sleep(100) WEnd Func MyFunc() MsgBox(0, '', 'WIN-L has been pressed!') DllCall('user32.dll', 'int', 'LockWorkStation') EndFunc ;==>MyFunc Func Quit() Exit EndFunc ;==>Quit HotKey.au3 My UDFs: iKey | FTP Uploader | Battery Checker | Boot Manager | Font Viewer | UDF Keyword Manager | Run Dialog Replacement | USBProtect | 3D Axis | Calculator | Sleep | iSwitcher | TM | NetHelper | File Types Manager | Control Viewer | SynFolders | DLL Helper Animated Tray Icons UDF Library | Hotkeys UDF Library | Hotkeys Input Control UDF Library | Caret Shape UDF Library | Context Help UDF Library | Most Recently Used List UDF Library | Icons UDF Library | FTP UDF Library | Script Communications UDF Library | Color Chooser UDF Library | Color Picker Control UDF Library | IPHelper (Vista/7) UDF Library | WinAPI Extended UDF Library | WinAPIVhd UDF Library | Icon Chooser UDF Library | Copy UDF Library | Restart UDF Library | Event Log UDF Library | NotifyBox UDF Library | Pop-up Windows UDF Library | TVExplorer UDF Library | GuiHotKey UDF Library | GuiSysLink UDF Library | Package UDF Library | Skin UDF Library | AITray UDF Library | RDC UDF Library Appropriate path | Button text color | Gaussian random numbers | Header's styles (Vista/7) | ICON resource enumeration | Menu & INI | Tabbed string size | Tab's skin | Pop-up circular menu | Progress Bar without animation (Vista/7) | Registry export | Registry path jumping | Unique hardware ID | Windows alignment More...
Developers Jos Posted July 3, 2009 Developers Posted July 3, 2009 Not sure you can avoid it from locking the PC, but you should be able to capture the keys pressed with _IsPressed() and maybe you can still use Ctrl???() functions to update the telnet screen even though its locked. Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past.
KaFu Posted July 3, 2009 Posted July 3, 2009 Exactly what I just wanted to say ... OS: Win10-22H2 - 64bit - German, AutoIt Version: 3.3.16.1, AutoIt Editor: SciTE, Website: https://funk.eu AMT - Auto-Movie-Thumbnailer (2024-Oct-13) BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Oct-13) HMW - Hide my Windows (2024-Oct-19) HRC - HotKey Resolution Changer (2012-May-16) ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2024-Oct-20) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16)
sc4ry Posted July 3, 2009 Author Posted July 3, 2009 thank your very much yashied ... thats what i need =) i wrote this function before with an own hotkey, but its better for me, when WIN + L (also) switch the client in pause mode. very nice, big thx
sc4ry Posted July 4, 2009 Author Posted July 4, 2009 hi, im again with another question. its something nice to have, but not a must ... what is, when a user lock the pc via CTRL+ALT+DEL and LOCK PC? i dont think i can use this hotkey-funktion, because CTRL+ALT+DELETE ist not the hotkey, my script should work with ... only if in this screen the LOCK PC button was clicked. can i here also do a function before the pc is really locked?
Yashied Posted July 4, 2009 Posted July 4, 2009 hi, im again with another question.its something nice to have, but not a must ... what is, when a user lock the pc via CTRL+ALT+DEL and LOCK PC?i dont think i can use this hotkey-funktion, because CTRL+ALT+DELETE ist not the hotkey, my script should work with ... only if in this screen the LOCK PC button was clicked.can i here also do a function before the pc is really locked?You can NOT lock CTRL-ALT-DEL in Windows XP and above. My UDFs: iKey | FTP Uploader | Battery Checker | Boot Manager | Font Viewer | UDF Keyword Manager | Run Dialog Replacement | USBProtect | 3D Axis | Calculator | Sleep | iSwitcher | TM | NetHelper | File Types Manager | Control Viewer | SynFolders | DLL Helper Animated Tray Icons UDF Library | Hotkeys UDF Library | Hotkeys Input Control UDF Library | Caret Shape UDF Library | Context Help UDF Library | Most Recently Used List UDF Library | Icons UDF Library | FTP UDF Library | Script Communications UDF Library | Color Chooser UDF Library | Color Picker Control UDF Library | IPHelper (Vista/7) UDF Library | WinAPI Extended UDF Library | WinAPIVhd UDF Library | Icon Chooser UDF Library | Copy UDF Library | Restart UDF Library | Event Log UDF Library | NotifyBox UDF Library | Pop-up Windows UDF Library | TVExplorer UDF Library | GuiHotKey UDF Library | GuiSysLink UDF Library | Package UDF Library | Skin UDF Library | AITray UDF Library | RDC UDF Library Appropriate path | Button text color | Gaussian random numbers | Header's styles (Vista/7) | ICON resource enumeration | Menu & INI | Tabbed string size | Tab's skin | Pop-up circular menu | Progress Bar without animation (Vista/7) | Registry export | Registry path jumping | Unique hardware ID | Windows alignment More...
sc4ry Posted July 4, 2009 Author Posted July 4, 2009 i dont want to lock this kombo, i only want to do my function (set tel-client in pause) when a user lock the pc via ctrl+alt+del.
Yashied Posted July 4, 2009 Posted July 4, 2009 i dont want to lock this kombo, i only want to do my function (set tel-client in pause) when a user lock the pc via ctrl+alt+del.You can define CTRL-ALT-DEL as a hot key, but stop the Windows Task Manager does not turn out. I'm sorry. _HotKeyAssign(BitOR($CK_CONTROL, $CK_ALT, $VK_DELETE), 'MyFunc') My UDFs: iKey | FTP Uploader | Battery Checker | Boot Manager | Font Viewer | UDF Keyword Manager | Run Dialog Replacement | USBProtect | 3D Axis | Calculator | Sleep | iSwitcher | TM | NetHelper | File Types Manager | Control Viewer | SynFolders | DLL Helper Animated Tray Icons UDF Library | Hotkeys UDF Library | Hotkeys Input Control UDF Library | Caret Shape UDF Library | Context Help UDF Library | Most Recently Used List UDF Library | Icons UDF Library | FTP UDF Library | Script Communications UDF Library | Color Chooser UDF Library | Color Picker Control UDF Library | IPHelper (Vista/7) UDF Library | WinAPI Extended UDF Library | WinAPIVhd UDF Library | Icon Chooser UDF Library | Copy UDF Library | Restart UDF Library | Event Log UDF Library | NotifyBox UDF Library | Pop-up Windows UDF Library | TVExplorer UDF Library | GuiHotKey UDF Library | GuiSysLink UDF Library | Package UDF Library | Skin UDF Library | AITray UDF Library | RDC UDF Library Appropriate path | Button text color | Gaussian random numbers | Header's styles (Vista/7) | ICON resource enumeration | Menu & INI | Tabbed string size | Tab's skin | Pop-up circular menu | Progress Bar without animation (Vista/7) | Registry export | Registry path jumping | Unique hardware ID | Windows alignment More...
sc4ry Posted July 4, 2009 Author Posted July 4, 2009 ok, i can do my function when ctrl+alt+del is pressed and set it back, if the user do not want to lock the pc ... but when i catch ctrl+alt+del, how can i return to the normal screen, which appears? (lock pc, change user, task manager, logoff, change pw, ...)
Yashied Posted July 4, 2009 Posted July 4, 2009 (edited) ok, i can do my function when ctrl+alt+del is pressed and set it back, if the user do not want to lock the pc ... but when i catch ctrl+alt+del, how can i return to the normal screen, which appears? (lock pc, change user, task manager, logoff, change pw, ...)Well, if you need to track the closing session, it can be done much easier. Global Const $WM_QUERYENDSESSION = 0x0011 GUICreate('') GUIRegisterMsg($WM_QUERYENDSESSION, 'WM_QUERYENDSESSION') While 1 Sleep(1000) WEnd Func WM_QUERYENDSESSION($hWnd, $iMsg, $wParam, $lParam) ; Do something SoundPlay(@WindowsDir & '\media\tada.wav', 1) Return 'GUI_RUNDEFMSG' EndFunc ;==>WM_QUERYENDSESSION EDIT: Add here the previous example for lock the computer (Win-L) and get what you need. Edited July 4, 2009 by Yashied My UDFs: iKey | FTP Uploader | Battery Checker | Boot Manager | Font Viewer | UDF Keyword Manager | Run Dialog Replacement | USBProtect | 3D Axis | Calculator | Sleep | iSwitcher | TM | NetHelper | File Types Manager | Control Viewer | SynFolders | DLL Helper Animated Tray Icons UDF Library | Hotkeys UDF Library | Hotkeys Input Control UDF Library | Caret Shape UDF Library | Context Help UDF Library | Most Recently Used List UDF Library | Icons UDF Library | FTP UDF Library | Script Communications UDF Library | Color Chooser UDF Library | Color Picker Control UDF Library | IPHelper (Vista/7) UDF Library | WinAPI Extended UDF Library | WinAPIVhd UDF Library | Icon Chooser UDF Library | Copy UDF Library | Restart UDF Library | Event Log UDF Library | NotifyBox UDF Library | Pop-up Windows UDF Library | TVExplorer UDF Library | GuiHotKey UDF Library | GuiSysLink UDF Library | Package UDF Library | Skin UDF Library | AITray UDF Library | RDC UDF Library Appropriate path | Button text color | Gaussian random numbers | Header's styles (Vista/7) | ICON resource enumeration | Menu & INI | Tabbed string size | Tab's skin | Pop-up circular menu | Progress Bar without animation (Vista/7) | Registry export | Registry path jumping | Unique hardware ID | Windows alignment More...
Yashied Posted July 4, 2009 Posted July 4, 2009 Here is another useful function. Global Const $DESKTOP_SWITCHDESKTOP = 0x0100 Func _IsWorkstationLocked() Local $Result = False $hDesktop = DllCall('user32.dll', 'hwnd', 'OpenDesktop', 'str', 'Default', 'int', 0, 'int', 0, 'int', $DESKTOP_SWITCHDESKTOP) If Not @error Then $Result = DllCall('user32.dll', 'int', 'SwitchDesktop', 'hwnd', $hDesktop[0]) $Result = Not $Result[0] DllCall('user32.dll', 'int', 'CloseDesktop', 'hwnd', $hDesktop[0]) EndIf Return $Result EndFunc ;==>_IsWorkstationLocked My UDFs: iKey | FTP Uploader | Battery Checker | Boot Manager | Font Viewer | UDF Keyword Manager | Run Dialog Replacement | USBProtect | 3D Axis | Calculator | Sleep | iSwitcher | TM | NetHelper | File Types Manager | Control Viewer | SynFolders | DLL Helper Animated Tray Icons UDF Library | Hotkeys UDF Library | Hotkeys Input Control UDF Library | Caret Shape UDF Library | Context Help UDF Library | Most Recently Used List UDF Library | Icons UDF Library | FTP UDF Library | Script Communications UDF Library | Color Chooser UDF Library | Color Picker Control UDF Library | IPHelper (Vista/7) UDF Library | WinAPI Extended UDF Library | WinAPIVhd UDF Library | Icon Chooser UDF Library | Copy UDF Library | Restart UDF Library | Event Log UDF Library | NotifyBox UDF Library | Pop-up Windows UDF Library | TVExplorer UDF Library | GuiHotKey UDF Library | GuiSysLink UDF Library | Package UDF Library | Skin UDF Library | AITray UDF Library | RDC UDF Library Appropriate path | Button text color | Gaussian random numbers | Header's styles (Vista/7) | ICON resource enumeration | Menu & INI | Tabbed string size | Tab's skin | Pop-up circular menu | Progress Bar without animation (Vista/7) | Registry export | Registry path jumping | Unique hardware ID | Windows alignment More...
sc4ry Posted July 5, 2009 Author Posted July 5, 2009 hey, i dont get, what these function do =) but to explain, when i use ctrl+alt+del, not the taskmanager appears, but a windows which name is "window security". however ... when i catch ctrl+alt+del and set my tel-client to pause, how can i get the "window security" screen? windows disalow to send ctrl+alt+del by any program. is there a dll call, which can open the window security screen?
Yashied Posted July 6, 2009 Posted July 6, 2009 _IsWorkstationLocked() returns True, if the workstation is locked (Win-L), False - otherwise. You can call this function in a loop, and if it returns True, then user pressed the Win-L or has other means, such as CTRL-ALT-DEL - Shut Down - Switch User. My UDFs: iKey | FTP Uploader | Battery Checker | Boot Manager | Font Viewer | UDF Keyword Manager | Run Dialog Replacement | USBProtect | 3D Axis | Calculator | Sleep | iSwitcher | TM | NetHelper | File Types Manager | Control Viewer | SynFolders | DLL Helper Animated Tray Icons UDF Library | Hotkeys UDF Library | Hotkeys Input Control UDF Library | Caret Shape UDF Library | Context Help UDF Library | Most Recently Used List UDF Library | Icons UDF Library | FTP UDF Library | Script Communications UDF Library | Color Chooser UDF Library | Color Picker Control UDF Library | IPHelper (Vista/7) UDF Library | WinAPI Extended UDF Library | WinAPIVhd UDF Library | Icon Chooser UDF Library | Copy UDF Library | Restart UDF Library | Event Log UDF Library | NotifyBox UDF Library | Pop-up Windows UDF Library | TVExplorer UDF Library | GuiHotKey UDF Library | GuiSysLink UDF Library | Package UDF Library | Skin UDF Library | AITray UDF Library | RDC UDF Library Appropriate path | Button text color | Gaussian random numbers | Header's styles (Vista/7) | ICON resource enumeration | Menu & INI | Tabbed string size | Tab's skin | Pop-up circular menu | Progress Bar without animation (Vista/7) | Registry export | Registry path jumping | Unique hardware ID | Windows alignment More...
sc4ry Posted July 6, 2009 Author Posted July 6, 2009 ok, thank you, but my problem is, when pc is locked (and i get it via these function), i cannot do the mouseclicks and controlsend to pause the tel-client ;-) so that seems no option for me?! but do you know, how i can call the "windows-security" screen, which appears on network-devices, when you push ctrl+alt+del?
sc4ry Posted July 6, 2009 Author Posted July 6, 2009 i read, that windows does not allow to simulate ctrl+alt+del ... but i think that must not needed, because only a dllcall could be used to get the windows-security-screen. i also use Real VNC and there is the possibility, to send ctrl+alt+del to the host system. so it must be possible =) please help =)
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now