Jump to content

Detect CTRL ALT DEL screen XP Help


Recommended Posts

Win7 :

#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_UseUpx=n
#AutoIt3Wrapper_UseX64=n
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
Global Const $EVENT_OPEN_DESKTOP_CHANGED = 0x0020 ; Undocumented? Found by trial&error...[/b]
[b]$h_DLL_User32 = DllOpen("User32.dll")
$h_WinEventHook_Proc = DllCallbackRegister("_WinEventHook_Proc", "none", "hwnd;int;hwnd;long;long;int;int")
If @error Then
    MsgBox(16 + 262144, "Error", "DllCallbackRegister(_WinEventHook_Proc) did not succeed. FFH will exit now.")
    Exit
EndIf
$h_Hook = _WinEventHook_Set(0x0020, 0x0020, $h_DLL_User32)
If @error Then
    MsgBox(16 + 262144, "Error", "_WinEventHook_Set() did not succeed. FFH will exit now.")
    Exit
EndIf
OnAutoItExitRegister("_WinEventHook_UnSet")
#endregion ; WinEventHook[/b]
[b]while 1
    sleep(10)
wend[/b]
[b]#region ; WinEventHook Functions
Func _WinEventHook_Proc($h_Hook, $iEvent, $hWnd, $idObject, $idChild, $iEventThread, $iEventTime)
    ;ConsoleWrite($hWnd & @TAB & $idObject & @CRLF)
MsgBox(0,"","")
EndFunc   ;==>_WinEventHook_Proc[/b]
[b]Func _WinEventHook_Set($iEventMin, $iEventMax, $hDLLUser32)
    Local $aRet
    Local Const $WINEVENT_OUTOFCONTEXT = 0x0
    Local Const $WINEVENT_SKIPOWNPROCESS = 0x2
    If Not $hDLLUser32 Or $hDLLUser32 = -1 Then $hDLLUser32 = "User32.dll"
    $aRet = DllCall($hDLLUser32, "hwnd", "SetWinEventHook", _
            "uint", $iEventMin, _
            "uint", $iEventMax, _
            "hwnd", 0, _
            "ptr", DllCallbackGetPtr($h_WinEventHook_Proc), _
            "int", 0, _
            "int", 0, _
            "uint", $WINEVENT_OUTOFCONTEXT) ; BitOR($WINEVENT_OUTOFCONTEXT, $WINEVENT_SKIPOWNPROCESS)
    If @error Then Return SetError(@error, 0, 0)
    Return $aRet[0]
EndFunc   ;==>_WinEventHook_Set[/b]
[b]Func _WinEventHook_UnSet()
    If $h_WinEventHook_Proc Then
        DllCallbackFree($h_WinEventHook_Proc)
    EndIf
    If $h_Hook Then DllCall($h_DLL_User32, "int", "UnhookWinEvent", "hwnd", $h_Hook)
    If $h_DLL_User32 Then DllClose($h_DLL_User32)
EndFunc   ;==>_WinEventHook_UnSet
#endregion ; WinEventHook Functions[/b]
[b]Func IsDesktopLocked()
    Local $hDesktop
    Local $iRet
    Local $iRC
    Local $sMsg
    Local Const $DESKTOP_SWITCHDESKTOP = 0x100
    $hDesktop = DllCall("User32.dll", "int", "OpenDesktop", "str", "Default", "int", 0, "int", 0, "int", $DESKTOP_SWITCHDESKTOP)
    $iRet = DllCall("User32.dll", "int", "SwitchDesktop", "int", $hDesktop[0])
    If IsArray($iRet) Then
        If $iRet[0] = 0 Then[/b]
[b]         $iRC = 1
        ElseIf $iRet[0] = 1 Then[/b]
[b]         $iRC = 0
        EndIf
    Else[/b]
[b] EndIf
    DllCall("User32.dll", "int", "CloseDesktop", "int", $hDesktop[0]);<-- handle returned by "OpenDesktop"
    ;$iRet = DllCall("User32.dll", "int", "CloseDesktop", "int", $iRet[0])
    Return ($iRC)
EndFunc   ;==>IsDesktopLocked[/b]
[b]Func _Exit()
EndFunc   ;==>_Exit

Windows + L screen XP detecting Code ?

Help:S

Edited by ByCode122
Link to comment
Share on other sites

Please wait at least 24 hours before you bump a thread!

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

As described use the WM_WTSSESSION_CHANGE message because - as stated in the thread - your code only works with Vista+.

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

  • Moderators

ByCode122,

You have already been asked earlier in this very thread not to bump within 24 hours - do NOT do it again. :oops:

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

Again ... this is no 24 hour support forum! Wait till someone answers your question!

I've already given you a good point to start.

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

  • Moderators

ByCode122,

As you seem to be ignoring us, I shall make sure we now ignore you for a while. :bye:

Do NOT start another thread on this before tomorrow or you will be unable to start one for a while. :oops:

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

  • Moderators

ByCode122,

I was going to reopen this thread this morning, but as you have contunually pestered me with PMs since I locked it I am now going to leave it locked. If you do decide to start another thread, please respect the Forum rules on bumping. :bye:

And do NOT send me any more PMs as you are reaching the limits of my patience - which is pretty hard to do. :oops:

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

  • Developers

@bycode122

You seemed to have PMed others as well and this will not be tolerated here as indicated in our forum rules.

You will get a 5 day posting ban and better shape up when you decide to return.

Edited by 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.
  :)

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...