Page 1 of 1
MsgBox
Posted: March 29th, 2007, 7:35 am
by binafus
Anyone know how to make a simple MsgBox stay on top of the Vanguard window?
If you add something like
Code: Register to unlock hidden link
Dim MyVar
MyVar = MsgBox ("Hello World!", 65, "MsgBox Example")
It will default back to Exhume every time you call it.
Posted: March 29th, 2007, 8:15 am
by xaraph
I'm pretty sure you would have to inject the code directly into Vanguards process. Use the hook.injectlibrary Exhume function. There's probably an easier way, but none is coming to mind.
Posted: March 29th, 2007, 10:13 am
by wyvernx
There is another way.. if you are using VGE.
Grab the demo scripts. (for XUM). One of those is a message box type of window you can create. Think making your own custom window using XUM that looks like a message box. Then you can add a simple FocusWindow call to it and it will show up on top.
Posted: March 29th, 2007, 7:10 pm
by binafus
Got the custom window
Got the FocusWindow sending it to the top.
Made custom buttons.
Can not seem to figure out how to get which button is pressed.
Any help would be appreciated.
Code: Register to unlock hidden link
Windows.FocusWindow wnd
set wnd = GUI.AddWindow(100,450,"test")
wnd.Settitle "Control"
wnd.setWidth 10
wnd.setheight 10
wnd.setLeft 50
wnd.SetOnDbClick "dbclick"
wnd.setminx 170
wnd.setminy 72
set btn1 = wnd.addcontrol("Button",3,10,"Pause")
btn1.Setheight 20
btn1.setwidth 45
btn1.SetRightAnchor true
btn1.SetLeftAnchor true
btn1.SetonPress "1"
set btn2 = wnd.addcontrol("Button",50,10,"UnPause")
btn2.Setheight 20
btn2.setwidth 65
btn2.SetRightAnchor true
btn2.SetLeftAnchor true
btn2.SetonPress "2"
set btn3 = wnd.addcontrol("Button",118,10,"Exit")
btn3.Setheight 20
btn3.setwidth 40
btn3.SetRightAnchor true
btn3.SetLeftAnchor true
btn3.SetonPress "3"
Posted: March 29th, 2007, 9:47 pm
by wyvernx
Try this:
Code: Register to unlock hidden link
set wnd = GUI.AddWindow(100,450,"test")
Windows.FocusWindow wnd.GetHWND()
wnd.Settitle "Control"
wnd.setWidth 10
wnd.setheight 10
wnd.setLeft 50
wnd.SetOnDbClick "dbclick"
wnd.setminx 170
wnd.setminy 72
set btn1 = wnd.addcontrol("Button",3,10,"Pause")
btn1.Setheight 20
btn1.setwidth 45
btn1.SetRightAnchor true
btn1.SetLeftAnchor true
btn1.SetonPress "onPause"
set btn2 = wnd.addcontrol("Button",50,10,"UnPause")
btn2.Setheight 20
btn2.setwidth 65
btn2.SetRightAnchor true
btn2.SetLeftAnchor true
btn2.SetonPress "onUnPause"
set btn3 = wnd.addcontrol("Button",118,10,"Exit")
btn3.Setheight 20
btn3.setwidth 40
btn3.SetRightAnchor true
btn3.SetLeftAnchor true
btn3.SetonPress "onExit"
public sub onExit
CloseWindow wnd.GetHWND()
end sub
public sub onPause
bPaused = true
end sub
public sub onUnPause
bPaused = false
end sub
Posted: March 30th, 2007, 5:57 am
by binafus
Thanks that is going to work.