Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Switch User Trigger
#1
is there a way to trigger a mac when the 'Switch User' button is hit?
I need to kill a process when another user wants on. I also need to trigger a process to start when my side is logged in on.
An old blog on QM coding and automation.

The Macro Hook
#2
Function dialog_switch_user_trigger
Code:
Copy      Help
;A hidden dialog that receives Windows user session notifications.


if(_winver<0x501) ret ;;not on Windows 2000

str dd=
;BEGIN DIALOG
;0 "" 0x80C800C8 0x0 0 0 224 136 "Dialog"
;END DIALOG
;DIALOG EDITOR: "" 0x2040200 "*" "" "" ""

if(!ShowDialog(dd &sub.DlgProc 0 0 128)) ret


#sub DlgProc
function# hDlg message wParam lParam

sel message
,case WM_INITDIALOG
,WTSRegisterSessionNotification hDlg NOTIFY_FOR_THIS_SESSION
,
,case WM_DESTROY
,WTSUnRegisterSessionNotification hDlg
,
,case WM_WTSSESSION_CHANGE
,sel wParam
,,case WTS_CONSOLE_CONNECT
,,out "My session switched on"
,,case WTS_CONSOLE_DISCONNECT
,,out "My session switched off"
,
,case WM_COMMAND ret 1

Also try Windows Task Scheduler triggers 'On [dis]connection to user session'.
#3
I need a mac to kick-in everyday at 8:30 p.m. except Thursday & Friday.
I understand that this should be a trigger/timer but I fail to understand the implementation.
Kindly assist.

Thanks,
Philip
Best Regards,
Philip
#4
Any ideas...
Best Regards,
Philip
#5
-


Attached Files Image(s)
   


Forum Jump:


Users browsing this thread: 1 Guest(s)