Jump to content
Sign in to follow this  
layer

_ShutdownDialog

Recommended Posts

layer

First COM script/UDF comin' through here, make way :(

Well, I was browsing here and decided to try it in AutoIt.

Then, after creating it, it took me about 10 minutes to figure out why it wasn't working. Because I didn't even call the function, I just ran basically nothing :dance:

Anyways, if theres anything wrong with it, let me know, because it's my first COM script...

Thanks :D

Func _ShutdownDialog()
   Local $oShell = ObjCreate ("Shell.Application")
   If @error Then Return 0
   $oShell.ShutdownWindows ()
   Return 1
EndFunc ;==>_ShutdownDialog

Example:

Func _ShutdownDialog()
   Local $oShell = ObjCreate ("Shell.Application")
   If @error Then Return 0
   $oShell.ShutdownWindows ()
   Return 1
EndFunc ;==>_ShutdownDialog

_ShutdownDialog()

Enjoi :dance: (purposley spelt enjoi like that, if you skate, you'd know why :D)

EDIT: Updated the code with w0uters modifications. :whistle:

Edited by layer

FootbaG

Share this post


Link to post
Share on other sites
MHz

Looks quite good, layer. :whistle:

btw. What does $vObjShell do?

Share this post


Link to post
Share on other sites
w0uter

Func _ShutdownDialog()
   Local $o_Shell = ObjCreate ("Shell.Application")
   If @error Then Return 0
   $oShell.ShutdownWindows ()
   Return 1
EndFunc;==>_ShutdownDialog

would be better acording to the helpfile.

Always check on errors using @error after a ObjGet(). Do not use IsObj()

because the object variable will not be assigned a value upon an error.

Edited by w0uter

My UDF's:;mem stuff_Mem;ftp stuff_FTP ( OLD );inet stuff_INetGetSource ( OLD )_INetGetImage _INetBrowse ( Collection )_EncodeUrl_NetStat_Google;random stuff_iPixelSearch_DiceRoll

Share this post


Link to post
Share on other sites
MHz

Func _ShutdownDialog()
   Local $o_Shell = ObjCreate ("Shell.Application")
   If @error Then Return 0
   $oShell.ShutdownWindows ()
   Return 1
EndFunc;==>_ShutdownDialog

would be better acording to the helpfile.

<{POST_SNAPBACK}>

Should not that be Local $oShell = ObjCreate ("Shell.Application") as to the underscore removed?

Share this post


Link to post
Share on other sites
layer

Oops ! Thanks guys :(

@Mhz,

I changed the variable name, and forgot to change the local too :dance: Thanks for pointing that out :dance:

@w0uter,

Thanks for pointing that out, I guess I missed that :"> Thanks for cleaning it up too :D

Thanks guys. Appreciate it ! :whistle:

EDIT: Oh yea, I usually prefer to use no underscore for variables, but like w0uter said, I don't think it matters.

Edited by layer

FootbaG

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×