Window button key on sendkeys.send

window/start button key on sendkeys.send

Page 1 of 1

5 Replies - 15637 Views - Last Post: 13 August 2008 - 04:20 AM Rate Topic: -----

#1 Hasyman  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 6
  • Joined: 12-August 08

Window button key on sendkeys.send

Posted 12 August 2008 - 07:52 PM

im using this code currently
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click


		Shell("notepad", AppWinStyle.NormalFocus)

		SendKeys.Send("example here")

	End Sub



what i need to know is how to "sendkeys.send" the windows/start button
(you know that little window/button on the bottom-left which opens the start menu)

Thank you


This is my first time posting
Please be flexible

This post has been edited by born2c0de: 13 August 2008 - 04:43 AM


Is This A Good Question/Topic? 0
  • +

Replies To: Window button key on sendkeys.send

#2 sired22  Icon User is offline

  • New D.I.C Head

Reputation: 2
  • View blog
  • Posts: 25
  • Joined: 09-August 08

Re: Window button key on sendkeys.send

Posted 12 August 2008 - 07:56 PM

there are actually 3 way to open that
click it
hit the window key on your keyboard (send keys might have that)
also ctrl+esc will also open it.

you just have to program it to send esc with the ctrl modifyer
You also have to do it with api

Public Class Form1
    Private Declare Sub keybd_event Lib "user32" (ByVal bVk As Byte, _
        ByVal bScan As Byte, ByVal dwFlags As Long, ByVal dwExtraInfo As Long)

    Private Const KEYEVENTF_KEYUP = 2
    Private Const vbKeyControl = 17
    Private Const vbKeyEscape = 27

    Private Sub Button1_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

        ' Press the Ctrl-Esc key
        keybd_event(vbKeyControl, 0, 0, 0)
        keybd_event(vbKeyEscape, 0, 0, 0)

        ' Release the two keys
        keybd_event(vbKeyControl, 0, KEYEVENTF_KEYUP, 0)
        keybd_event(vbKeyEscape, 0, KEYEVENTF_KEYUP, 0)
    End Sub
End Class



If you need more keycodes chech out
http://msdn.microsof...025(VS.60).aspx

also i found this code at the following site and tested it

http://www.developer....co.uk/show/274

This post has been edited by sired22: 12 August 2008 - 08:23 PM

Was This Post Helpful? 0
  • +
  • -

#3 Hasyman  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 6
  • Joined: 12-August 08

Re: Window button key on sendkeys.send

Posted 12 August 2008 - 08:00 PM

Thank you
that was very helpful and very quick
Was This Post Helpful? 0
  • +
  • -

#4 sired22  Icon User is offline

  • New D.I.C Head

Reputation: 2
  • View blog
  • Posts: 25
  • Joined: 09-August 08

Re: Window button key on sendkeys.send

Posted 12 August 2008 - 08:24 PM

i just updated my post with code i tested myself from a site i found
Was This Post Helpful? 0
  • +
  • -

#5 Hasyman  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 6
  • Joined: 12-August 08

Re: Window button key on sendkeys.send

Posted 12 August 2008 - 09:22 PM

Thanks
Was This Post Helpful? 0
  • +
  • -

#6 ashura517  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 33
  • Joined: 11-March 08

Re: Window button key on sendkeys.send

Posted 13 August 2008 - 04:20 AM

The key code constants from msdn i see that it is for vb 6. But does it work for vb 2005 express?

This post has been edited by ashura517: 13 August 2008 - 04:21 AM

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1