Prev: Excel Pivot Table
Next: NEW Tray toolbar
From: Leon on 29 Jul 2010 09:46 Hi With these vbs code I opens a IE window.. How do I set in a timer so that every 30 second activate this window and bringing it to front if the user have taken it in background behind other applications? Cheers Dim oIE set oIE = CreateObject("InternetExplorer.Application") wsh.echo ButtonBox("Msgboxtest", "Black") Function ButtonBox(sPrompt, sColor) With oIE .FullScreen = false .ToolBar = False : .RegisterAsDropTarget = False .StatusBar = False : .Navigate("about:blank") While .Busy : WScript.Sleep 100 : Wend With .document With .ParentWindow .resizeto 600,120 '.moveto .screen.width/2-150, .screen.height/2-60 .moveto 1, 1 End With .WriteLn("<html><body bgColor=Red><center>") .WriteLn("<font size=4 color=" & sColor & ">" & _ sPrompt & "</font><p>") .WriteLn("<button id=but1><font size=3>Done</font></button>") .WriteLn("</center></body></html>") With .ParentWindow.document.body .scroll="no" .style.borderStyle = "ridge" '.style.borderStyle = "outset" .style.borderWidth = "3px" End With .all.but1.onclick = getref("buttonbox_done") .all.but1.focus oIE.Visible = True .title = sPrompt On Error Resume Next While oIE.Visible WScript.Sleep 1000 .oIE.AppActivate Wend End With ' document End With ' IE ButtonBox = "Done" End Function Sub buttonbox_Done oIE.Visible = False End Sub
From: Mayayana on 29 Jul 2010 10:25 Isn't that the same question you just asked? If you can't do it with methods like Refresh then it may not be possible. Over the years Microsoft has gradually made that kind of thing more difficult because they believed the ability was abused. Even the API method of putting a window on top requires a hack because MS broke the functionality. And the system modal options were changed to process-modal, not actual system modal. Personally I can't think of anything except maybe a nuclear missile launch countdown notice that I would want to jump to the front every 30 seconds. If any software tried that I'd get rid of it quickly. | | With these vbs code I opens a IE window.. | How do I set in a timer so that every 30 second activate this window | and bringing it to front if the user have taken it in background | behind other applications? | | Cheers | | Dim oIE | set oIE = CreateObject("InternetExplorer.Application") | wsh.echo ButtonBox("Msgboxtest", "Black") | | | Function ButtonBox(sPrompt, sColor) | With oIE | .FullScreen = false | .ToolBar = False : .RegisterAsDropTarget = False | .StatusBar = False : .Navigate("about:blank") | While .Busy : WScript.Sleep 100 : Wend | With .document | With .ParentWindow | .resizeto 600,120 | '.moveto .screen.width/2-150, .screen.height/2-60 | .moveto 1, 1 | End With | .WriteLn("<html><body bgColor=Red><center>") | .WriteLn("<font size=4 color=" & sColor & ">" & _ | sPrompt & "</font><p>") | .WriteLn("<button id=but1><font size=3>Done</font></button>") | .WriteLn("</center></body></html>") | With .ParentWindow.document.body | .scroll="no" | .style.borderStyle = "ridge" | '.style.borderStyle = "outset" | .style.borderWidth = "3px" | End With | .all.but1.onclick = getref("buttonbox_done") | | .all.but1.focus | oIE.Visible = True | .title = sPrompt | | On Error Resume Next | While oIE.Visible | WScript.Sleep 1000 | .oIE.AppActivate | Wend | End With ' document | End With ' IE | ButtonBox = "Done" | End Function | | | Sub buttonbox_Done | oIE.Visible = False | End Sub
From: Leon on 30 Jul 2010 03:52 he he this is not a military controlroom The thing is that a warning blink is required so that an operator is warned in particular situations. "Dont sell!!. Dont buy!" But I think I might have come to the solution. A timed script can look after a condition and launch the box if it is not allready opened. Then after a period auto.quit the box.. then as long the condition is true it will continuing opening. Then just saving window position, height and width just before closing it so that the user can place the box a convient place.. On 29 Jul., 16:25, "Mayayana" <mayay...(a)invalid.nospam> wrote: > Isn't that the same question you just asked? > If you can't do it with methods like Refresh then > it may not be possible. Over the years Microsoft > has gradually made that kind of thing more difficult > because they believed the ability was abused. Even > the API method of putting a window on top requires > a hack because MS broke the functionality. And the > system modal options were changed to process-modal, > not actual system modal. > > Personally I can't think of anything except maybe a > nuclear missile launch countdown notice that I would > want to jump to the front every 30 seconds. If any > software tried that I'd get rid of it quickly. > > | > | With these vbs code I opens a IE window.. > | How do I set in a timer so that every 30 second activate this window > | and bringing it to front if the user have taken it in background > | behind other applications? > | > | Cheers > | > | Dim oIE > | set oIE = CreateObject("InternetExplorer.Application") > | wsh.echo ButtonBox("Msgboxtest", "Black") > | > | > | Function ButtonBox(sPrompt, sColor) > | With oIE > | .FullScreen = false > | .ToolBar = False : .RegisterAsDropTarget = False > | .StatusBar = False : .Navigate("about:blank") > | While .Busy : WScript.Sleep 100 : Wend > | With .document > | With .ParentWindow > | .resizeto 600,120 > | '.moveto .screen.width/2-150, .screen.height/2-60 > | .moveto 1, 1 > | End With > | .WriteLn("<html><body bgColor=Red><center>") > | .WriteLn("<font size=4 color=" & sColor & ">" & _ > | sPrompt & "</font><p>") > | .WriteLn("<button id=but1><font size=3>Done</font></button>") > | .WriteLn("</center></body></html>") > | With .ParentWindow.document.body > | .scroll="no" > | .style.borderStyle = "ridge" > | '.style.borderStyle = "outset" > | .style.borderWidth = "3px" > | End With > | .all.but1.onclick = getref("buttonbox_done") > | > | .all.but1.focus > | oIE.Visible = True > | .title = sPrompt > | > | On Error Resume Next > | While oIE.Visible > | WScript.Sleep 1000 > | .oIE.AppActivate > | Wend > | End With ' document > | End With ' IE > | ButtonBox = "Done" > | End Function > | > | > | Sub buttonbox_Done > | oIE.Visible = False > | End Sub
From: Leon on 30 Jul 2010 04:32 Btw is there a way to leave out the minimize, maximize and close buttons in window title? On 30 Jul., 09:52, Leon <kim.zeth...(a)gmail.com> wrote: > he he this is not a military controlroom > > The thing is that a warning blink is required so that an operator is > warned in particular situations. "Dont sell!!. Dont buy!" But I think > I might have come to the solution. A timed script can look after a > condition and launch the box if it is not allready opened. Then after > a period auto.quit the box.. then as long the condition is true it > will continuing opening. Then just saving window position, height and > width just before closing it so that the user can place the box a > convient place.. > > On 29 Jul., 16:25, "Mayayana" <mayay...(a)invalid.nospam> wrote: > > > > > Isn't that the same question you just asked? > > If you can't do it with methods like Refresh then > > it may not be possible. Over the years Microsoft > > has gradually made that kind of thing more difficult > > because they believed the ability was abused. Even > > the API method of putting a window on top requires > > a hack because MS broke the functionality. And the > > system modal options were changed to process-modal, > > not actual system modal. > > > Personally I can't think of anything except maybe a > > nuclear missile launch countdown notice that I would > > want to jump to the front every 30 seconds. If any > > software tried that I'd get rid of it quickly. > > > | > > | With these vbs code I opens a IE window.. > > | How do I set in a timer so that every 30 second activate this window > > | and bringing it to front if the user have taken it in background > > | behind other applications? > > | > > | Cheers > > | > > | Dim oIE > > | set oIE = CreateObject("InternetExplorer.Application") > > | wsh.echo ButtonBox("Msgboxtest", "Black") > > | > > | > > | Function ButtonBox(sPrompt, sColor) > > | With oIE > > | .FullScreen = false > > | .ToolBar = False : .RegisterAsDropTarget = False > > | .StatusBar = False : .Navigate("about:blank") > > | While .Busy : WScript.Sleep 100 : Wend > > | With .document > > | With .ParentWindow > > | .resizeto 600,120 > > | '.moveto .screen.width/2-150, .screen.height/2-60 > > | .moveto 1, 1 > > | End With > > | .WriteLn("<html><body bgColor=Red><center>") > > | .WriteLn("<font size=4 color=" & sColor & ">" & _ > > | sPrompt & "</font><p>") > > | .WriteLn("<button id=but1><font size=3>Done</font></button>") > > | .WriteLn("</center></body></html>") > > | With .ParentWindow.document.body > > | .scroll="no" > > | .style.borderStyle = "ridge" > > | '.style.borderStyle = "outset" > > | .style.borderWidth = "3px" > > | End With > > | .all.but1.onclick = getref("buttonbox_done") > > | > > | .all.but1.focus > > | oIE.Visible = True > > | .title = sPrompt > > | > > | On Error Resume Next > > | While oIE.Visible > > | WScript.Sleep 1000 > > | .oIE.AppActivate > > | Wend > > | End With ' document > > | End With ' IE > > | ButtonBox = "Done" > > | End Function > > | > > | > > | Sub buttonbox_Done > > | oIE.Visible = False > > | End Sub- Skjul tekst i anførselstegn - > > - Vis tekst i anførselstegn -
From: Mayayana on 30 Jul 2010 09:55
Btw is there a way to leave out the minimize, maximize and close buttons in window title? > With an HTA they're partially customizable, but if you start an HTA programmatically you get a download prompt. With IE6 you can design it as a system msgbox and do what you like, but in IE7/8 that doesn't work. You can't remove the "chrome", so you can't remove "controlbox" in the upper right or the title/URL on the title bar. The change was made for security reasons, to prevent disguising an IE window. Could a MsgBox work? The WScript.Shell popup method allows for a timeout and seems to work (at least on my XP tests) as system on-top. Actually, the system modal flag is working for me now in a plain msgbox. I thought it didn't.) The following will show a message on-top (but not locking focus) for 5 seconds. 4160 is 4096 (system modal) + 64 (information icon). Dim SH, Ret Set SH = CreateObject("WScript.Shell") Ret = SH.Popup("Don't sell", 5, "Advice", 4160) |