I\'ve looked everywhere for this, is it actually possible to do? If you press WIN + LEFT ARROW it will mount your selected window to the left of your screen, and that\'s exa
Yes, You can send the windows key in VBS.
Set vb = CreateObject("WScript.Shell")
vb.Sendkeys "^{ESC}"
It's actually alt + Esc work as windows key.
a very late response, but here is my working effort
Dim shellObject : Set shellObject = CreateObject("WScript.Shell")
Extern.Declare micVoid, "keybd_event", "user32.dll", "keybd_event", micByte, micByte, micLong, micLong
Const KEYEVENTF_KEYUP = &H2
Const VK_LWIN = &H5B
Wait 5
Call Extern.keybd_event(VK_LWIN,0,0,0) 'press win key
Wait 5
shellObject.SendKeys "({UP})" 'right aline the window. TODO Error handlng
Wait 5
Call Extern.keybd_event(VK_LWIN,0,KEYEVENTF_KEYUP,0) 'up win key
Set shellObject = Nothing
VBScript's SendKeys
doesn't support the Windows key.
You can use AutoIt instead:
Send("{#Left}")
Oh, so you want to mount the window to the left, I currently don't think there's a way to do that, but there's another shortcut for start menu, as well as windows key, it's Ctrl+Esc, ^{ESC}
, you could possibly run the onscreen keyboard, then somehow tab over to the key, but it would be hard, also how about trying Alt+Space, %{SPACE}
, to click the window icon then, M
for move, then set the cursors position to the left of the screen, somehow? I don't currently need help moving the cursor in V.B.S., but you could Google it. Hash symbol is actually typing the symbol #
, hash, tested with this. I also got help on the send-keys function, here. I have way to much researching, but I still can't find a answer. Some-one also said using "Auto hotkey", a third party program, but I don't really trust programs that can take control over your whole PC.
So I guess your options are:
Set Keys = CreateObject("WScript.Shell")
Keys.SendKeys("^{Esc}")
This should work, it Simulates the push of the Windows key by pushing the CTRL ^
and the ESC {Esc}
keys, i don't know how to make the window mount to the left of the screen