Jump to content

An alternative to MsgBox() function


kcvinu
 Share

Recommended Posts

_MsgBox("Hello There World")

Func _MsgBox($msg, $title = StringMid(@ScriptName, StringInStr(@ScriptName, "\", 0, -1) + 1), $flag = 0)
    Return MsgBox($flag, $title, $msg)
EndFunc

AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Link to comment
Share on other sites

Hi 

JohnOne, Are you searching for a "" in script name ?
Spoiler

My Contributions

Glance GUI Library - A gui library based on Windows api functions. Written in Nim programming language.

UDF Link Viewer   --- A tool to visit the links of some most important UDFs 

 Includer_2  ----- A tool to type the #include statement automatically 

 Digits To Date  ----- date from 3 integer values

PrintList ----- prints arrays into console for testing.

 Alert  ------ An alternative for MsgBox 

 MousePosition ------- A simple tooltip display of mouse position

GRM Helper -------- A littile tool to help writing code with GUIRegisterMsg function

Access_UDF  -------- An UDF for working with access database files. (.*accdb only)

 

Link to comment
Share on other sites

_MsgBox("Hello There World")

Func _MsgBox($msg, $title = StringMid(@ScriptName, StringInStr(@ScriptName, "\", 0, -1) + 1), $flag = 0)
    Return MsgBox($flag, $title, $msg)
EndFunc

 

May be like this no ?

_MsgBox("Hello There World")

Func _MsgBox($msg, $title = StringLeft ( @ScriptName, StringInStr ( @ScriptName, ".", 0, -1 ) - 1 ), $flag = 0)
    Return MsgBox($flag, $title, $msg)
EndFunc

AutoIt 3.3.14.2 X86 - SciTE 3.6.0WIN 8.1 X64 - Other Example Scripts

Link to comment
Share on other sites

 

Hi 

JohnOne, Are you searching for a "" in script name ?

 

Yes, the last one, and everything after that is the filename, whether is has dots, and with or without extension.

 

May be like this no ?

_MsgBox("Hello There World")

Func _MsgBox($msg, $title = StringLeft ( @ScriptName, StringInStr ( @ScriptName, ".", 0, -1 ) - 1 ), $flag = 0)
    Return MsgBox($flag, $title, $msg)
EndFunc

:) Same horse, different jockey.

Edited by JohnOne

AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Link to comment
Share on other sites

stuff that may help more than the scriptname

$Clock = TimerInit()

For $i = 1 to 3
    _mbox ("Test Message String on line " & @ScriptLineNumber & " loop number " & $i)
    _mbox ("Test Message String on line " & @ScriptLineNumber & " loop number " & $i)
    _mbox ("Test Message String on line " & @ScriptLineNumber & " loop number " & $i)
Next



Func _mbox($msg)
msgbox(0,  TimerDiff($Clock) & "  Function on line " & @ScriptLineNumber , $msg)
EndFunc
Edited by boththose

,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-.
|(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/
(_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_)
| | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) (
| | | | |)| | \ / | | | | | |)| | `--. | |) \ | |
`-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_|
'-' '-' (__) (__) (_) (__)

Link to comment
Share on other sites

here an "unnerving" variant
it will disturb you till you will click OK

:pirate:

_MsgBox()

Func _MsgBox($msg = "Pause", $title = StringMid(@ScriptName, StringInStr(@ScriptName, "\", 0, -1) + 1), $flag = 0, $out = 0)
    Do
        $out = MsgBox($flag, $title, $msg, 2)
    Until 1 = $out
    Return $out
EndFunc   ;==>_MsgBox
Edited by Chimp

 

image.jpeg.9f1a974c98e9f77d824b358729b089b0.jpeg Chimp

small minds discuss people average minds discuss events great minds discuss ideas.... and use AutoIt....

Link to comment
Share on other sites

Hi 

Chimp, Ha ha... yes.. it is an unnerving... :) But it is blinking in each second.

Edited by kcvinu
Spoiler

My Contributions

Glance GUI Library - A gui library based on Windows api functions. Written in Nim programming language.

UDF Link Viewer   --- A tool to visit the links of some most important UDFs 

 Includer_2  ----- A tool to type the #include statement automatically 

 Digits To Date  ----- date from 3 integer values

PrintList ----- prints arrays into console for testing.

 Alert  ------ An alternative for MsgBox 

 MousePosition ------- A simple tooltip display of mouse position

GRM Helper -------- A littile tool to help writing code with GUIRegisterMsg function

Access_UDF  -------- An UDF for working with access database files. (.*accdb only)

 

Link to comment
Share on other sites

 

@

Valuater, This is my fist step in the UDF world. I know, i need to learn more. Thanks for the suggestion. :)

 

@

gil900, Actually, This is the first time i met  _WinAPI_ShowMsg. I don't know anything about it.

 

I also - Not long ago I met this function.

I recommend you to read all the _WinAPI_* functions. It's like a new world.

It's a shame(I hope that "shame" is the correct word) that most of these functions are without examples.

Link to comment
Share on other sites

Hഇ 

gil900, I will. I hope you can help me when i face an obstacle in this area. I mean _WinAPI_ functions. :)
Spoiler

My Contributions

Glance GUI Library - A gui library based on Windows api functions. Written in Nim programming language.

UDF Link Viewer   --- A tool to visit the links of some most important UDFs 

 Includer_2  ----- A tool to type the #include statement automatically 

 Digits To Date  ----- date from 3 integer values

PrintList ----- prints arrays into console for testing.

 Alert  ------ An alternative for MsgBox 

 MousePosition ------- A simple tooltip display of mouse position

GRM Helper -------- A littile tool to help writing code with GUIRegisterMsg function

Access_UDF  -------- An UDF for working with access database files. (.*accdb only)

 

Link to comment
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
 Share

×
×
  • Create New...