找回密码
 加入
搜索
查看: 2468|回复: 5

[AU3基础] [已解決]状态栏显示文字长度的问题,麻烦知道的朋友指定一下,谢谢

  [复制链接]
发表于 2011-2-13 23:24:08 | 显示全部楼层 |阅读模式
本帖最后由 zhongzijie 于 2011-2-14 20:26 编辑

;代码A能完全显示出文字
#include <GuiConstantsEx.au3>
#include <GuiStatusBar.au3>
#include <WindowsConstants.au3>

Opt('MustDeclareVars', 1)
Local $hGUI, $hProgress, $hButton, $Button, $progress, $hStatus,$hStatus2,$Msgbox
Local $aParts[1] = [-1];定义状态栏
$hGUI = GUICreate("为什么状态栏有些显示不够很长啊", 1200, 30)
$hStatus = _GUICtrlStatusBar_Create ($hGUI)
GUISetState()
_GUICtrlStatusBar_SetParts ($hStatus, $aParts)
;_GUICtrlStatusBar_SetText ($hStatus, @TAB&"看见我:[看见我看见我]  看见我:[88]  看见我:[88]  看见我:[88]  看见我:[88]  看见我:[888888=88,88,88,88,88,88,88,88,88,88,88,88,88,88,]  看见我:[88]  看见我:[88]  看见我:[88]", 0)
_GUICtrlStatusBar_SetText ($hStatus, @TAB&"[开始]看见我看见我看见我看见我看见我看见我看见我看见我看见我看见我看见我看见我看见我看见我看见我看见我看见我看见我看见我看见我看见我看见我看见我看见我看见我看见我看见我看见我看见我看见我看见我[结束]", 0)
GUIRegisterMsg($WM_NOTIFY, "WM_NOTIFY")

While 1
$Msgbox=GUIGetMsg()
Switch $Msgbox
Case $GUI_EVENT_CLOSE
GUIDelete()
Exit
EndSwitch
WEnd

;代码B不能完全显示出文字
#include <GuiConstantsEx.au3>
#include <GuiStatusBar.au3>
#include <WindowsConstants.au3>

Opt('MustDeclareVars', 1)
Local $hGUI, $hProgress, $hButton, $Button, $progress, $hStatus,$hStatus2,$Msgbox
Local $aParts[1] = [-1];定义状态栏
$hGUI = GUICreate("为什么状态栏有些显示不够很长啊", 1200, 30)
$hStatus = _GUICtrlStatusBar_Create ($hGUI)
GUISetState()
_GUICtrlStatusBar_SetParts ($hStatus, $aParts)
_GUICtrlStatusBar_SetText ($hStatus, @TAB&"看见我:[看见我看见我]  看见我:[88]  看见我:[88]  看见我:[88]  看见我:[88]  看见我:[888888=88,88,88,88,88,88,88,88,88,88,88,88,88,88,]  看见我:[88]  看见我:[88]  看见我:[88]", 0)
;_GUICtrlStatusBar_SetText ($hStatus, @TAB&"[开始]看见我看见我看见我看见我看见我看见我看见我看见我看见我看见我看见我看见我看见我看见我看见我看见我看见我看见我看见我看见我看见我看见我看见我看见我看见我看见我看见我看见我看见我看见我看见我[结束]", 0)
GUIRegisterMsg($WM_NOTIFY, "WM_NOTIFY")

While 1
$Msgbox=GUIGetMsg()
Switch $Msgbox
Case $GUI_EVENT_CLOSE
GUIDelete()
Exit
EndSwitch
WEnd
发表于 2011-2-14 00:20:34 | 显示全部楼层
没明白楼主的意思,我测试了下你的代码,显示是正常的吧!
 楼主| 发表于 2011-2-14 00:32:15 | 显示全部楼层
这个是代码A

这个是代码B
发表于 2011-2-14 16:50:56 | 显示全部楼层
回复 3# zhongzijie
lParam
    Pointer to a null-terminated string that specifies the text to set. If wParam is SBT_OWNERDRAW, this parameter represents 32 bits of data. The parent window must interpret the data and draw the text when it receives the WM_DRAWITEM message. In Windows XP and earlier, the text for each part is limited to 127 characters. This limitation has been removed in Windows Vista.
大意:在Windows XP和更早版本,每个部分文字被限制为127个字符。Vista无此限制。
传送门:http://msdn.microsoft.com/en-us/ ... 8%28v=vs.85%29.aspx
发表于 2011-2-14 16:57:34 | 显示全部楼层
回复 4# 3mile

原来如此,我昨天是Win7,所以没发现楼主描述的问题。
 楼主| 发表于 2011-2-14 20:25:47 | 显示全部楼层
謝謝3mile 解答和謝謝水木子 的關注,我找到笨辦法了,把內容分幾個狀態就好了
您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2024-4-26 11:02 , Processed in 0.077650 second(s), 23 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表