antai Posted 6 hours ago Share Posted 6 hours ago Can I specify where the MsgBox appears on the screen? It appears at the center both x and y. Can I let it appear in the top of the screen? Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted 6 hours ago Moderators Share Posted 6 hours ago antai, Take a look at my ExtMsgBox UDF (link is in my sig - it allows you to specify the location of the dialog, as well as its colour, font, button text, etc, etc, etc. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Nine Posted 4 hours ago Share Posted 4 hours ago (edited) Another way : #include <WinAPISysWin.au3> Example() Func Example() Local $hTimerProc = DllCallbackRegister(TimerProc, 'none', 'hwnd;uint;uint_ptr;dword') Local $iTimerID = _WinAPI_SetTimer(0, 0, 10, DllCallbackGetPtr($hTimerProc)) Local $sResp = MsgBox(0, "Test", "Text here") DllCallbackFree($hTimerProc) EndFunc ;==>Example Func TimerProc($hWnd, $iMsg, $iTimerID, $iTime) If WinActive("Test") Then _WinAPI_KillTimer(0, $iTimerID) WinMove("Test", "", 200, 50) EndIf EndFunc ;==>_TimerProc Edited 4 hours ago by Nine “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Multi-Threading Made Easy Link to comment Share on other sites More sharing options...
Danyfirex Posted 2 hours ago Share Posted 2 hours ago Hello, Another alternative. expandcollapse popup#include <WinAPIProc.au3> #include <WinAPI.au3> #include <GUIConstants.au3> Global $hGUI = GUICreate("GUI") Global $idbtnOK = GUICtrlCreateButton("OK", 310, 370, 85, 25) GUISetState(@SW_SHOW, $hGUI) GUIRegisterMsg(_WinAPI_RegisterWindowMessage('SHELLHOOK'), 'WM_SHELLHOOK') _WinAPI_RegisterShellHookWindow($hGUI) Local $nMsg = 0 While 1 $nMsg = GUIGetMsg() Select Case $nMsg = $GUI_EVENT_CLOSE ExitLoop Case $nMsg = $idbtnOK _MsgBox(0, "", "Hello I'm an AutoIt Msgbox at Default Position :-)") _MsgBox(0, "", "Hello I'm an AutoIt Msgbox at 10,10 Position :-)", 10, 10) _MsgBox(0, "", "Hello I'm an AutoIt Msgbox at " & @DesktopWidth - 300 & "," & @DesktopHeight - 300 & " Position :-)", @DesktopWidth - 300, @DesktopHeight - 300) _MsgBox(0, "", "Hello I'm an AutoIt Msgbox at 0,0 Position :-)", 0, 0) EndSelect WEnd _WinAPI_DeregisterShellHookWindow($hGUI) Exit Func _MsgBoxPostition($X = Default, $Y = Default) Local Static $aPos[] = [Default, Default] If $X = Default Or $Y = Default Then Return $aPos EndIf $aPos[0] = $X $aPos[1] = $Y EndFunc ;==>_MsgBoxPostition Func _MsgBox($iFlag, $Title, $Text, $X = Default, $Y = Default, $iTimeout = Default, $hWnd = Default) _MsgBoxPostition($X, $Y) MsgBox($iFlag, $Title, $Text, $iTimeout, $hWnd) EndFunc ;==>_MsgBox Func WM_SHELLHOOK($hWnd, $iMsg, $wParam, $lParam) #forceref $iMsg Switch $wParam Case $HSHELL_WINDOWCREATED If WinGetProcess($lParam) = @AutoItPID And _WinAPI_GetClassName($lParam) = "#32770" Then Local $aPos = _MsgBoxPostition() If $aPos[0] <> Default And $aPos[1] <> Default Then WinMove($lParam, "", $aPos[0], $aPos[1]) EndIf EndIf EndSwitch EndFunc ;==>WM_SHELLHOOK Saludos Danysys.com AutoIt... UDFs: VirusTotal API 2.0 UDF - libZPlay UDF - Apps: Guitar Tab Tester - VirusTotal Hash Checker Examples: Text-to-Speech ISpVoice Interface - Get installed applications - Enable/Disable Network connection PrintHookProc - WINTRUST - Mute Microphone Level - Get Connected NetWorks - Create NetWork Connection ShortCut 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