Sign in to follow this  
Followers 0

Detect CTRL ALT DEL screen XP Help

13 posts in this topic

Posted (edited)

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

Share this post


Link to post
Share on other sites



Posted

Help :oops:

Share this post


Link to post
Share on other sites

Posted

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

Share this post


Link to post
Share on other sites

Posted

hmm.. wait:(

Share this post


Link to post
Share on other sites

Posted

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

Share this post


Link to post
Share on other sites

Posted

I fail Do you Code Give ?

Share this post


Link to post
Share on other sites

Posted

ByCode122,

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

M23

Share this post


Link to post
Share on other sites

Posted

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

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

Share this post


Link to post
Share on other sites

Posted

Hm..

I know but get one help me Please :oops:

Share this post


Link to post
Share on other sites

Posted

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

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

inefficiency

Share this post


Link to post
Share on other sites

Posted

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

Share this post


Link to post
Share on other sites

Posted

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

Share this post


Link to post
Share on other sites

Posted (edited)

@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

Share this post


Link to post
Share on other sites
This topic is now closed to further replies.
Sign in to follow this  
Followers 0




  • Recently Browsing   0 members

    No registered users viewing this page.