dm83737 Posted February 11, 2009 Share Posted February 11, 2009 Is it possible to set a different position for a MsgBox to something other than the center of the screen? The reason I ask is that I have to wait for the screen to show information and the duration of the wait is fairly random according to server load. When the information finally comes onto the screen, the MsgBox gets put under the main window which keeps it from being clicked by the user. I am pretty new to AutoIT (about a week), and am not a very strong troubleshooter yet. But I have noticed that the main program we use does not register any information on the AutoIT Window Info program other than the Title and the Handle (see attachment), and AutoIT seems to have some issues recognizing if windows pop up within this application or not. I think I have heard that this program is built using JAVA or something to that effect, and I have looked around at the JAVA posts, but don't really understand what they are saying as a ) I am a noob and therefore am not really sure which direction to go in, and b ) I don't think they apply to me as this application is not a website, it is stand-alone. But that may be fodder for another post. So to summarize, my questions are: 1) Can you change the position (x-y coordinates) of a MsgBox? 2) How do I get AutoIT to interact with our program effectively? Link to comment Share on other sites More sharing options...
DaRam Posted February 11, 2009 Share Posted February 11, 2009 1. Look here #6248722. Look here http://www.autoitscript.com/forum/index.php?showtopic=53013 Link to comment Share on other sites More sharing options...
dm83737 Posted February 16, 2009 Author Share Posted February 16, 2009 Sorry DaRam, but since I am a stupid new guy to this application and scripting format, what do I do with this huge bunch of script? 2. Look here http://www.autoitscript.com/forum/index.php?showtopic=53013 I tried messing with what this post says in the initial entry and AutoIT keeps return syntax errors. I have never been a big fan of "Look here [LINK]" responses as I believe more in a teaching-type method; sharing the knowledge cuts down on people like me who end up asking multiple questions. So if you or someone else who has a bit more time than DaRam could explain this out to me or point me to an in-depth explanation, I would really appreciate it. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted February 16, 2009 Moderators Share Posted February 16, 2009 (edited) dm83737, The short answer to your MsgBox question is: No. The longer answer (and this goes some way to explaining DaRam's response) is that this question has been posed so many times on these forums that a simple search would throw up many examples of code which enable you to do this. Most of the regular posters here who offer help prefer it when someone has made a bit of an effort themselves first - i.e. looked at some code and tried to produce something that might work. So, I suggest that is what you do. I, and no doubt many others, will be happy to help you when you have problems - but do try and code something yourself before coming back. Posting a chunk of script, even if it does not work, with a question is a pretty good way to get a positive answer - asking us to write code for you is almost guaranteed not to! M23 P.S. By the way, the first of those links is an excellent function to move a message box! Is there something about it you do not understand? Edited February 16, 2009 by Melba23 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...
XORGate Posted September 2, 2011 Share Posted September 2, 2011 Hi guys, I'm a newbie in Autoit too.. I was introduced to it 4 days ago and since then ive started coding my project in it..Now the problem is, that when i tried the script mentioned in this:1. Look here http://www.autoitscript.com/forum/index.ph...st&p=624872I got a msgbox with the Title : deand text: 10297 Any Clues?!oh and yes i've got the same question as 837's Link to comment Share on other sites More sharing options...
funkey Posted September 3, 2011 Share Posted September 3, 2011 Never say never! expandcollapse popup#include <Constants.au3> #include <WinAPI.au3> Global $MsgBoxX = 20 Global $MsgBoxY = 20 Local $hProcMsgBox = DllCallbackRegister("CbtHookProcMsgBox", "int", "int;int;int") Local $TIDMsgBox = _WinAPI_GetCurrentThreadId() Local $hHookMsgBox = _WinAPI_SetWindowsHookEx($WH_CBT, DllCallbackGetPtr($hProcMsgBox), 0, $TIDMsgBox) Local $iRet = MsgBox(34, "Select example", "Please select the skin you want to try") $MsgBoxX = 120 Local $iRet = MsgBox(34, "Select example", "Please select the skin you want to try") $MsgBoxX = 220 Local $iRet = MsgBox(34, "Select example", "Please select the skin you want to try") _WinAPI_UnhookWindowsHookEx($hHookMsgBox) DllCallbackFree($hProcMsgBox) #region Just for fun!! ;########################################################## Func CbtHookProcMsgBox($nCode, $wParam, $lParam) Local $RET = 0 If $nCode < 0 Then $RET = _WinAPI_CallNextHookEx($hHookMsgBox, $nCode, $wParam, $lParam) Return $RET EndIf Switch $nCode Case 5 ;5=HCBT_ACTIVATE _WinAPI_SetDlgItemText($wParam, 3, "1") _WinAPI_SetDlgItemText($wParam, 4, "2") _WinAPI_SetDlgItemText($wParam, 5, "3") _WinAPI_SetWindowPos($wParam, $HWND_TOP, $MsgBoxX, $MsgBoxY, _WinAPI_GetWindowWidth($wParam), _WinAPI_GetWindowHeight($wParam), $SWP_NOZORDER) EndSwitch Return EndFunc ;==>CbtHookProcMsgBox Func _WinAPI_SetDlgItemText($hDlg, $nIDDlgItem, $lpString) Local $aRet = DllCall('user32.dll', "int", "SetDlgItemText", _ "hwnd", $hDlg, _ "int", $nIDDlgItem, _ "str", $lpString) Return $aRet[0] EndFunc ;==>_WinAPI_SetDlgItemText ;########################################################## #endregion Just for fun!! Programming today is a race between software engineers striving tobuild bigger and better idiot-proof programs, and the Universetrying to produce bigger and better idiots.So far, the Universe is winning. Link to comment Share on other sites More sharing options...
pieeater Posted September 3, 2011 Share Posted September 3, 2011 (edited) just out of curiosity could you create the msgbox then use WinMove() to change its location the second its created?? it seams like it would work but i dont have a way to test it never mind, i forgot that msgbox() was a blocking function so that would not work Edited September 3, 2011 by pieeater [spoiler]My UDFs: Login UDF[/spoiler] Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted September 3, 2011 Moderators Share Posted September 3, 2011 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...
sleepydvdr Posted September 3, 2011 Share Posted September 3, 2011 dm83737, if I understand your question correctly, everyone has been pointing you in the wrong direction. You want to move a message box from another application, right? Others here are talking about moving the built-in message box in AutoIt. Try this code: While 1 WinWaitActive("The ADMINISTRATOR") WinMove("The ADMINISTRATOR", "", 10, 10) WEnd Toninho 1 #include <ByteMe.au3> Link to comment Share on other sites More sharing options...
monoscout999 Posted September 3, 2011 Share Posted September 3, 2011 dm83737, if I understand your question correctly, everyone has been pointing you in the wrong direction. You want to move a message box from another application, right? Others here are talking about moving the built-in message box in AutoIt. Try this code: While 1 WinWaitActive("The ADMINISTRATOR") WinMove("The ADMINISTRATOR", "", 10, 10) WEnd Suddenly the fears are gone and the clarity enlighten their hearts and minds... Link to comment Share on other sites More sharing options...
funkey Posted September 3, 2011 Share Posted September 3, 2011 @monoscout999: dm83737 startet this thread in 2009! I saw it after posting and editing didn't work! And XORGate posted after about two and a half years later. And he definitly wants to reposition an own MsgBox. Greetings monoscout999 1 Programming today is a race between software engineers striving tobuild bigger and better idiot-proof programs, and the Universetrying to produce bigger and better idiots.So far, the Universe is winning. Link to comment Share on other sites More sharing options...
sleepydvdr Posted September 3, 2011 Share Posted September 3, 2011 Oh wow, I didn't notice this was a thread resurrected from 2009. DOH! #include <ByteMe.au3> Link to comment Share on other sites More sharing options...
monoscout999 Posted September 3, 2011 Share Posted September 3, 2011 well you got us...This seems to work fine1. Look here #624872Maybe MRCreator can throw us some light here and explain his tricks Link to comment Share on other sites More sharing options...
Toninho Posted August 8, 2023 Share Posted August 8, 2023 from 09' to 11' now to 23' thanks for that simple WinMove, that was the winning move! 😁 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