shornw Posted April 26, 2012 Share Posted April 26, 2012 Is it possible to add a scrollbar to a MsgBox()? Quite often I run simple scripts and use ClipPut(Fileread("file")) MsgBox(0, "Results", ClipGet()) to display the results. Sometimes though, the resulting MsgBox is slightly too big for the screen. I know I can use other methods to display the output, but I like the simplicity of MsgBox() Thanks [font='Comic Sans MS']Eagles may soar high but weasels dont get sucked into jet engines[/font] Link to comment Share on other sites More sharing options...
Skitty Posted April 26, 2012 Share Posted April 26, 2012 I think you'll need to create a custom gui that looks like a message box, I've tried this before which is why im replying and I'd like to know if anyone's done this but I highly doubt it. Also, one thing you'll notice is that when creating a pseudo message box, you'll find that removing the gui icon on the top left corner is difficult, I've yet to find out how some people are doing it in programs I've came across and it's still something I'm looking into. Link to comment Share on other sites More sharing options...
water Posted April 26, 2012 Share Posted April 26, 2012 Haven't tried it myself but maybe Melba's can help. My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki Link to comment Share on other sites More sharing options...
guinness Posted April 26, 2012 Share Posted April 26, 2012 Nope, you have to create your own GUI. Perhaps an Edit control would be appropriate. UDF List: _AdapterConnections() • _AlwaysRun() • _AppMon() • _AppMonEx() • _ArrayFilter/_ArrayReduce • _BinaryBin() • _CheckMsgBox() • _CmdLineRaw() • _ContextMenu() • _ConvertLHWebColor()/_ConvertSHWebColor() • _DesktopDimensions() • _DisplayPassword() • _DotNet_Load()/_DotNet_Unload() • _Fibonacci() • _FileCompare() • _FileCompareContents() • _FileNameByHandle() • _FilePrefix/SRE() • _FindInFile() • _GetBackgroundColor()/_SetBackgroundColor() • _GetConrolID() • _GetCtrlClass() • _GetDirectoryFormat() • _GetDriveMediaType() • _GetFilename()/_GetFilenameExt() • _GetHardwareID() • _GetIP() • _GetIP_Country() • _GetOSLanguage() • _GetSavedSource() • _GetStringSize() • _GetSystemPaths() • _GetURLImage() • _GIFImage() • _GoogleWeather() • _GUICtrlCreateGroup() • _GUICtrlListBox_CreateArray() • _GUICtrlListView_CreateArray() • _GUICtrlListView_SaveCSV() • _GUICtrlListView_SaveHTML() • _GUICtrlListView_SaveTxt() • _GUICtrlListView_SaveXML() • _GUICtrlMenu_Recent() • _GUICtrlMenu_SetItemImage() • _GUICtrlTreeView_CreateArray() • _GUIDisable() • _GUIImageList_SetIconFromHandle() • _GUIRegisterMsg() • _GUISetIcon() • _Icon_Clear()/_Icon_Set() • _IdleTime() • _InetGet() • _InetGetGUI() • _InetGetProgress() • _IPDetails() • _IsFileOlder() • _IsGUID() • _IsHex() • _IsPalindrome() • _IsRegKey() • _IsStringRegExp() • _IsSystemDrive() • _IsUPX() • _IsValidType() • _IsWebColor() • _Language() • _Log() • _MicrosoftInternetConnectivity() • _MSDNDataType() • _PathFull/GetRelative/Split() • _PathSplitEx() • _PrintFromArray() • _ProgressSetMarquee() • _ReDim() • _RockPaperScissors()/_RockPaperScissorsLizardSpock() • _ScrollingCredits • _SelfDelete() • _SelfRename() • _SelfUpdate() • _SendTo() • _ShellAll() • _ShellFile() • _ShellFolder() • _SingletonHWID() • _SingletonPID() • _Startup() • _StringCompact() • _StringIsValid() • _StringRegExpMetaCharacters() • _StringReplaceWholeWord() • _StringStripChars() • _Temperature() • _TrialPeriod() • _UKToUSDate()/_USToUKDate() • _WinAPI_Create_CTL_CODE() • _WinAPI_CreateGUID() • _WMIDateStringToDate()/_DateToWMIDateString() • Au3 script parsing • AutoIt Search • AutoIt3 Portable • AutoIt3WrapperToPragma • AutoItWinGetTitle()/AutoItWinSetTitle() • Coding • DirToHTML5 • FileInstallr • FileReadLastChars() • GeoIP database • GUI - Only Close Button • GUI Examples • GUICtrlDeleteImage() • GUICtrlGetBkColor() • GUICtrlGetStyle() • GUIEvents • GUIGetBkColor() • Int_Parse() & Int_TryParse() • IsISBN() • LockFile() • Mapping CtrlIDs • OOP in AutoIt • ParseHeadersToSciTE() • PasswordValid • PasteBin • Posts Per Day • PreExpand • Protect Globals • Queue() • Resource Update • ResourcesEx • SciTE Jump • Settings INI • SHELLHOOK • Shunting-Yard • Signature Creator • Stack() • Stopwatch() • StringAddLF()/StringStripLF() • StringEOLToCRLF() • VSCROLL • WM_COPYDATA • More Examples... Updated: 22/04/2018 Link to comment Share on other sites More sharing options...
Mat Posted April 26, 2012 Share Posted April 26, 2012 Also, one thing you'll notice is that when creating a pseudo message box, you'll find that removing the gui icon on the top left corner is difficult, I've yet to find out how some people are doing it in programs I've came across and it's still something I'm looking into.Find a GUI that does it, then use winfo to get the styles and extended styles. Look at the constants and convert the value in to the flags that are set, then see what you get AutoIt Project Listing Link to comment Share on other sites More sharing options...
Skitty Posted April 26, 2012 Share Posted April 26, 2012 Find a GUI that does it, then use winfo to get the styles and extended styles. Look at the constants and convert the value in to the flags that are set, then see what you get Just tried and it didn't work GUICreate("Test data",100,100,-1,-1,0x14C800CC,0x00010101) GUISetState() Sleep(3000) Link to comment Share on other sites More sharing options...
guinness Posted April 26, 2012 Share Posted April 26, 2012 (edited) This? I believe I found it ages ago by Yashied Rover, though didn't save the URL link.#include <APIConstants.au3> #include <GUIConstantsEx.au3> #include <WinAPIEx.au3> ; www.autoitscript.com/forum/topic/98712-winapiex-udf/ Example() Func Example() Local $hGUI = _GUICreate_NoIcon("_GUICreate_NoIcon()") GUICtrlCreateLabel("Example Label", 10, 10, 150, 25) GUISetState(@SW_SHOW, $hGUI) While 1 If GUIGetMsg() = $GUI_EVENT_CLOSE Then ExitLoop EndIf WEnd GUIDelete($hGUI) EndFunc ;==>Example Func _GUICreate_NoIcon($sTitle = "", $iWidth = -1, $iHeight = -1, $iXpos = -1, $iYpos = -1) Local $hGUI = GUICreate($sTitle, $iWidth, $iHeight, $iXpos, $iYpos, BitOR($WS_CAPTION, $WS_SYSMENU), $WS_EX_DLGMODALFRAME) Local $hIcon = _WinAPI_GetClassLongEx($hGUI, $GCL_HICON) _WinAPI_DestroyIcon($hIcon) _WinAPI_SetClassLongEx($hGUI, $GCL_HICON, 0) _WinAPI_SetClassLongEx($hGUI, $GCL_HICONSM, 0) Return $hGUI EndFunc ;==>_GUICreate_NoIcon Edited April 26, 2012 by guinness Skitty 1 UDF List: _AdapterConnections() • _AlwaysRun() • _AppMon() • _AppMonEx() • _ArrayFilter/_ArrayReduce • _BinaryBin() • _CheckMsgBox() • _CmdLineRaw() • _ContextMenu() • _ConvertLHWebColor()/_ConvertSHWebColor() • _DesktopDimensions() • _DisplayPassword() • _DotNet_Load()/_DotNet_Unload() • _Fibonacci() • _FileCompare() • _FileCompareContents() • _FileNameByHandle() • _FilePrefix/SRE() • _FindInFile() • _GetBackgroundColor()/_SetBackgroundColor() • _GetConrolID() • _GetCtrlClass() • _GetDirectoryFormat() • _GetDriveMediaType() • _GetFilename()/_GetFilenameExt() • _GetHardwareID() • _GetIP() • _GetIP_Country() • _GetOSLanguage() • _GetSavedSource() • _GetStringSize() • _GetSystemPaths() • _GetURLImage() • _GIFImage() • _GoogleWeather() • _GUICtrlCreateGroup() • _GUICtrlListBox_CreateArray() • _GUICtrlListView_CreateArray() • _GUICtrlListView_SaveCSV() • _GUICtrlListView_SaveHTML() • _GUICtrlListView_SaveTxt() • _GUICtrlListView_SaveXML() • _GUICtrlMenu_Recent() • _GUICtrlMenu_SetItemImage() • _GUICtrlTreeView_CreateArray() • _GUIDisable() • _GUIImageList_SetIconFromHandle() • _GUIRegisterMsg() • _GUISetIcon() • _Icon_Clear()/_Icon_Set() • _IdleTime() • _InetGet() • _InetGetGUI() • _InetGetProgress() • _IPDetails() • _IsFileOlder() • _IsGUID() • _IsHex() • _IsPalindrome() • _IsRegKey() • _IsStringRegExp() • _IsSystemDrive() • _IsUPX() • _IsValidType() • _IsWebColor() • _Language() • _Log() • _MicrosoftInternetConnectivity() • _MSDNDataType() • _PathFull/GetRelative/Split() • _PathSplitEx() • _PrintFromArray() • _ProgressSetMarquee() • _ReDim() • _RockPaperScissors()/_RockPaperScissorsLizardSpock() • _ScrollingCredits • _SelfDelete() • _SelfRename() • _SelfUpdate() • _SendTo() • _ShellAll() • _ShellFile() • _ShellFolder() • _SingletonHWID() • _SingletonPID() • _Startup() • _StringCompact() • _StringIsValid() • _StringRegExpMetaCharacters() • _StringReplaceWholeWord() • _StringStripChars() • _Temperature() • _TrialPeriod() • _UKToUSDate()/_USToUKDate() • _WinAPI_Create_CTL_CODE() • _WinAPI_CreateGUID() • _WMIDateStringToDate()/_DateToWMIDateString() • Au3 script parsing • AutoIt Search • AutoIt3 Portable • AutoIt3WrapperToPragma • AutoItWinGetTitle()/AutoItWinSetTitle() • Coding • DirToHTML5 • FileInstallr • FileReadLastChars() • GeoIP database • GUI - Only Close Button • GUI Examples • GUICtrlDeleteImage() • GUICtrlGetBkColor() • GUICtrlGetStyle() • GUIEvents • GUIGetBkColor() • Int_Parse() & Int_TryParse() • IsISBN() • LockFile() • Mapping CtrlIDs • OOP in AutoIt • ParseHeadersToSciTE() • PasswordValid • PasteBin • Posts Per Day • PreExpand • Protect Globals • Queue() • Resource Update • ResourcesEx • SciTE Jump • Settings INI • SHELLHOOK • Shunting-Yard • Signature Creator • Stack() • Stopwatch() • StringAddLF()/StringStripLF() • StringEOLToCRLF() • VSCROLL • WM_COPYDATA • More Examples... Updated: 22/04/2018 Link to comment Share on other sites More sharing options...
guinness Posted April 26, 2012 Share Posted April 26, 2012 Whoops, Rover >> UDF List: _AdapterConnections() • _AlwaysRun() • _AppMon() • _AppMonEx() • _ArrayFilter/_ArrayReduce • _BinaryBin() • _CheckMsgBox() • _CmdLineRaw() • _ContextMenu() • _ConvertLHWebColor()/_ConvertSHWebColor() • _DesktopDimensions() • _DisplayPassword() • _DotNet_Load()/_DotNet_Unload() • _Fibonacci() • _FileCompare() • _FileCompareContents() • _FileNameByHandle() • _FilePrefix/SRE() • _FindInFile() • _GetBackgroundColor()/_SetBackgroundColor() • _GetConrolID() • _GetCtrlClass() • _GetDirectoryFormat() • _GetDriveMediaType() • _GetFilename()/_GetFilenameExt() • _GetHardwareID() • _GetIP() • _GetIP_Country() • _GetOSLanguage() • _GetSavedSource() • _GetStringSize() • _GetSystemPaths() • _GetURLImage() • _GIFImage() • _GoogleWeather() • _GUICtrlCreateGroup() • _GUICtrlListBox_CreateArray() • _GUICtrlListView_CreateArray() • _GUICtrlListView_SaveCSV() • _GUICtrlListView_SaveHTML() • _GUICtrlListView_SaveTxt() • _GUICtrlListView_SaveXML() • _GUICtrlMenu_Recent() • _GUICtrlMenu_SetItemImage() • _GUICtrlTreeView_CreateArray() • _GUIDisable() • _GUIImageList_SetIconFromHandle() • _GUIRegisterMsg() • _GUISetIcon() • _Icon_Clear()/_Icon_Set() • _IdleTime() • _InetGet() • _InetGetGUI() • _InetGetProgress() • _IPDetails() • _IsFileOlder() • _IsGUID() • _IsHex() • _IsPalindrome() • _IsRegKey() • _IsStringRegExp() • _IsSystemDrive() • _IsUPX() • _IsValidType() • _IsWebColor() • _Language() • _Log() • _MicrosoftInternetConnectivity() • _MSDNDataType() • _PathFull/GetRelative/Split() • _PathSplitEx() • _PrintFromArray() • _ProgressSetMarquee() • _ReDim() • _RockPaperScissors()/_RockPaperScissorsLizardSpock() • _ScrollingCredits • _SelfDelete() • _SelfRename() • _SelfUpdate() • _SendTo() • _ShellAll() • _ShellFile() • _ShellFolder() • _SingletonHWID() • _SingletonPID() • _Startup() • _StringCompact() • _StringIsValid() • _StringRegExpMetaCharacters() • _StringReplaceWholeWord() • _StringStripChars() • _Temperature() • _TrialPeriod() • _UKToUSDate()/_USToUKDate() • _WinAPI_Create_CTL_CODE() • _WinAPI_CreateGUID() • _WMIDateStringToDate()/_DateToWMIDateString() • Au3 script parsing • AutoIt Search • AutoIt3 Portable • AutoIt3WrapperToPragma • AutoItWinGetTitle()/AutoItWinSetTitle() • Coding • DirToHTML5 • FileInstallr • FileReadLastChars() • GeoIP database • GUI - Only Close Button • GUI Examples • GUICtrlDeleteImage() • GUICtrlGetBkColor() • GUICtrlGetStyle() • GUIEvents • GUIGetBkColor() • Int_Parse() & Int_TryParse() • IsISBN() • LockFile() • Mapping CtrlIDs • OOP in AutoIt • ParseHeadersToSciTE() • PasswordValid • PasteBin • Posts Per Day • PreExpand • Protect Globals • Queue() • Resource Update • ResourcesEx • SciTE Jump • Settings INI • SHELLHOOK • Shunting-Yard • Signature Creator • Stack() • Stopwatch() • StringAddLF()/StringStripLF() • StringEOLToCRLF() • VSCROLL • WM_COPYDATA • More Examples... Updated: 22/04/2018 Link to comment Share on other sites More sharing options...
Skitty Posted April 26, 2012 Share Posted April 26, 2012 (edited) This? I believe I found it ages ago by Yashied Rover, though didn't save the URL link. #include <APIConstants.au3> #include <GUIConstantsEx.au3> #include <WinAPIEx.au3> ; www.autoitscript.com/forum/topic/98712-winapiex-udf/ Example() Func Example() Local $hGUI = _GUICreate_NoIcon("_GUICreate_NoIcon()") GUICtrlCreateLabel("Example Label", 10, 10, 150, 25) GUISetState(@SW_SHOW, $hGUI) While 1 If GUIGetMsg() = $GUI_EVENT_CLOSE Then ExitLoop EndIf WEnd GUIDelete($hGUI) EndFunc ;==>Example Func _GUICreate_NoIcon($sTitle = "", $iWidth = -1, $iHeight = -1, $iXpos = -1, $iYpos = -1) Local $hGUI = GUICreate($sTitle, $iWidth, $iHeight, $iXpos, $iYpos, BitOR($WS_CAPTION, $WS_SYSMENU), $WS_EX_DLGMODALFRAME) Local $hIcon = _WinAPI_GetClassLongEx($hGUI, $GCL_HICON) _WinAPI_DestroyIcon($hIcon) _WinAPI_SetClassLongEx($hGUI, $GCL_HICON, 0) _WinAPI_SetClassLongEx($hGUI, $GCL_HICONSM, 0) Return $hGUI EndFunc ;==>_GUICreate_NoIcon Awesome! wish you would have posted that when I made I've still been looking for this all this time! Edited April 26, 2012 by ApudAngelorum Link to comment Share on other sites More sharing options...
guinness Posted April 26, 2012 Share Posted April 26, 2012 I was there, no I idea why I didn't provided this. Oh well you've only been waiting 2 months, I have a few questions still unanswered, no biggy though I found workarounds. UDF List: _AdapterConnections() • _AlwaysRun() • _AppMon() • _AppMonEx() • _ArrayFilter/_ArrayReduce • _BinaryBin() • _CheckMsgBox() • _CmdLineRaw() • _ContextMenu() • _ConvertLHWebColor()/_ConvertSHWebColor() • _DesktopDimensions() • _DisplayPassword() • _DotNet_Load()/_DotNet_Unload() • _Fibonacci() • _FileCompare() • _FileCompareContents() • _FileNameByHandle() • _FilePrefix/SRE() • _FindInFile() • _GetBackgroundColor()/_SetBackgroundColor() • _GetConrolID() • _GetCtrlClass() • _GetDirectoryFormat() • _GetDriveMediaType() • _GetFilename()/_GetFilenameExt() • _GetHardwareID() • _GetIP() • _GetIP_Country() • _GetOSLanguage() • _GetSavedSource() • _GetStringSize() • _GetSystemPaths() • _GetURLImage() • _GIFImage() • _GoogleWeather() • _GUICtrlCreateGroup() • _GUICtrlListBox_CreateArray() • _GUICtrlListView_CreateArray() • _GUICtrlListView_SaveCSV() • _GUICtrlListView_SaveHTML() • _GUICtrlListView_SaveTxt() • _GUICtrlListView_SaveXML() • _GUICtrlMenu_Recent() • _GUICtrlMenu_SetItemImage() • _GUICtrlTreeView_CreateArray() • _GUIDisable() • _GUIImageList_SetIconFromHandle() • _GUIRegisterMsg() • _GUISetIcon() • _Icon_Clear()/_Icon_Set() • _IdleTime() • _InetGet() • _InetGetGUI() • _InetGetProgress() • _IPDetails() • _IsFileOlder() • _IsGUID() • _IsHex() • _IsPalindrome() • _IsRegKey() • _IsStringRegExp() • _IsSystemDrive() • _IsUPX() • _IsValidType() • _IsWebColor() • _Language() • _Log() • _MicrosoftInternetConnectivity() • _MSDNDataType() • _PathFull/GetRelative/Split() • _PathSplitEx() • _PrintFromArray() • _ProgressSetMarquee() • _ReDim() • _RockPaperScissors()/_RockPaperScissorsLizardSpock() • _ScrollingCredits • _SelfDelete() • _SelfRename() • _SelfUpdate() • _SendTo() • _ShellAll() • _ShellFile() • _ShellFolder() • _SingletonHWID() • _SingletonPID() • _Startup() • _StringCompact() • _StringIsValid() • _StringRegExpMetaCharacters() • _StringReplaceWholeWord() • _StringStripChars() • _Temperature() • _TrialPeriod() • _UKToUSDate()/_USToUKDate() • _WinAPI_Create_CTL_CODE() • _WinAPI_CreateGUID() • _WMIDateStringToDate()/_DateToWMIDateString() • Au3 script parsing • AutoIt Search • AutoIt3 Portable • AutoIt3WrapperToPragma • AutoItWinGetTitle()/AutoItWinSetTitle() • Coding • DirToHTML5 • FileInstallr • FileReadLastChars() • GeoIP database • GUI - Only Close Button • GUI Examples • GUICtrlDeleteImage() • GUICtrlGetBkColor() • GUICtrlGetStyle() • GUIEvents • GUIGetBkColor() • Int_Parse() & Int_TryParse() • IsISBN() • LockFile() • Mapping CtrlIDs • OOP in AutoIt • ParseHeadersToSciTE() • PasswordValid • PasteBin • Posts Per Day • PreExpand • Protect Globals • Queue() • Resource Update • ResourcesEx • SciTE Jump • Settings INI • SHELLHOOK • Shunting-Yard • Signature Creator • Stack() • Stopwatch() • StringAddLF()/StringStripLF() • StringEOLToCRLF() • VSCROLL • WM_COPYDATA • More Examples... Updated: 22/04/2018 Link to comment Share on other sites More sharing options...
NassauSky Posted February 5, 2015 Share Posted February 5, 2015 Thanks very much for the code but not sure how to implement it. It looks like it creates a Main Window and not a popup dialog box with a label but not a long string. How is it a replacement to a MsgBox with extra text. Normally I would use the following to add text to a message box: MsgBox($MB_SYSTEMMODAL,"Title",$myReallyLongString) Link to comment Share on other sites More sharing options...
JoHanatCent Posted February 6, 2015 Share Posted February 6, 2015 Hi Maybe: #include <APIConstants.au3> #include <GUIConstantsEx.au3> #include <WinAPIEx.au3> ; www.autoitscript.com/forum/topic/98712-winapiex-udf/ Example() Func Example() Local $hGUI = _GUICreate_NoIcon("Title Goes Here!!!") $Label = GUICtrlCreateLabel("My $myReallyLongString goes here", 10, 10, 150, 25) $Button = GUICtrlCreateButton("Ok", 90, 120, 50, 50) GUISetState(@SW_SHOW, $hGUI) While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop Case $Button MsgBox(0, '', 'Button Ok pressed!', .5) Case $Label MsgBox(0, '', 'Label pressed!', .5) EndSwitch WEnd GUIDelete($hGUI) EndFunc ;==>Example Func _GUICreate_NoIcon($sTitle = "", $iWidth = -1, $iHeight = -1, $iXpos = -1, $iYpos = -1) Local $hGUI = GUICreate($sTitle, $iWidth, $iHeight, $iXpos, $iYpos, BitOR($WS_CAPTION, $WS_SYSMENU), $WS_EX_DLGMODALFRAME) Local $hIcon = _WinAPI_GetClassLongEx($hGUI, $GCL_HICON) _WinAPI_DestroyIcon($hIcon) _WinAPI_SetClassLongEx($hGUI, $GCL_HICON, 0) _WinAPI_SetClassLongEx($hGUI, $GCL_HICONSM, 0) Return $hGUI EndFunc ;==>_GUICreate_NoIcon Link to comment Share on other sites More sharing options...
Bert Posted February 6, 2015 Share Posted February 6, 2015 This thread is 3 years old. You know that right? The Vollatran project My blog: http://www.vollysinterestingshit.com/ Link to comment Share on other sites More sharing options...
mikell Posted February 6, 2015 Share Posted February 6, 2015 Without this exhumation we couldn't discover this nice picture Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted February 7, 2015 Moderators Share Posted February 7, 2015 Well, you certainly "can" put scrolls on a MessageBox, but I haven't tested getting them to work yet. A proof of concept using code borrowed from my >MsgBox UDF: expandcollapse popup#include <WinAPI.au3> #include <WindowsConstants.au3> Global $__ghMsgBoxHook = 0 Global $__giMsgBoxMaxWidth = 640 Global $__giMsgBoxMaxHeight = 300 _MsgBox(64 + 6, "Example", ClipGet()) Func _MsgBox($iFlag, $sTitle, $sText, $iTimeout = 0, $hWnd = 0) Local $hCB = DllCallbackRegister("_CBT_MsgBoxProc", "lresult", "int;wparam;lparam") Local $pCB = DllCallbackGetPtr($hCB) $__ghMsgBoxHook = _WinAPI_SetWindowsHookEx($WH_CBT, $pCB, 0, _WinAPI_GetCurrentThreadId()) Local $i_ret = MsgBox($iFlag, $sTitle, $sText, $iTimeout, $hWnd) If $__ghMsgBoxHook Then _WinAPI_UnhookWindowsHookEx($__ghMsgBoxHook) DllCallbackFree($hCB) Return $i_ret EndFunc ;==>_MsgBox Func _CBT_MsgBoxProc($iMsg, $wParam, $lParam) Local $hMsgbox = HWnd($wParam) Local $iLong, $aWPos, $hStatic, $aCPos Local $iLeft, $iTop Local $hButton, $iEnum = 1 Local $iHeight = $__giMsgBoxMaxHeight Local $iWidth = $__giMsgBoxMaxWidth Switch $iMsg Case 5; H_CBT_ACTIVATE $aWPos = WinGetPos($hMsgbox) If IsArray($aWPos) And ($aWPos[2] > $iWidth Or $aWPos[3] > $iHeight) Then $hStatic = ControlGetHandle($hMsgbox, "", "Static3") $aCPos = ControlGetPos($hMsgbox, "", $hStatic) $iLong = _WinAPI_GetWindowLong($hStatic, $GWL_STYLE) _WinAPI_SetWindowLong($hStatic, $GWL_STYLE, BitOR($iLong, $WS_HSCROLL, $WS_VSCROLL)) _WinAPI_SetWindowLong($hStatic, $GWL_EXSTYLE, $WS_EX_CLIENTEDGE) $iWidth = (($aWPos[2] > $iWidth) ? $iWidth : $aWPos[2]) $iHeight = (($aWPos[3] > $iHeight) ? $iHeight : $aWPos[3]) $iLeft = $aWPos[2] - $iWidth $iTop = $aWPos[3] - $iHeight WinMove($hMsgbox, 0, $aWPos[0], $aWPos[1], $iWidth, $iHeight) ControlMove($hMsgbox, "", $hStatic, $aCPos[0], $aCPos[1], $aCPos[2] - $iLeft, $aCPos[3] - $iTop) While 1 $hButton = ControlGetHandle($hMsgbox, "", "Button" & $iEnum) If Not IsHWnd($hButton) Then ExitLoop $aCPos = ControlGetPos($hMsgbox, "", $hButton) ControlMove($hMsgbox, "", $hButton, $aCPos[0] - $iLeft, $aCPos[1] - $iTop, $aCPos[2], $aCPos[3]) $iEnum += 1 WEnd EndIf _WinAPI_UnhookWindowsHookEx($__ghMsgBoxHook) $__ghMsgBoxHook = 0 Return 0 EndSwitch Return _WinAPI_CallNextHookEx($__ghMsgBoxHook, $iMsg, $wParam, $lParam) EndFunc ;==>_CBT_MsgBoxProc . Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now