473,626 Members | 3,389 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

how to simulate the right mouse button in programs

hi, i need to simulate the right mouse click and choose an option.
i want to use (in .net) the option "print" that appear when i right-click on
..doc file and be able to change the printer before and after the print.
can i launch word from command line forcing it to print a document?

thanks
Nov 20 '05 #1
2 1780
* "sandro72" <gf*****@pippo. com> scripsit:
hi, i need to simulate the right mouse click and choose an option.
i want to use (in .net) the option "print" that appear when i right-click on
.doc file and be able to change the printer before and after the print.
can i launch word from command line forcing it to print a document?


\\\
Dim p As New System.Diagnost ics.ProcessStar tInfo()
p.Verb = "print"
p.WindowStyle = ProcessWindowSt yle.Hidden
p.FileName = "C:\filename.do c"
p.UseShellExecu te = True
System.Diagnost ics.Process.Sta rt(p)
///

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #2
I found the classes you wrote of but it doesn't work. i tested also this
code but it cretaes instances of worpad.exe that i only see

by task manager. have you any ideas?

Dim pr As New System.Diagnost ics.Process

pr.StartInfo.Wi ndowStyle = Diagnostics.Pro cessWindowStyle .Normal

pr.StartInfo.Cr eateNoWindow = False

pr.Start("C:\Pr ogrammi\Windows NT\Accessori\wo rdpad.exe")

"Herfried K. Wagner [MVP]" <hi************ ***@gmx.at> ha scritto nel
messaggio news:br******** ****@ID-208219.news.uni-berlin.de...
* "sandro72" <gf*****@pippo. com> scripsit:
hi, i need to simulate the right mouse click and choose an option.
i want to use (in .net) the option "print" that appear when i right-click on .doc file and be able to change the printer before and after the print.
can i launch word from command line forcing it to print a document?


\\\
Dim p As New System.Diagnost ics.ProcessStar tInfo()
p.Verb = "print"
p.WindowStyle = ProcessWindowSt yle.Hidden
p.FileName = "C:\filename.do c"
p.UseShellExecu te = True
System.Diagnost ics.Process.Sta rt(p)
///

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>

Nov 20 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
1886
by: charliewest | last post by:
I am trying use server controls or web controls to simulate the following behavior. I've an image wrapped w/in a link to create a rollover effect as if both elements we're one graphic: <a href="javascript:submit();" onMouseOver="MM_swapImage('Image1221','','images/btn_green_on.gif',1)" onMouseOut="MM_swapImgRestore()" id="A1" runat="server"> Next <img src="images/btn_green.gif" alt="Next" name="Image1221" width="16" height="16"...
4
5171
by: johnny | last post by:
On a form I would like to simulate a button click when the Enter is pressed. My form is setup and it works if the delegate for the key pressed on the form calls the delegate for the button pressed. But can we simulate a button click instead? This way if later the delegate is changed for the button, we don't forget to do the changes on other events?
13
2292
by: James Bond | last post by:
Hello. My 80+ year old father has recently decided to get his first computer. Due to his age (and I suspect lack of playing pong as a child like I did) he lacks the manual dexterity to use a mouse well. He is frequently missing the left mouse button and hitting the right, or less often the middle (wheel) buttons. While he is very slowly getting better with practice, the frustration level is high for him as a result of this (he gets very...
3
2291
by: Ryan Liu | last post by:
Can someone give a sample to prevent a row from being deleted in a datatable? I tried e.Row.RejectChanges(); in dt_RowDeleting() but seems does not work. I need verify if there other data using data in this row before actually remove it from datagrid. I can certainly control with Delete button. But if I want to allow the user to use Del key on the keyboard, I lost this kind control.
3
34779
by: madhuri.eerupula | last post by:
Hi. How to simulate(automatic) mouse movements and click operation using c#. Actually, i got pixels in the face (face tracking) right now and i need to move mouse(automatically, without using mouse manually) i.e., simulate mouse click operation using those pixels in c#. I think we can use robot() class in java , to achieve this, but how can we do this using c#. Hope you understand my problem and get bck to me asap. thanx bye
3
29860
by: John Dalberg | last post by:
I have an app that keeps popping up a windows with a 'Yes' or 'OK' button on it. I am trying to write a little app that automates hitting the enter key so I don't have to do it myself. I used the FindWindow method to get a handle of the window and then issued: SendMessage(hwnd, 273, 0, IntPtr.Zero) to send an ENTER key to it but it didn't work. If I need to get the handle of the 'OK' button, how do I do it? (How do you
4
7506
by: flplini | last post by:
I want to ask how to use C++ to simulate the mouse control? ex:Let the mouse double-click the left key functions,thanks!
18
22088
by: eliss.carmine | last post by:
Is it possible to simulate a mouse click in the window I made (it's a Form), but not give it focus? I tried using WinAPI's mouseevent and SendMessage of WM_LBUTTONDOWN/WM_LBUTTONUP as suggested by the folks in #winapi on EFnet, but I think those require the window to have focus. Either that, or I'm doing something else wrong. The click actually seems to work once, and then stops working... I have no idea what is the problem actually....
5
30603
by: nuhfeken | last post by:
We have a C# winform that uses the MVP design pattern for the user interface. For reasons I'd rather not explain we need to simulate a right mouse click on a specific control to deactivate the control. I found code that almost does what we need. private static extern void mouse_event( UInt32 dwFlags, // motion and click options UInt32 dx, // horizontal position or change UInt32 dy, //...
0
8202
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
8366
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8510
tracyyun
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7199
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6125
isladogs
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5575
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4093
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2628
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1812
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.