473,394 Members | 1,778 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

how to sendkey for 1 processe?

i know how to send key
so i want to send for 1 processe
like to send for notepad.exe only
i can do it?
and how i can do that?
if you can put this code? its really will help me


(sry on my bad english and anyway and this site help me alot)
Apr 3 '08 #1
3 1727
jeffstl
432 Expert 256MB
i know how to send key
so i want to send for 1 processe
like to send for notepad.exe only
i can do it?
and how i can do that?
if you can put this code? its really will help me


(sry on my bad english and anyway and this site help me alot)
Not sure. Is this what you are referring to ?

A way to open up notepad from inside VB Application?

Expand|Select|Wrap|Line Numbers
  1. Shell "NOTEPAD.EXE C:\MyTestFile.txt", vbNormalFocus
  2.  
Apr 4 '08 #2
Dököll
2,364 Expert 2GB
i know how to send key
so i want to send for 1 processe
like to send for notepad.exe only
i can do it?
and how i can do that?
if you can put this code? its really will help me


(sry on my bad english and anyway and this site help me alot)
Your English is actually not that bad:-)

Would you be interested a tutorial? I found this bit of code for you. Not sure how skilled you are in VB6.0, if you feel a tutoraila may help please let us know:

Expand|Select|Wrap|Line Numbers
  1. Option Explicit
  2. Global Notepad as Object
  3. global WorkingPath as string
  4. Global NewFile1 as String
  5. ------------------------------
  6. Sub Do_Shell()
  7. 'Open Notepad
  8.     Shell "c:\WINDOWS\notepad.exe", 1
  9.          SendKeys "^(V)", True
  10.         'SendKeys "{F10}", True  '(These last 4 do the
  11.         'SendKeys "{RIGHT}", True 'same thing as ^V.  
  12.         'SendKeys "{DOWN 4}", True  'They are not working 
  13.         'SendKeys "{ENTER}", True   'either.)
  14. ' Save NewFile#
  15.     Notepad.SaveAs FileName:=WorkingPath & NewFile1, _
  16.        FileFormat:="vts", Password:="", 
  17.        WriteResPassword:="", _
  18.        ReadOnlyRecommended:=False, 
  19.        CreateBackup:=False
  20. 'Close NewFile1
  21.     Notepad.Quit
  22. -----------------
  23. Sub Run1()
  24. Dim XLFile As String           'XLFile is current workbook
  25. Dim LotusFile As String        'Previously saved file
  26.  
  27. WorkingPath =ThisWorkbook.Worksheets("Input").Range("C11")
  28. XLFile = ThisWorkbook.Worksheets("Input").Range("B3")
  29. LotusFile = ThisWorkbook.Worksheets("Input").Range("C12")
  30. NewFile1 = ThisWorkbook.Worksheets("Input").Range("C13")
  31.  
  32. ThisWorkbook.Activate
  33. Sheets("Calculations").Select
  34. Range("B3:B122").Select
  35. Selection.Copy
  36. Call Do_Shell
  37.  
  38. ....
  39.  
  40. End Sub
  41.  
Good luck with the project!

Dököll
Apr 4 '08 #3
Your English is actually not that bad:-)

Would you be interested a tutorial? I found this bit of code for you. Not sure how skilled you are in VB6.0, if you feel a tutoraila may help please let us know:

Expand|Select|Wrap|Line Numbers
  1. Option Explicit
  2. Global Notepad as Object
  3. global WorkingPath as string
  4. Global NewFile1 as String
  5. ------------------------------
  6. Sub Do_Shell()
  7. 'Open Notepad
  8.     Shell "c:\WINDOWS\notepad.exe", 1
  9.          SendKeys "^(V)", True
  10.         'SendKeys "{F10}", True  '(These last 4 do the
  11.         'SendKeys "{RIGHT}", True 'same thing as ^V.  
  12.         'SendKeys "{DOWN 4}", True  'They are not working 
  13.         'SendKeys "{ENTER}", True   'either.)
  14. ' Save NewFile#
  15.     Notepad.SaveAs FileName:=WorkingPath & NewFile1, _
  16.        FileFormat:="vts", Password:="", 
  17.        WriteResPassword:="", _
  18.        ReadOnlyRecommended:=False, 
  19.        CreateBackup:=False
  20. 'Close NewFile1
  21.     Notepad.Quit
  22. -----------------
  23. Sub Run1()
  24. Dim XLFile As String           'XLFile is current workbook
  25. Dim LotusFile As String        'Previously saved file
  26.  
  27. WorkingPath =ThisWorkbook.Worksheets("Input").Range("C11")
  28. XLFile = ThisWorkbook.Worksheets("Input").Range("B3")
  29. LotusFile = ThisWorkbook.Worksheets("Input").Range("C12")
  30. NewFile1 = ThisWorkbook.Worksheets("Input").Range("C13")
  31.  
  32. ThisWorkbook.Activate
  33. Sheets("Calculations").Select
  34. Range("B3:B122").Select
  35. Selection.Copy
  36. Call Do_Shell
  37.  
  38. ....
  39.  
  40. End Sub
  41.  
Good luck with the project!

Dököll
its helped me
and i did it =P

Expand|Select|Wrap|Line Numbers
  1. WinWnd = FindWindow(vbNullString, "Text") 'text = the process
  2. SetWindowPos WinWnd, HWND_TOPMOST, X1, X2, X3, X4, SWP_NOACTIVATE Or SWP_SHOWWINDOW Or SWP_NOMOVE Or SWP_NOSIZE
  3.  
Apr 4 '08 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: baileystuff | last post by:
I have an issue where I have three Cases that SHOULD act the same but don't. If you look at the code below you will see that the general premise is to open a MSWord template and then use SendKey...
0
by: Alexander Ovchinnikov | last post by:
Hi All! Is it Possible to send some kind of string from Windows Service to IIS application so the latter can get info through javascript function String.fromCharCode( window.event.keyCode ). I'm...
1
by: veenakj | last post by:
Hi, We use ASP.NET framework v1.1.4322, ADO.NET and Oracle 9i Database. This problem is with only with method which takes long time executing a proc in database.
0
by: angelsoft | last post by:
How to send Microsoft Natural Keyboard keys with sendkey method ej. Windows Logo: Start menú, Windows Logo+R: Run dialog box
0
by: Gunawan | last post by:
Can someone help me how to write console application to sendkey c:>sendkey {ALT}+{TAB} simulate key ALT+TAB TIA Gun
7
by: JV | last post by:
I am running a large Access 2000 application (installed using Access Runtime) that uses many VB SendKeys, primarily to expand combo boxes On Enter. When trying to run it on Vista I get a...
2
by: =?Utf-8?B?TmV0d29yeHBybw==?= | last post by:
Whenever an ASP.NET server-side control is processed, the client form is repainted from the top forcing users to scroll back to where they were on long forms. How can I work around this issue?
12
by: DAHMB | last post by:
I have a form that calls up a report in the form I have several date fields that have date input masks. I have created a cancel button as: Private Sub btnCancel_Click() On Error GoTo...
1
by: John Dio | last post by:
I am trying to create a on screen key board. I simply want to send a key (Simulate the keyboard) to a combo box using the Handle of the control. The below code is not working
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
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,...
0
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...
0
jinu1996
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...
0
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...
0
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...

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.