Masum

Move MsgBox Function

3 posts in this topic

#1 ·  Posted (edited)

Hi all,

Can this function be modified to support  @CRLF in the MsgBox's text?

; Move Message Box
; Author - herewasplato

_MoveMsgBox(0, "testTitle", "testText", 0, 10)

Func _MoveMsgBox($MBFlag, $MBTitle, $MBText, $x, $y)
    Local $file = FileOpen(EnvGet("temp") & "\MoveMB.au3", 2)
    If $file = -1 Then Return;if error, give up on the move
    
    Local $line1 = 'AutoItSetOption(' & '"WinWaitDelay", 0' & ')'
    Local $line2 = 'WinWait("' & $MBTitle & '", "' & $MBText & '")'
    Local $line3 = 'WinMove("' & $MBTitle & '", "' & $MBText & '"' & ', ' & $x & ', ' & $y & ')'
    FileWrite($file, $line1 & @CRLF & $line2 & @CRLF & $line3)
    FileClose($file)
    
    Run(@AutoItExe & " /AutoIt3ExecuteScript " & EnvGet("temp") & "\MoveMB.au3")
    
    MsgBox($MBFlag, $MBTitle, $MBText)
    
    FileDelete(EnvGet("temp") & "\MoveMB.au3")
EndFunc;==>_MoveMsgBox

 Thanks

Edited by Masum

Share this post


Link to post
Share on other sites



Masum,

Or perhaps use my ExtMsgBox UDF (the link is in my sig) which allows you to place the ExtMsgBox where you wish - and interrupt it with a HotKey.

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

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

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

  • Similar Content

    • mati
      By mati
      Hi,
      I wonder if
      AutoIt3Wrapper_run_debug_mode = Y can include run information about functions which are called within the main code. So far I noticed in the console that the function itself is called but no specific run information from  inside the function is provided. Is there a chance to show the entire debug log including functions in the console?
      I furthermore noticed a stop of information when a loop is entered. What could be the reason for that?
       
      Thanks for help.
    • Nareshm
      By Nareshm
      I have autoit script like this :
      winActivate ("BillReceipt") ControlClick ( "BillReceipt", "", "[NAME:winviewer]", "right") Send ( "{ENTER}") WinWait ("Print") ControlClick ("Print", "", "[CLASS:Button; INSTANCE:13]") Winwait ("Save As") WinActivate ("Save As") Send ("{TAB 5} {Backspace} ^v {Enter}") I need Saved successfully msgbox with file name as i saved like Filename.extension (Example = test.pdf is saved successfull)

      Please Help
    • TrashBoat
      By TrashBoat
      Is this possible:
      Executing a function from an include, but taking the function name from a gui input and then executing that function using the include:
      #include <Something.au3> ;input reads "Tree" $functionName = GuiCtrlRead($input1) $functionName(1) And the include is gonna have
      Func Tree($x) If $x = 1 Then $this = "text" MsgBox(0,$this,"whatever") EndFunc is it possible?
    • WoodGrain
      By WoodGrain
      Hi guys,
      I'm trying to move and resize a program call CPUID HWMonitor (http://www.cpuid.com/softwares/hwmonitor.html) but WinMove() doesn't work. Can someone tell me how to get this to work for this program? I've successfully moved other programs using WinMove(), and I've used WinGetTitle ("[ACTIVE]") to confirm the title is correct. WinActivate("CPUID HWMonitor") does work.
      If I run the following code nothing happens, doesn't move or resize, but AutoIt doesn't complain about the code either:
      WinMove("CPUID HWMonitor", 0, 0, 475, 715) The class changes every time the program opens (and I've nevery had a lot of success with classes tbh, bit hit and miss for me).
      Thanks all!
    • hcI
      By hcI
      Hello, i'm making a little script that lets users enter a question and if the script can't answer to, it ask what would be the answer (a bit like siri on IPhones). And I try to display the "supposed array" I still have an error.. I searched on Google and got nothing looked in the help file too.. I'm here to know if someone have a solution to my error please.
      Here is where $a and $b should become arrays :
      Dim $dossier = @AppDataDir & "\Siri2" Dim $chemin = $dossier & "\data.ini" Global $a = _InfoRead($chemin, 0) Global $b = _InfoRead($chemin, 1) with this function :
      Func _InfoRead($path, $mode = 0) If DirGetSize($dossier) = -1 Then Return SetError(-4) If Not FileExists($chemin) Then Return SetError(-5) Local $readed = IniReadSection($path, "data") If @error Then Return SetError(-3) $size = $readed[0][0] Local $return[$size] For $i = 1 To $size Step 1 $return[$i - 1] = $readed[$i][$mode] Next Return $return EndFunc and the thing that i don't understand is that, after _InfoRead return affected to $a, I can't use _ArrayDisplay because of  error 1 "$aArray is not an array" (and same fpr the variable $b)..
      Can please someone help me to understand why is it doing this ?

      -hcI