1.

Solve : I want some help with Focusing?

Answer»

I know that it is not possible to focus a window in dos,
but i do know its possible in vbs. so if some one can help me to create a vb script that makes the window with title name "Diablo II" get focused and i also want to know the command for running vbs scripts from batch. correct my SPELLING it sucks :/

//oGeLaM!Perhaps you could be more specific in what you are trying to do. VBScript has no native way of creating a window. It can however create OBJECTS which may or may not have a focus property.

There are technologies for creating windows. HTML Applications (HTA) use a combination of HTML and VBScript that is interpreted within Windows; no browser needed. Powershell can also create windows within the .NET framework. The HTA interpreter comes with windows, however Powershell is a download that also requires the .NET framework to be installed.

Just as batch files need the command/cmd processor, VBScript requires either the wscript or cscript processor.

To get you started, this very basic HTA will create a window, focus it, and put the title Diablo II in the title bar:

Code: [Select]<html>
<!--
-->
<head>
<title>Diablo II</title>
</head>
<SCRIPT LANGUAGE="VBScript">
Sub Window_onLoad()
window.focus
End Sub
</SCRIPT>
<body>
</body>

Save the script with a HTA extension and run from the command prompt.

Good luck.

The nice thing about scripts is there is none of that PESKY compiling and LINKING associated with programming languages.



Discussion

No Comment Found