sprinter26 Posted May 6, 2008 Posted May 6, 2008 Hi, Iam a new user in Autoit and I have a question : With what script I can make a program that shows before the computers shutdowns a message ?? And how i can make a program that start himself as the cumputer starts up ?? ( sorry for my bad english ) Thanks, Sprinter26
covaks Posted May 6, 2008 Posted May 6, 2008 For your first question, you can do this in gpedit.msc. Windows Settings > Scripts. Your second question is answered in the FAQ. Q11
sprinter26 Posted May 6, 2008 Author Posted May 6, 2008 Hi, yes that works but it is not in Autoit v3 , and I want to make in in Autoit V3. Thanks for your fast reply.
Zedna Posted May 6, 2008 Posted May 6, 2008 With what script I can make a program that shows before the computers shutdowns a message ??RegWrite & HKEY_CURRENT_USER or HKEY_LOCAL_MACHINE \Software\Microsoft\Windows\CurrentVersion\RunSearch forum for detailsAnd how i can make a program that start himself as the cumputer starts up ??Make your script to run all the time and useGUIRegisterMsg & WM_ENDSESSIONLook at MSDN for details Resources UDF ResourcesEx UDF AutoIt Forum Search
sprinter26 Posted May 6, 2008 Author Posted May 6, 2008 Hi, thank for your reply. I can't find a topic about : RegWrite & HKEY_CURRENT_USER or HKEY_LOCAL_MACHINE \Software\Microsoft\Windows\CurrentVersion\Run Iam a new user of AutoIt , can you tell it me better ?? ( in script what I can use ) Thanks,
Zedna Posted May 6, 2008 Posted May 6, 2008 To set: RegWrite('HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run','Your App Name','REG_SZ',@ScriptDir & '\YourAppName.exe') To reset: RegDelete('HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run','Your App Name') Resources UDF ResourcesEx UDF AutoIt Forum Search
sprinter26 Posted May 6, 2008 Author Posted May 6, 2008 To set: RegWrite('HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run','Your App Name','REG_SZ',@ScriptDir & '\YourAppName.exe') To reset: RegDelete('HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run','Your App Name') Hi, this script open a program, i need au3 script , you open the au3 file and the program( the au3 script ) minimize, than when the computer shutdown, the program( au3 script ) shows you a message, and the computer shutdown. thanks
ChrisL Posted May 6, 2008 Posted May 6, 2008 Try this for the shutdown message $WM_QUERYENDSESSION = 0x0011 GUICreate("ShutDownNotificationGui") GUIRegisterMsg($WM_QUERYENDSESSION, "_ShutdownInitiated") GUISetSTate(@SW_HIDE) While 1 sleep(10) WEnd Func _ShutdownInitiated($hWndGUI, $MsgID, $WParam, $LParam) Msgbox(0,"","Shutting down") Return True EndFunc [u]Scripts[/u]Minimize gui to systray _ Fail safe source recoveryMsgbox UDF _ _procwatch() Stop your app from being closedLicensed/Trial software system _ Buffering Hotkeys_SQL.au3 ADODB.Connection _ Search 2d Arrays_SplashTextWithGraphicOn() _ Adjust Screen GammaTransparent Controls _ Eventlogs without the crap_GuiCtrlCreateFlash() _ Simple Interscript communication[u]Websites[/u]Curious Campers VW Hightops Lambert Plant Hire
Zedna Posted May 6, 2008 Posted May 6, 2008 Try this for the shutdown message $WM_QUERYENDSESSION = 0x0011 GUICreate("ShutDownNotificationGui") GUIRegisterMsg($WM_QUERYENDSESSION, "_ShutdownInitiated") GUISetSTate(@SW_HIDE) While 1 sleep(10) WEnd Func _ShutdownInitiated($hWndGUI, $MsgID, $WParam, $LParam) Msgbox(0,"","Shutting down") Return True EndFunc WM_QUERYENDSESSION is called also in case of user log-off so you must distinguish "kind of event" inside your function. Resources UDF ResourcesEx UDF AutoIt Forum Search
ProgAndy Posted May 6, 2008 Posted May 6, 2008 (edited) Its quite easy, just look at MSDN:http://msdn.microsoft.com/en-us/library/aa376890(VS.85).aspxlParam This parameter can be one or more of the following values. If this parameter is 0, the system is shutting down or restarting (it is not possible to determine which event is occurring)....lParam If this parameter is zero, the system is shutting down or restarting (it is not possible to determine which event is occurring). Edited May 6, 2008 by ProgAndy *GERMAN* [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes
sprinter26 Posted May 6, 2008 Author Posted May 6, 2008 Its quite easy, just look at MSDN:http://msdn.microsoft.com/en-us/library/aa376890(VS.85).aspxHi, I have look it and it is for my not easycan you make a simple script for my ??? Thanks for all the reply's
ProgAndy Posted May 6, 2008 Posted May 6, 2008 I copied the important parts to the forum lParam If this parameter is zero, the system is shutting down or restarting (it is not possible to determine which event is occurring).$WM_QUERYENDSESSION = 0x0011 GUICreate("ShutDownNotificationGui") GUIRegisterMsg($WM_QUERYENDSESSION, "_ShutdownInitiated") GUISetSTate(@SW_HIDE) While 1 sleep(10) WEnd Func _ShutdownInitiated($hWndGUI, $MsgID, $WParam, $LParam) If $WParam = 0 Then Msgbox(0,"","Shutting down") If BitAnd($WParam,0x80000000) = 0x80000000 Then Msgbox(0,"","logging off") Return True EndFunc *GERMAN* [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes
sprinter26 Posted May 7, 2008 Author Posted May 7, 2008 I copied the important parts to the forum $WM_QUERYENDSESSION = 0x0011 GUICreate("ShutDownNotificationGui") GUIRegisterMsg($WM_QUERYENDSESSION, "_ShutdownInitiated") GUISetSTate(@SW_HIDE) While 1 sleep(10) WEnd Func _ShutdownInitiated($hWndGUI, $MsgID, $WParam, $LParam) If $WParam = 0 Then Msgbox(0,"","Shutting down") If BitAnd($WParam,0x80000000) = 0x80000000 Then Msgbox(0,"","logging off") Return True EndFunc Hi, Thanks it works !!! I have 1 problem : as the computer shutdown, you see very fast the message ( 1/2 second ) can you make it longer ( 5 second ) ?? Thanks
sprinter26 Posted May 8, 2008 Author Posted May 8, 2008 Hi, can you change the background color of the message box into red ?? Thanks
Rex Posted May 19, 2008 Posted May 19, 2008 Hi, can you change the background color of the message box into red ??ThanksTry to read the help file.In there u will finde all the info u need about msg box's/Rex
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