Sign in to follow this  
Followers 0
lupusbalo

MsgBox do not pause script any more

5 posts in this topic

#1 ·  Posted (edited)

I wrote AutoIt programs for (too!!) many years!

I just update to W10 then install a new machine.
Want to write a script and found that whatever flag values MsgBox won't pause the script ( just display for 2 ~ 3 seconds)
The same occurs with _ArrayDisplay

Thanks for Any Clue
 

Edited by lupusbalo

Share this post


Link to post
Share on other sites



@lupusbalo How about actually posting your script, so we can see what you're doing, rather than having us guess ;)

 


√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

So obvious .... I'm stupid
Here it is

#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_Icon=C:\&& fixed File on C (icons etc- - )\VBxCommun.ico
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
#include <Array.au3>
#include <File.au3>

AutoItSetOption("MustDeclareVars",1)
AutoItSetOption("WinTitleMatchMode",2)

; Global $jlbFile = "
Global $rvccFile= "E:\§INSTALLs\§INSTALL 7\analyse et pilote newPC\XXXXXX\XXXXXXX.txt"
Global $rvccData , $jlbData
Const  $NUM_1=1, $NAME_2=2, $VERSION_3=3, $TIME_4=4,$DESCR_5= 5, $COMPANY_6=6, $PATH_7=7, $TYPE64_8=8

_FileReadToArray($rvccFile, $rvccData, $FRTA_COUNT, @TAB)
MsgBox($IDOK + $IDCANCEL,"vreturn", @error, 10)
_ArrayDisplay($rvccData, "RVCC Data", Default,8)

The file to be read is saved from DLL view in "Process explorer"
I'm just starting this script, but UDF _FileReadToArray certainely returns an error and the MsgBox is supposed to help find what error I made
Incidently:  I did find the error in _FileReadTOArray so this is not my question which relates solely with MsgBox/_ArrayDisplay not pausing

Purpose of the script will be to compare (on 2  W10 PCs)  DLL used by a prog which freeze on one of them and runs perfectly on the other
(Hardware are the same - except HDD capacity) one W10 is Family the other Pro
 

Edited by lupusbalo
precision added

Share this post


Link to post
Share on other sites

I tested some "old" scripts with folowing results:
- no problem with compiled scripts
- same problem when running from the Editor (Scite)!!!
so I'll first check the AutoIt Install

Lupusbalo

Share this post


Link to post
Share on other sites

Previously I ran a "portable" version of AutoIt
So I download and Install last version (& associated Scite)

run the following program

MsgBox(0,"MsgBox1","First MsgBox")
                MsgBox(1,"MsgBox2","Second MsgBox")
                MsgBox(2,"MsgBox3","Third MsgBox")
                MsgBox(3,"MsgBox4","Fourth MsgBox")

Result is: MsgBox 1 display for 2 second, no other msgBox display ... ans the script ends!!

So this is not an AutoIt problem .... and it may have a link with the error I'm by the way tracking

LupusBalo
(can't remember how to close a topic in title)

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  
Followers 0

  • Similar Content

    • funkey
      By funkey
      Hello,
      it's quite often, that someone asks how to change the texts of the MsgBox buttons or the InputBox buttons or how to change the position of ta MsgBox. Since years I use CBT hooks for that, but now I made a small UDF out of it for the ease of use. Of course you can build your own GUI or use already existing UDFs to do the same, but I like this way and you can hack (hook) the inbuild InputBox.
       
      HookDlgBox.au3
      #include-once #include <WinAPI.au3> Global Const $tagCBT_CREATEWND = "ptr lpcs;HWND tagCBT_CREATEWND" Global Const $tagCREATESTRUCT = "ptr lpCreateParams;handle hInstance;HWND hMenu;HWND hwndParent;int cy;int cx;int y;int x;LONG style;ptr lpszName;ptr lpszClass;DWORD dwExStyle" Global $g__hProcDlgBox = DllCallbackRegister("__DlgBox_CbtHookProc", "int", "int;int;int") Global $g__TIdDlgBox = _WinAPI_GetCurrentThreadId() Global $g__hHookDlgBox = _WinAPI_SetWindowsHookEx($WH_CBT, DllCallbackGetPtr($g__hProcDlgBox), 0, $g__TIdDlgBox) Global Const $g__MaxDlgBtns = 5 ; maximum of 5 buttons to rename text Global Const $g__MaxDlgItemId = 11 ; maximun ID of buttons to search is 11 as this is the maximun used in Messagebox Global $g__DlgBoxPosX, $g__DlgBoxPosY, $g__DlgBoxWidth, $g__DlgBoxHeight Global $g__aDlgBoxBtnText[$g__MaxDlgBtns] Global $g__DlgBtnCount = 0 _DlgBox_SetDefaults() OnAutoItExitRegister("__DlgBox_UnregisterHook") Func _DlgBox_SetButtonNames($TxtBtn1 = Default, $TxtBtn2 = Default, $TxtBtn3 = Default, $TxtBtn4 = Default, $TxtBtn5 = Default) $g__aDlgBoxBtnText[0] = $TxtBtn1 $g__aDlgBoxBtnText[1] = $TxtBtn2 $g__aDlgBoxBtnText[2] = $TxtBtn3 $g__aDlgBoxBtnText[3] = $TxtBtn4 $g__aDlgBoxBtnText[4] = $TxtBtn5 $g__DlgBtnCount = @NumParams EndFunc ;==>_DlgBox_SetButtonNames Func _DlgBox_SetPosition($x = Default, $y = Default) ;only for MsgBox, not working and not needed for InputBox $g__DlgBoxPosX = $x $g__DlgBoxPosY = $y EndFunc ;==>_DlgBox_SetPosition Func _DlgBox_SetSize($w = Default, $h = Default) $g__DlgBoxWidth = $w $g__DlgBoxHeight = $h EndFunc ;==>_DlgBox_SetSize Func _DlgBox_SetDefaults() $g__DlgBoxPosX = Default $g__DlgBoxPosY = Default $g__DlgBoxWidth = Default $g__DlgBoxHeight = Default For $i = 0 To UBound($g__aDlgBoxBtnText) - 1 $g__aDlgBoxBtnText[$i] = Default Next EndFunc ;==>_DlgBox_SetDefaults Func __DlgBox_CbtHookProc($nCode, $wParam, $lParam) Local $tcw, $tcs Local $iSearch = 0 Local $ahBtn[$g__DlgBtnCount] If $nCode < 0 Then Return _WinAPI_CallNextHookEx($g__hHookDlgBox, $nCode, $wParam, $lParam) EndIf Switch $nCode Case 3 ;5=HCBT_CREATEWND If _WinAPI_GetClassName(HWnd($wParam)) = "#32770" Then ;Dialoig window class $tcw = DllStructCreate($tagCBT_CREATEWND, $lParam) $tcs = DllStructCreate($tagCREATESTRUCT, DllStructGetData($tcw, "lpcs")) If $g__DlgBoxPosX <> Default Then DllStructSetData($tcs, "x", $g__DlgBoxPosX) If $g__DlgBoxPosY <> Default Then DllStructSetData($tcs, "y", $g__DlgBoxPosY) If $g__DlgBoxWidth <> Default Then DllStructSetData($tcs, "cx", $g__DlgBoxWidth) If $g__DlgBoxHeight <> Default Then DllStructSetData($tcs, "cy", $g__DlgBoxHeight) EndIf Case 5 ;5=HCBT_ACTIVATE For $i = 1 To $g__MaxDlgItemId If IsHWnd(_WinAPI_GetDlgItem($wParam, $i)) Then If $g__aDlgBoxBtnText[$iSearch] <> Default Then _WinAPI_SetDlgItemText($wParam, $i, $g__aDlgBoxBtnText[$iSearch]) $iSearch += 1 If $iSearch >= UBound($ahBtn) Then ExitLoop EndIf Next EndSwitch Return _WinAPI_CallNextHookEx($g__hHookDlgBox, $nCode, $wParam, $lParam) EndFunc ;==>__DlgBox_CbtHookProc Func __DlgBox_UnregisterHook() _WinAPI_UnhookWindowsHookEx($g__hHookDlgBox) DllCallbackFree($g__hProcDlgBox) EndFunc ;==>__DlgBox_UnregisterHook Func _WinAPI_SetDlgItemText($hDlg, $nIDDlgItem, $lpString) Local $aRet = DllCall('user32.dll', "int", "SetDlgItemText", _ "hwnd", $hDlg, _ "int", $nIDDlgItem, _ "str", $lpString) Return $aRet[0] EndFunc ;==>_WinAPI_SetDlgItemText  
      Simple example to see how to use it
      #include "HookDlgBox.au3" _DlgWnd_SetButtonNames("1", "two", "3") MsgBox(4, "Test 1", "Custom button texts") _DlgWnd_SetPosition(20, 20) MsgBox(66, "Test 2", "Custom position and button texts") _DlgWnd_SetButtonNames("Submit", "Don't submit", "Don't know") InputBox("Test 3", "Where were you born?", "Planet Earth") _DlgWnd_SetSize(800, 800) InputBox("Test 4", "Where were you born?", "Planet Earth") _DlgWnd_SetSize(Default, 800) MsgBox(66, "Test 5", "Strange but working") _DlgWnd_SetButtonNames(Default, "Wait", "What?") _DlgWnd_SetSize(Default, Default) _DlgWnd_SetPosition(500, 500) MsgBox(66, "Test 6", "So far so good!") _DlgWnd_SetDefaults() MsgBox(6, "Test 7", "Default position and button texts") Hope you like it.
       
      Best regards
      funkey
    • Shirdish_chakravarthi
      By Shirdish_chakravarthi
      Hello Guys i am working on automating a flashing tool..When flashing is started if there is any error in connection it pops's up a error window...(as shown below)

       whenever this popup appears i need a msgbox to appear saying "error occured" how can i do this?
      Thanks

    • 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
    • LOWLIFE
      By LOWLIFE
      This is a personal project to log into several facebook accounts and send a message to a specific person on their birthday. I need to stop a script in a few different ways for several different reasons. For example, it might start sending the email to the wrong account, it might do something other than send a message, it might fail to logout of one account, etc. 
      1) Pause the script at it's exact location with a resume feature in case I need to put it on hold while I do another task. 
      2) Pause the script at it's current location with the option to start over or execute another part of the script (example in GUI with multiple buttons). 
      Also, is there a way to interact with menus? If I log into facebook how can I force it to go straight to sending a message to the proper person? I tried automating a mouseclick but the window opens in different places. I also tried searching for specific text and I couldn't get any information from the windows info tool on the facebook page. 
      Also, how do I get my code in here to show like it does in my editor? (scite)
      Thanks for looking at it, and any help/suggestions I sgreatly appreciated!
      <snip>
    • Ian_Mac
      By Ian_Mac
      Okey guys , here's the thing, My script is running fine, but when it's already running i cant   turn it off or pause by clicking the on/off button  unless i manually close it on my taskbar. What i wanted to happen is "if i click the ($switch = turn On and Off Button) to Off the script will STOP Running but not closing the entire GUI because i tried to use Exit and ExitLoop but it closes the entire GUI. and i don't want that to happen.  
      BTW. I'm new in AutoIT and practice scripting hope somebody could help me  Godbless. feel free to view my script
      Practice.au3