Jump to content
Sign in to follow this  
abc123

Newbie Please Help

Recommended Posts

abc123

1. You know when you exit, it returns a code:

1 = Failed

0 = Succeeded

Is it possible to set custom exit return string e.g. = "Script worked perfectly"?

2. Can i disable the parent window while focused on child window?

Share this post


Link to post
Share on other sites
herewasplato

1. You know when you exit, it returns a code:

1 = Failed

0 = Succeeded

Is it possible to set custom exit return string e.g. = "Script worked perfectly"?

2. Can i disable the parent window while focused on child window?

From this FAQ: http://www.autoitscript.com/forum/index.php?showtopic=37289

Q18. Why isn't my thread getting any replies?

A1. Did you give a good description of the problem? If your title or explanation of the issue is not descriptive, users are likely to bypass your issue instead of helping. Post titles such as "Help Me", "I Have A Problem", "Question", "Help me fix my code", "This code doesn't work" or similarly worded question titles will not readily draw forum users to your post. Experienced users (which are your best hope of resolving the issue) will often skip your post altogether in cases like this. An example of a post title descriptive enough to attract users to assist you is "Problem with WinWaitClose", or "Loop never ends".

A2. Did you post example code? If you have not posted an example of the code you are having an issue with, then you will not recieve support. When posting a non-working script, please do so in the smallest amount of stand-alone code possible. If the code you post cannot run by itself on another person's computer, they will not be able to recreate the issue.


[size="1"][font="Arial"].[u].[/u][/font][/size]

Share this post


Link to post
Share on other sites
Paulie

1. You know when you exit, it returns a code:

1 = Failed

0 = Succeeded

Is it possible to set custom exit return string e.g. = "Script worked perfectly"?

2. Can i disable the parent window while focused on child window?

1.) Yes.

2.) Yes.

Share this post


Link to post
Share on other sites
abc123

#include <GuiConstants.au3>

if $Cmdline[0] then

$GUI = GuiCreate($Cmdline[1], 350, 325, -1, -1, $WS_DLGFRAME+$WS_CLIPCHILDREN, -1, $Cmdline[3])

$Edit_ = GUICtrlCreateEdit($Cmdline[2], 0, 0, 350, 270)

$OK_Btn = GUICtrlCreateButton("OK", 122, 272, 50, 25)

$Cancel_Btn = GUICtrlCreateButton("Cancel", 177, 272, 50, 25)

Else

$GUI = GuiCreate("", 350, 325, -1, -1, $WS_DLGFRAME)

$Edit_ = GUICtrlCreateEdit("", 0, 0, 350, 270)

$OK_Btn = GUICtrlCreateButton("OK", 122, 272, 50, 25)

$Cancel_Btn = GUICtrlCreateButton("Cancel", 177, 272, 50, 25)

EndIf

; GUI MESSAGE LOOP

GuiSetState()

While 1

$msg = GUIGetMsg()

Select

Case $msg = $GUI_EVENT_CLOSE

Exit

Case $msg = $OK_Btn

Exit GUICtrlRead($Edit_)

Case $msg = $Cancel_Btn

Exit

EndSelect

WEnd

Can you please tell me how to do it here is an example for question number 1.

And for question 2 can please write an example for me please!

Thanks in advance!

Share this post


Link to post
Share on other sites
abc123

Anyone please help! :shocked:

Share this post


Link to post
Share on other sites
PsaltyDS

1. You know when you exit, it returns a code:

1 = Failed

0 = Succeeded

Is it possible to set custom exit return string e.g. = "Script worked perfectly"?

2. Can i disable the parent window while focused on child window?

Perhaps some clarity on one point would help: You 'return' from a function, and 'exit' from the script. With that in mind:

1. Script exit codes can only be numbers, not strings. The kind of thing a DOS batch file can test for with %ERRORLEVEL%.

Fuctions, on the other hand, can return almost any single object. A number, a string, and array, etc.

2. Have you written a short script that creates a basic parent and child window, then tried it...? People bend over backwards on this forum to help you learn to do something for yourself. But "...write an example for me please" almost never works. Write your own example, post it even if it doesn't work. Then you'll get lots of help fixing it and learn it in the process.

:shocked:


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

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  

×