I want to cal window button using sendkeys.send() method. I have tried with sendkeys.send("{WIN}") and sendkeys.send("{Lwin}"). but not working..
Can you help me
10 8764
I created client-server application. In that, if I press windows key in server side that should be triggered programmatically at the client end. I want to know how to invoke that key press at client end using send-key methods.
You can't handle windows key.
You can't handle it, but you can react to it. -
Private Sub Form1_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles Me.KeyDown
-
If e.keyvalue = 91 Then
-
'the windows key has been pressed
-
End If
-
-
End Sub
-
The key still gets handled by windows. You can not suppress it, or cancel it, but you can have code in your program do something when it is pressed.
If you want to send it you can send it with SendKeys.send(key.lwin) - which sends the left windows key to the application with the current focus - but apparently does NOT send it to the OS because I have been unable to get Windows to react to it. I may be doing something wrong though... -
-
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
-
-
AppActivate("Some Unsuspecting Application")
-
SendKeys.Send(Keys.LWin)
-
-
End Sub
-
I created client-server application. In that, if I press windows key in server side that should be triggered programmatically at the client end. I want to know how to invoke that key press at client end using send-key methods.
Maybe the answer is concentrate on *why* you want to send the Windows key. Sending the Windows key is a means to an end. What is the end goal you are trying to achieve. There may be another way to do it. For example in the LockWorkstation example you don't send Windows-L, but you can call the LockWorkstation WinAPI call. So what are you trying to do by sending the Windows key?
I concur with tlhintoq, it seems like sendkeys is just the wrong approach for what you may want to do. Let us know more about what you want to do and someone may be able to suggest a workable solution for you.
Windows API's aren't all that scary ....
Just I want to invoke the following keys like win+d,win+E and other so that I need..... Is there any another way?
Newbie:
We already know that. It won't help for you to ask the same question over and over again without answering any of ours! Tells us more about what it is you want to do. Win+E brings up an explorer panel - that's easy to do without trying to stuff keystrokes into the system.
Just I want to invoke the following keys like win+d,win+E and other so that I need..... Is there any another way?
Yes. There are other ways to do things you are wanting to do. Don't get tunnel vision. You are so focused on sending a Windows key that you are not looking for other methods or reading the tips given to you.
Win+L gives you a lockworkstation and you have been given a method for that.
You want to do a Win+E for Windows explorer. - Process.Start("explorer.exe", locationToOpen.Text);
Try searching for your actual goals ("C# Open WIndows Explorer") instead of what you think is the only method.
Thank you for your kind response.....
Sign in to post your reply or Sign up for a free account.
Similar topics
by: black |
last post by:
Howdy~
i am with Win2k and had built a window with Tkinter, it has 3 button on its topright corner as common window, but what i want is just one or tow of them. ie, is there any way i can...
|
by: black |
last post by:
Howdy~
i am with Win2k and had built a window with Tkinter, it has 3 button on its topright corner as common window, but what i want is just one or tow of them. ie, is there any way i can...
|
by: William Gill |
last post by:
I am trying to make a simple data editor in Tkinter where each data
element has a corresponding Entry widget. I have tried to use the
FocusIn/FocusOut events to set a 'hasChanged' flag (if a...
|
by: ...D. |
last post by:
OK. I am halfway decent with HTML. Now I want to try javascript for some
things that HTML cannot do. I have looked over a tutorial & all.
What I want to do is create a button, that when...
|
by: Damien Kay |
last post by:
Hi,
Is there a way of disabling the close window, minimise and maximise buttons
on a webform?
Thanks,
Damien.
|
by: Nathan Sokalski |
last post by:
How do I open and change properties of (such as size, position, scroll
position, visibility of toolbars, etc.) a browser window? Thanks.
--
Nathan Sokalski
njsokalski@hotmail.com...
|
by: rakesh_nits |
last post by:
Hi All,
I want to close a directory which is being opened.what i have is only
the path of the directory.How can i emulate clicking the close button
on this window programmatically.Thanks in...
|
by: askarnice |
last post by:
How to Refresh a page on Back button. Cannot be refresh on click back button . How we can solve this problem pleae Reply
|
by: King Coffee |
last post by:
Hi,
I popupped a new asp.net window. Within it I want to display an explicit
close button. How .Net object can I call to close this popup window
programmatically?
King
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new...
| |