Jump to content
Sign in to follow this  

How to create a message box like this?

Recommended Posts


Welcome to the AutoIt forum. :)

Reading the Help file (at least the first few sections - Using AutoIt, Tutorials and the first couple of References) will help you enormously. You should also look at this excellent tutorial - you will find other tutorials in the Wiki (the link is at the top of the page). There are even video tutorials on YouTube if you prefer watching to reading. I know you want to start coding NOW, but a little study will save you a lot of trouble later on, believe me. ;)

Good luck - and you know where we are if you run into problems. But do please search the Help file first - it has most of the answers in there somewhere! :D


Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:


ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area


Share this post

Link to post
Share on other sites

What Melba23 said, plus, if you have trouble coding, then most volunteers/regulars here are only too happy to help, if you provide what you have coded so far.

We help those, who help themselves. Call that our motto or mantra if you like, as it is often a pre-requisite to getting any help ... that and diligently searching both Help file and Forum.

Make sure brain is in gear before opening mouth!
Remember, what is not said, can be just as important as what is said.


What is the Secret Key? Life is like a Donut

If I put effort into communication, I expect you to read properly & fully, or just not comment.
Ignoring those who try to divert conversation with irrelevancies.
If I'm intent on insulting you or being rude, I will be obvious, not ambiguous about it.
I'm only big and bad, to those who have an over-active imagination.

I may have the Artistic Liesense ;) to disagree with you. TheSaint's Toolbox (be advised many downloads are not working due to ISP screwup with my storage)


Share this post

Link to post
Share on other sites

You might want to look in Melba's signature as well for the GUIExtender UDF, though prior knowledge of AutoIt is required.

UDF List:

_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_ArrayFilter/_ArrayReduce_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 22/04/2018

Share this post

Link to post
Share on other sites

Here something you can start with:

#include <GuiRichEdit.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>

Opt("GUIResizeMode", 0)
$hGUI = GUICreate("Test", 440, 306)
$Icon1 = GUICtrlCreateIcon("shell32.dll", -98, 14, 12, 32, 32)
GUICtrlSetResizing (-1, $GUI_DOCKALL)
$Label1 = GUICtrlCreateLabel("Windows has recovered from an unexpected shutdown", 64, 20, 314, 17)
GUICtrlSetResizing (-1, $GUI_DOCKALL)
GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
$Button1 = GUICtrlCreateButton(ChrW(9650), 14, 89, 22, 20)
GUICtrlSetResizing (-1, $GUI_DOCKALL)
GUICtrlSetFont(-1, 9.5, 400, 0, "MS Sans Serif", 4)
$Label2 = GUICtrlCreateLabel("Windows can check online for a solution to the problem.", 64, 48, 269, 17)
GUICtrlSetResizing (-1, $GUI_DOCKALL)
GUICtrlSetFont(-1, 8, 400, 0, "MS Sans Serif")
$Label3 = GUICtrlCreateLabel("Hide problem details", 40, 92, 129, 17)
GUICtrlSetResizing (-1, $GUI_DOCKALL)
$Button2 = GUICtrlCreateButton("Check for solution", 223, 89, 120, 25)
GUICtrlSetResizing (-1, $GUI_DOCKALL)
$Button3 = GUICtrlCreateButton("Cancel", 353, 89, 75, 25)
GUICtrlSetResizing (-1, $GUI_DOCKALL)
$Label4 = GUICtrlCreateLabel("Label4", 0, 130, 446, 2, $SS_ETCHEDHORZ)
GUICtrlSetResizing (-1, $GUI_DOCKALL)
$hRichEdit = _GUICtrlRichEdit_Create($hGUI, "", 16, 144, 409, 153)
_GUICtrlRichEdit_AppendText($hRichEdit, "{\rtf1\utf8\cf1 {\fs18 {\b Problem signature:}\b0}\cf0 \line}")
_GUICtrlRichEdit_InsertText($hRichEdit, " Problem event name:" & @TAB & @TAB & @TAB & "Bluescreen" & @CRLF)
_GUICtrlRichEdit_InsertText($hRichEdit, " OS version:" & @TAB & @TAB & @TAB & @TAB & "6.1.71600." & @CRLF)
_GUICtrlRichEdit_InsertText($hRichEdit, " Locale ID:" & @TAB & @TAB & @TAB & @TAB & "1033")
$bDir = 1

While 1
    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE
        Case $Button1
            $aPos = WinGetPos($hGUI)
            If $bDir = 1 Then
                WinMove($hGUI, "", $aPos[0], $aPos[1], 446, 155)
                $bDir *= -1
                GUICtrlSetData($Button1, ChrW(9660))
                GUICtrlSetData($Label3, "Show problem details")
                WinMove($hGUI, "", $aPos[0], $aPos[1], 446, 306)
                $bDir *= -1
                GUICtrlSetData($Button1, ChrW(9650))
                GUICtrlSetData($Label3, "Hide problem details")


Edited by UEZ

Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Share this post

Link to post
Share on other sites

Sorry, but what I want to know is how to make the form read-only and make the buttons workable. Check for Solution will go to a  website and Cancel will close the gui

Edited by SirDarknight1200

Share this post

Link to post
Share on other sites

Sorry but it doesn't work 

>"H:\Program Files\AutoIt3\SciTE\..\autoit3.exe" /ErrorStdOut "C:\Tonmoy\GUI_err.au3"    
C:\Tonmoy\GUI_err.au3 (27) : ==> Variable used without being declared.:
$hRichEdit = _GUICtrlRichEdit_Create($hGUI, "", 16, 144, 409, 153, BitOR($ES_MULTILINE, $ES_READONLY, $WS_VSCROLL))
$hRichEdit = _GUICtrlRichEdit_Create($hGUI, "", 16, 144, 409, 153, BitOR($ES_MULTILINE, $ES_READONLY, ^ ERROR
>Exit code: 1    Time: 0.333

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  

  • Create New...