Valhalla Legends Archive

Programming => Battle.net Bot Development => Topic started by: ChR0NiC on October 06, 2003, 01:52 AM

Title: Another Question
Post by: ChR0NiC on October 06, 2003, 01:52 AM
I was told that it is possible to make the text in a MsgBox "linked" to go to a URL. Could anyone possibly tell me how to do that???
Title: Re:Another Question
Post by: iago on October 06, 2003, 02:14 AM
Yes, and it's been answered at least 3 times on this forum.
Title: Re:Another Question
Post by: ChR0NiC on October 06, 2003, 03:19 AM
I searched and I can't seem to find it.......
Title: Re:Another Question
Post by: Soul Taker on October 06, 2003, 07:49 AM
Try searching for "EM_AUTOURLDETECT", either here or on MSDN.
Title: Re:Another Question
Post by: Adron on October 06, 2003, 11:18 AM
Quote from: Soul Taker on October 06, 2003, 07:49 AM
Try searching for "EM_AUTOURLDETECT", either here or on MSDN.

That seems to find it for rich text boxes, not for msgboxes?
Title: Re:Another Question
Post by: Soul Taker on October 06, 2003, 12:07 PM
Quote from: Adron on October 06, 2003, 11:18 AM
Quote from: Soul Taker on October 06, 2003, 07:49 AM
Try searching for "EM_AUTOURLDETECT", either here or on MSDN.

That seems to find it for rich text boxes, not for msgboxes?
That will teach me to pay attention when I first wake up!
Title: Re:Another Question
Post by: iago on October 06, 2003, 03:16 PM
I assumed that's what he meant.

Besides, you can fake it with a RTB and a small form.
Title: Re:Another Question
Post by: UserLoser on October 06, 2003, 04:10 PM
This is a crappy thread, it's non bot related in bot dev thread.
Title: Re:Another Question
Post by: Adron on October 06, 2003, 04:44 PM
Yours is a crappy post, it's a non bot related rant in a non bot related thread on the bot dev board. How about finding out how to make those message boxes?
Title: Re:Another Question
Post by: ChR0NiC on October 06, 2003, 06:35 PM
Yeah Im interested in msgbox's not anything else
Title: Re:Another Question
Post by: Banana fanna fo fanna on October 06, 2003, 07:32 PM
Have no idea if this works, just throwing it out there...

Could get the hwnd of the message box (do message boxes have hwnds?) and use GDI to draw blue text to it. Then you could hax0r its wndproc and wait for mouseclick events and check if its within that rect.
Title: Re:Another Question
Post by: Yoni on October 06, 2003, 07:47 PM
Quote from: St0rm.iD on October 06, 2003, 07:32 PM
Have no idea if this works, just throwing it out there...

Could get the hwnd of the message box (do message boxes have hwnds?) and use GDI to draw blue text to it. Then you could hax0r its wndproc and wait for mouseclick events and check if its within that rect.

Hax0ring messageboxes is possible, I've done it before.
In almost all cases, it's easier to make a dialog of your own instead of using a message box for special purposes.
Title: Re:Another Question
Post by: Adron on October 07, 2003, 11:49 AM
The "Messagebox" that appears when a terminal server is not in add/remove programs mode, is that a dialog box?
Title: Re:Another Question
Post by: Skywing on October 07, 2003, 01:09 PM
Quote from: Adron on October 07, 2003, 11:49 AM
The "Messagebox" that appears when a terminal server is not in add/remove programs mode, is that a dialog box?
Everything generated by MessageBox (or MessageBoxEx, SoftModalMessageBox, or MessageBoxTimeout) is actually a dialog, and uses the WC_DIALOG window class.
Title: Re:Another Question
Post by: Adron on October 08, 2003, 10:32 AM
Ah. How interesting! I never checked that. Nothing wrong in making your own message boxes with dialogs then. It just uses some tight message loop that doesn't retrieve messages for other windows?
Title: Re:Another Question
Post by: Skywing on October 08, 2003, 11:42 AM
Quote from: Adron on October 08, 2003, 10:32 AM
Ah. How interesting! I never checked that. Nothing wrong in making your own message boxes with dialogs then. It just uses some tight message loop that doesn't retrieve messages for other windows?
It uses the standard modal dialog message loop, like you see with DialogBox().  I was wondering just how it worked, yesterday, but I didn't have time to fully investigate.  I'm pretty sure that it does take a look at messages for other windows, though, and if those messages would cause the dialog to lose focus, it beeps at you and flashes the title bar (presumably instead of passing it on to the other window procedure).  Of course, there could be some special support for modal message loops in win32k.sys; like I said, I'm not entirely certain.  Try using Spy++ to see what the parent hwnd receives message-wise when a modal dialog owned by it is up.
Title: Re:Another Question
Post by: Adron on October 08, 2003, 12:30 PM
Maybe this is different, but I have a feeling that in VB, showing a form modally still lets timer events occur on the parent form, but showing a message box does not. I'm not 100% certain though.
Title: Re:Another Question
Post by: Skywing on October 08, 2003, 02:23 PM
Quote from: Adron on October 08, 2003, 12:30 PM
Maybe this is different, but I have a feeling that in VB, showing a form modally still lets timer events occur on the parent form, but showing a message box does not. I'm not 100% certain though.
Do VB timers actually use WM_TIMER, though, or something else?
Title: Re:Another Question
Post by: Adron on October 08, 2003, 02:43 PM
Test application: Two forms, form1 having two command buttons, a timer and a label, the timer being set for 100 ms interval.

form1:

Option Explicit

Private Sub Command1_Click()
 Form2.Show 1
End Sub

Private Sub Command2_Click()
 MsgBox "test"
End Sub

Private Sub Timer1_Timer()
 Label1.Caption = Now
End Sub


Clicking Command2 pauses the clock, clicking Command1 doesn't.
Title: Re:Another Question
Post by: Adron on October 08, 2003, 02:46 PM
Quote from: Skywing on October 08, 2003, 02:23 PM
Quote from: Adron on October 08, 2003, 12:30 PM
Maybe this is different, but I have a feeling that in VB, showing a form modally still lets timer events occur on the parent form, but showing a message box does not. I'm not 100% certain though.
Do VB timers actually use WM_TIMER, though, or something else?

They do use WM_TIMER.
Title: Re:Another Question
Post by: Skywing on October 08, 2003, 03:56 PM
Quote from: Adron on October 08, 2003, 02:46 PM
Quote from: Skywing on October 08, 2003, 02:23 PM
Quote from: Adron on October 08, 2003, 12:30 PM
Maybe this is different, but I have a feeling that in VB, showing a form modally still lets timer events occur on the parent form, but showing a message box does not. I'm not 100% certain though.
Do VB timers actually use WM_TIMER, though, or something else?

They do use WM_TIMER.
I noticed something interesting.  You can run a modal dialog box in a different thread from the owner, and it still seems to have the same magic block-interaction-with-owner properties.  Thus, it's message loop really can't be just filtering messages from the owner window, because it's in the wrong thread, and the owner window is still running it's own, normal message loop.
Title: Re:Another Question
Post by: Kp on October 08, 2003, 04:14 PM
Quote from: Skywing on October 08, 2003, 03:56 PM
I noticed something interesting.  You can run a modal dialog box in a different thread from the owner, and it still seems to have the same magic block-interaction-with-owner properties.  Thus, it's message loop really can't be just filtering messages from the owner window, because it's in the wrong thread, and the owner window is still running it's own, normal message loop.
I can't tell for sure from the documentation, but perhaps AttachThreadInput would allow the message box to bypass this limitation and receive the requisite input?
Title: Re:Another Question
Post by: iago on October 08, 2003, 04:24 PM
Quote from: Skywing on October 08, 2003, 03:56 PM
Quote from: Adron on October 08, 2003, 02:46 PM
Quote from: Skywing on October 08, 2003, 02:23 PM
Quote from: Adron on October 08, 2003, 12:30 PM
Maybe this is different, but I have a feeling that in VB, showing a form modally still lets timer events occur on the parent form, but showing a message box does not. I'm not 100% certain though.
Do VB timers actually use WM_TIMER, though, or something else?

They do use WM_TIMER.
I noticed something interesting.  You can run a modal dialog box in a different thread from the owner, and it still seems to have the same magic block-interaction-with-owner properties.  Thus, it's message loop really can't be just filtering messages from the owner window, because it's in the wrong thread, and the owner window is still running it's own, normal message loop.

In Richter's book (Programming applications in microsoft windows 3rd edition), there's a demo program that had a messagebox display a countdown message, and if the countdown reaches 0 it's automatically closed.  I know this is done from a different thread, but I'm not too sure beyond that.
Title: Re:Another Question
Post by: Adron on October 08, 2003, 05:24 PM
From the topic Modal Dialog Boxes (http://ms-help://MS.VSCC/MS.MSDNVS/winui/dlgboxes_4wj7.htm):  (note that the forum breaks the link, you will have to fix it if you want to follow it)

Quote
When the owner window is not already disabled, the system automatically disables the window and any child windows belonging to it when it creates the modal dialog box. The owner window remains disabled until the dialog box is destroyed. Although a dialog box procedure could potentially enable the owner window at any time, enabling the owner defeats the purpose of the modal dialog box and is not recommended. When the dialog box procedure is destroyed, the system enables the owner window again, but only if the modal dialog box caused the owner to be disabled.

As the system creates the modal dialog box, it sends the WM_CANCELMODE message to the window (if any) currently capturing mouse input. An application that receives this message should release the mouse capture so that the user can move the mouse in the modal dialog box. Because the system disables the owner window, all mouse input is lost if the owner fails to release the mouse upon receiving this message.

To process messages for the modal dialog box, the system starts its own message loop, taking temporary control of the message queue for the entire application. When the system retrieves a message that is not explicitly for the dialog box, it dispatches the message to the appropriate window. If it retrieves a WM_QUIT message, it posts the message back to the application message queue so that the application's main message loop can eventually retrieve the message.


Title: Re:Another Question
Post by: Hitmen on October 08, 2003, 06:02 PM
I'm not sure what http://ms-help:// is but it doesn't look like a valid domain to me :P
Title: Re:Another Question
Post by: Yoni on October 08, 2003, 06:42 PM
Yes,

Quote from: Adron on October 08, 2003, 05:24 PM
(note that the forum breaks the link, you will have to fix it if you want to follow it)

ms-help:// URLs are MSDN links, you need MSDN installed to follow them (in IE or in Document Explorer).
Title: Re:Another Question
Post by: Zakath on October 08, 2003, 11:43 PM
In case anyone is wondering, this (http://www.valhallalegends.com/zakath/mshelp.jpg) is what it should look like.