Sign in to follow this  
Followers 0
Emiel Wieldraaijer

msgbox limitations

15 posts in this topic

#1 ·  Posted (edited)

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

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

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.

Share this post


Link to post
Share on other sites

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


Best regards,Emiel Wieldraaijer

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

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

Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

Hi Jos,

no the problem still exists ..

i've added two images to show you the difference between XP and Vista

Emiel

post-17051-1198330951_thumb.png

post-17051-1198331144_thumb.png

Edited by Emiel Wieldraaijer

Best regards,Emiel Wieldraaijer

Share this post


Link to post
Share on other sites

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. :)

Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

I'll check a real vista computer, because this one is done in a virtual machine..

i'll report back

Emiel


Best regards,Emiel Wieldraaijer

Share this post


Link to post
Share on other sites

#8 ·  Posted (edited)

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

Share this post


Link to post
Share on other sites

It could be a Vista bug. It wouldn't be the first. If you can, report it to Microsoft.

Share this post


Link to post
Share on other sites

I would be nice if someone else could reproduce this error with another programming language (i only know autoit a bit)


Best regards,Emiel Wieldraaijer

Share this post


Link to post
Share on other sites

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.")

Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

Hi Jos,

yes you are correct...

when the lines becomes large enough the problem also exists in Windows XP

So it isn't a bug

thnx

Emiel


Best regards,Emiel Wieldraaijer

Share this post


Link to post
Share on other sites

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.

:)


Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

yeah to bad..

:)


Best regards,Emiel Wieldraaijer

Share this post


Link to post
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!"

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