Jump to content

msgbox limitations


Recommended Posts

when i use this text in a messagebox

"/hs will run program in hidden mode and shutdown the computer when finished" it's displayed in Windows XP correctly but in vista it's not, in vista the line is seperated into two lines ""/hs will run program in hidden mode and shutdown the computer" and the next line "when finished"

The code i use

Func _CMD_Help ()
  MsgBox(0, "Commandline", "Program <parameter>" & @LF & _
     @LF & _
    "/h Program will be run in hidden mode" & @LF & _
    "/hs will run program in hidden mode and shutdown the computer when finished" & @LF & _
    "/debug program will run in debug mode" & @LF & _
    "/reset program will be reset to default settings")
   Exit
EndFunc

are there limitations to the lenght or is this a bug, according to the help

message box appears centered on screen and resizes according to the text it contains. However, the title could get truncated if the SYSTEMMODAL flag (4096) is used..

Thnx

Emiel

Edited by Emiel Wieldraaijer

Best regards,Emiel Wieldraaijer

Link to comment
Share on other sites

when i use this text in a messagebox

"/hs will run program in hidden mode and shutdown the computer when finished" it's displayed in Windows XP correctly but in vista it's not, in vista the line is seperated into two lines ""/hs will run program in hidden mode and shutdown the computer" and the next line "when finished"

The code i use

Func _CMD_Help ()
  MsgBox(0, "Commandline", "Program <parameter>" & @LF & _
     @LF & _
    "/h Program will be run in hidden mode" & @LF & _
    "/hs will run program in hidden mode and shutdown the computer when finished" & @LF & _
    "/debug program will run in debug mode" & @LF & _
    "/reset program will be reset to default settings")
   Exit
EndFunc

are there limitations to the lenght or is this a bug, according to the help

Thnx

Emiel

As you say, it works ok on XP.

I haven't tried it on Vista but it sounds as though you need to use @LFCR or @CR instead of @LF. Try experimenting.

Edited by martin
Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
Link to comment
Share on other sites

  • Developers

Hi Martin,

Changing it to @CRLF and @CR has no postive effect

Message box displayed correct in Windows XP and in Vista not

i think it must be a bug

Emiel

Autoit3 is using standard windows calls.

Try this version to see if it still goes wrong :

_CMD_Help()
Func _CMD_Help()
    _MsgBox(0, "Commandline", "Program <parameter>" & @LF & _
            @LF & _
            "/h Program will be run in hidden mode" & @LF & _
            "/hs will run program in hidden mode and shutdown the computer when finished" & @LF & _
            "/debug program will run in debug mode" & @LF & _
            "/reset program will be reset to default settings")
    Exit
EndFunc ;==>_CMD_Help

Func _MsgBox($type,$title,$text)
    DllCall("user32.dll","int","MessageBoxA","Hwnd",0,"str",$text,"str",$title,"int",$Type)
EndFunc
Edited by Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

  • Developers

Hi Jos,

no the problem still exists ..

i've added an image to show you the result

Emiel

It just proves its either something with your setup or with Vista itself and doesn't have anything to do with AutoIt3. :)

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

I've tested it on 4 vista machines

- Vista Home Premium Dutch

- Vista Business Dutch

- Vista Business English

- Vista Ultimate English

and all the same problem ..

so i believe

message box appears centered on screen and resizes according to the text it contains. However, the title could get truncated if the SYSTEMMODAL flag (4096) is used..

isn't correct for Vista operating systems or it's a bug

Emiel

Edited by Emiel Wieldraaijer

Best regards,Emiel Wieldraaijer

Link to comment
Share on other sites

  • Developers

The only issue you see is that it is autowrapped in Vista where XP doesnt do that with your example ..right ?

In WinXP it will also autowrap when the text gets long enough:

msgbox(0,"test","this is a very long line and that is also autowrapped by the standard MessageboxA in windows xp for me.'this is a very long line and that is also autowrapped by the standard MessageboxA in windows xp for me. this is a very long line and that is also autowrapped by the standard MessageboxA in windows xp for me.")

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

  • Developers

If you want to force it to display as you want it the only solution is to create your own MsgBox func and have that create a GUI that looks as you want it.

:)

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

yeah to bad..

:)

You could also write the MsgBox() so it looks right in Vista. Then it should look about the same in XP. I think this is probably a change in the way MS has designed the dialog in Vista. They have so much happening in Vista that they may have decided to make the maximum width for dialogs smaller.

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

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

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...