SendKeys Not Working In Windows XP?
Hello,
Am I the only one that has trouble with SendKeys? The simple code below won't even compile, giving me the following error message:
"Expected variable or procedure, not project"
I've searched high and low almost all VB-related discussion lists, and the result is zip! The statement works fine if I am sending the keys to a control within the form. Yet it refuses to work on any other window, invoqued by the Shell command. Please help!
Windows XP 2002, Professional Version, SP 1 VB6
________________________________________ Private Sub Command1_Click()
Dim ReturnValue, I ReturnValue = Shell("CALC.EXE", 1) ' Run Calculator. AppActivate ReturnValue ' Activate the Calculator. For I = 1 To 100 ' Set up counting loop. ' the error happens here SendKeys I & "{+}", True ' Send keystrokes to Calculator Next I ' to add each value of I. SendKeys "=", True ' Get grand total. 'SendKeys "%{F4}", True ' Send ALT+F4 to close Calculator
End Sub
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Sendkeys Not Working
WHen im in game and i send keys through VB eg
SendKeys "w"
and w is binded to go forward, when i send it like this the game just goes crazy. it doesnt behave like if i pressed w at all, but more like if i pressed esc. can you please help me ?
Sendkeys Not Working
Hey guys I'm getting back into doing some programming and I'm a littles ways off from knowing exactly what I'm doing But what I do have is a code that I am using to manipulate a program and it works fine except when i place a message box after it when I do that all of the sendkeys that I had made dont actually show up, if I remove the message box it works fine though. Below is the code any help would be appreciated!
Private Sub Command3_Click()
Shell "notepad.exe", vbNormalFocus 'actual code opens a different program I am using notepad to see if texts appears correctly
SendKeys "%(O)" 'opens menu with alt+O
SendKeys ("{enter}") ' accepts the settings
SendKeys ("user") 'enters programs username
SendKeys ("{tab}") 'tabs to next line
SendKeys ("pass") 'enters programs password
MsgBox "Acess Control-M" 'this is to pause so the user knows to get to a certain point manually in the program
SendKeys ("test") 'I then need to go about autimating a keying sequence in the program
Sendkeys ( And ) Not Working
as the title says im having problems with the sendkeys of ( and ) anyone know a way around it without inserting text into textbox.
Sendkeys Not Working
I am trying to use sendkeys to open a link on a webpage, but it is not working. Here is my code, can anyone help?
vb code:
Set IE = CreateObject("InternetExplorer.Application")
IE.Navigate "http://www.google.com" ' not the real site, real site intranet
IE.Visible = True
Do While IE.Busy
DoEvents
Loop
SendKeys "{TAB 29}", True ' link on site
SendKeys "{ENTER}", True ' enter to navigate to link
SendKeys "{TAB 2}", True ' move to next link
SendKeys "{ENTER 3}", True 'enter to navigate to link, begin downoad, confirm location.
IE.Quit
Set IE = Nothing
Sendkeys Not Working, Help!
Hi, I am trying to Press Ctrl+G in another app (AOl) then put stuff into the box that appears.
On pressing Ctrl+G a box should appear asking for details, however the box wont appear, what have I missed out?
Code:
AppActivate "AOL"
SendKeys "^{G}"
...
Ive tryied it as just "^G" but it wont work either.
Thanks for any help
SendKeys Not Working?
On my old computer, Send Keys never gave me
any problems, but now send keys won't work
at all on my new one. Any ideas?
Thx...
-Justin =]
[This message has been edited by jgomes (edited 01-29-2000).]
Sendkeys Not Working :(
hi all
for some reasons the code posted on a post in vbcity doesnt seem to work for me
m using win2k outlook express 6
i also tried this with microsoft outlook cos the sendkeys are the same
i m able to open the new message window in moutlook
but nothing happens in oe
my code is pasted below
Code:Option Explicit
Private Sub Command1_Click()
'this m trying for microsoft outlook
Navigate "mailto:samir@csil.co.in?subject=" & _
"There is something I want to tell you&body=" & _
"Here's how you use Sendkeys for Alt and S ....."
SendKeys "{Tab}{Tab}{Tab}{Tab}", True ' Page down from Headers into message body area.
SendKeys "(%FE)" ' Key combo to send the message
End Sub
Private Sub Command2_Click()
' this for outlook express
'Recipient = "samir@csil.co.in"
'Subject = "Demo of Sendkeys"
'Message = "OK, so it's not Rocket Science, but, hey, it works....."
Dim myAppID 'Default As Variant
myAppID = Shell("c:Program FilesOutlook Expressmsimn.exe", 1) ' Run
' Note :next line needs error trap as you will get error thrown if OE already open
AppActivate myAppID
SendKeys "(%FNM)" ' Create a new message
'SendKeys Recipient ' Paste in Address
SendKeys "{Tab}{Tab}{Tab}", True ' Tab down to Subject line
'SendKeys Subject ' Paste it in
SendKeys "{Tab}" ' Tab to Message Body
'SendKeys Message ' Paste it in
' Optional: Wait for user input - amend, add, etc - then user to send.
' Else send automatically with
SendKeys "(%FE)"
End Sub
Public Declare Function ShellExecute _
Lib "shell32.dll" Alias "ShellExecuteA" ( _
ByVal hWnd As Long, _
ByVal lpOperation As String, _
ByVal lpFile As String, _
ByVal lpParameters As String, _
ByVal lpDirectory As String, _
ByVal nShowCmd As Long) As Long
Public Sub Navigate(ByVal NavTo As String)
' Sub used to fire up a new email or a web page
Dim hBrowse As Long
hBrowse = ShellExecute(0&, "open", NavTo, "", "", 1)
End Sub
pls let me know m stuck
Samir
Skill is successfully walking a tightrope over Niagara Falls. Intelligence is not trying.
Edited by - samirprabhudesai on 12/18/2003 9:17:01 PM
Component Not Working In Windows 2003 Server But Working In Windows 2000 Server
hi,
I have a VB upload component which woeks weel with the Windows 2000 server but when i have the same component installed in the Windows 2003 server it is not working. It is displaying the following error. error '800706be' . Searching the microsoft support site i cannot get any relevant information. If anyone has solution for this.
Bye
Sridharan
Sendkeys Stopped Working
Hello
I'm capturing web pages that I need to save. The way that I'm doing it now is to right click on the page and choose view source. I end up with a total of 10 pages open in 10 notepads all with the same name. Then I use and app that I created that:
Saves the notepad window as a txt file using sendkeys.
Opens that saved file.
Parses it to determine the appropriate name for it and saves it as that htm file.
But recently the sendkeys function has stopped working or something in that part of the function anyway and I can't figure out why. When I try to step it through to find where it's broken the break kills the focus to the notepad window and I'm unable to continue.
Any ideas?
Thanks
David
WshShell.SendKeys Not Working
Hi,
I have a website that needs to be updated automatically twice a day. Updating it is done by just opening an ASP file on the site, the ASP code within the page updates the database for you.
What I plan on doing is using scheduled tasks to open the link twice a day. I planned on using VBscript to do it.
This is the code I'm using (set to open google.com)
Code:
Set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.Run "iexplore http://www.google.com", 9
WScript.Sleep 60000
WshShell.SendKeys "%{F4}"
This works fine when I test it on my laptop, but when I remote desktop to my server (housed in chicago) and setup the VBS file on there, the SendKeys function doesn't work. Internet Explorer opens, but it doesn't close, no error messages.
I thought it might be something to do with using remote desktop and not using a keyboard connected to the server or something. So I set it as a scheduled task, closed the remote desktop connection, waited a bit. But when I logged back in it had open IE but hadn't closed it, just like before.
Does anyone know why it is doing this, or how to fix it?
My server is running windows server 2003
Thanks!
Why Isnt This Sendkeys Command Working ?
Code:
option explicit
private sub Timer1_Time()
Dim name As String
Dim counter As Integer
Open "c: est.text" For Input As #1
counter = 1
Do While Not EOF(1)
Input #1, name
Text1.Text = name
AppActivate "A Program"
SendKeys Text1
SendKeys Chr(13)
SendKeys Chr(13)
counter = counter + 1
Loop
Close #1
end sub
i can see the textbox changing words all the time as it reads the test.text file. But it doesnt send the text to the 'A Program' application. When appactivate sets focus to the application you see the cursour flashing in its textbox so it must be ready to recieve the textboxes text. Once it has supposedly sent the text to the application it is supposed to hit enter (on its default command button) and then hit enter again on the messagebox that pops up and repeat the process until the file ends.
any ideas why this isnt working?
Thanx for any assistance
SENDKEYS Stopped Working - Using SENDMESSAGE
In an application that I have we use SENDKEYS to scan the screen of another application via SENDKEYS "^c",TRUE (cntl-c) and then read the clipboard. This code no longer works 100% of the time. Sometimes the c replaces or become part of the field we are trying to read.
I am looking for a way to replace the SENDKEYS or at least make them work.
Using SENDMESSAGE I can replace the SENDKEYS ^c with WM-COPY but I need to get the handle of the control I am reading. (I don't need to do this with SENDKEYS).
I can get the handle of the screen but it has dozens of controls. And I do not know which has focus. The text boxes are of class 'Edit' but how to tell if has focus????
I have tried using GetWindowThreadProcessId and GetGUIThreadInfo but that always points back to the parent control and does not give me the edit control in focus. I know that it must be there somewhere since when the entire application is in focus the control text in question is selected.
How can I get Sendkeys or Sendmessage to scan the text fields of the in-focus controls?
Thanks
Jack
Sendkeys Windows Key?
i need to open a program so i want the program to go to the desktop and open it i thought the best way would be to use sendkeys like sendkeys "{windows key or some **** like that}" & "d"
any ideas?
SendKeys Under Windows Vista
Hello, is it true that the following code:
VB Code:
Private Sub Form_KeyPress(KeyAscii As Integer)If KeyAscii = vbKeyReturn Then SendKeys ("{TAB}") KeyAscii = 0End IfEnd Sub
generates an error under Windows Vista or on a machine equipped with Internet Explorer 7.0?
What is exactly the error message that you get? And does the error cause the application to shut down if it is not handled?
Unfortunately, I have neither Windows Vista nor IE 7.0 installed on my computer, so I cannot test it by myself.
Any help will be appreciated.
SendKeys And Flash Windows
I wrote a game in flash and a program in visual basic to make a chat system for it. How can I use sendkeys on a flash window, because even when the window has focus it doesn't send the text.
Windows NT And VB 'Sendkeys' Function
A user of an application I have written is experiencing problems. The application uses the 'Sendkeys' function to enter data into an Oracle Form from a comma delimited file.
He is running windows NT. The problem occurs in the actual entry into the Oracle Form. Some of the 'Sendkeys' appear not to work and incorrect values are entered into some of the cells on the form. This ends up causing Oracle Errors due to validation in the various cells.
All other users of the application (whether on windows NT machines or windows 95) have not experienced any problems.
Any ideas? Could this be a Windows API issue? Could focus be shifting away from the oracle form for some reason.
Any contributions gratefully accepted.
Many thanks,
Roger Eigenheer
SendKeys "{Enter}" Not Working
I'm using this code:
Code:
SendKeys "{Enter}"
It worked fine, until today. It just won't send the key to the focused window. It's just blinking NumLock..
Could any kind person give me the code that i could use to simulate Enter key in any focused window?
"sendkeys" Statement Not Working
The following code does't work and I dont know why. Notepad opens but the keystrokes aren't sent.
Can anyone help.
x = Shell("notepad")
AppActivate "untitled - notepad"
SendKeys "test entry{enter}", True
.udl Not Working In Windows
I am trying to create a .udl file. I have created it in notepad and changed the extension. The icon does not change from a text file, therefore I cannot create the file.
Does anyone know what I can do in order to create a .udl file. I can do it on several of my other computers but my Dell Laptop does not work. Is there a service pack or some other Windows component I need to install?
Thanks for your help!
Vb Working With Another Windows Program!
Hi,
Im trying to make a program that interacts with a windows program, but i cant figure out how to call upon the other program and make my proggie work with the windows program...... Any help i could get will be aprecciated!!
THANX
DJ
Working With The Windows Registry Etc.
Hi,
I have created my own file type which my program works with and I was just wondering:
1) How can I tell the Windows registry to connect the file extension with my program
2) How can I make my program deal with command-line extensions e.g. (Run "C:MyProgram.exe -command") as this method would obviously have to be employed for the program to know what file to open when it is started up.
I hope you understand the question, Im finding it hard to write it so it sounds right. Any help will be 'preciated.
How To Get Working Windows Langauge
hi I want to ask about code or function in api which tell me what is the langauge which is using in computer now
I mean when the user change langauge by using {ctrl} {shift} I want to know the langauge which is used
I tried GetSystemDefaultLangID and GetUserDefaultLangID
but it give me constant langauge (default)
i want function which read langauge which using on pc in the same moment
and when changed by {ctrl} {shift} I can read the new one
thanks ......
Working With Windows Colors
I have a quick question, that I hope has a quick answer
I am working on a small app for my office. The problem is, all the users that have XP installed don't always use the same Windows color scheme. I have designed and tested it on an XP Pro machine with the default colors and everything looks great. But, other people have different themes and color schemes. This causes certain things within the app to have the wrong color and just appear to be wrong.
For instance. I have a Label that has the same backcolor as the Form to make it blend in. When someone loads the program and has the Chrome Windows Theme going, the label shows up as black or sometimes white.
Is there something design wise or code wise I should be aware of to make sure that the colors I design the program with don't get messed up by a Windows Theme?
Thanks
Right$ And Left& No Working In Windows XP
Hello,
The VB6 code I had written worked before on my Windows 2000 computer. I have now upgraded to windows XP and now the string functions no longer work, I get a "Can't find project library" error.
I have listed a few of the lines below.
FileDateHolder = Right$ (Filename,3)
LineId = Left$ (Newline, LineIdNum -1)
Thanks in advance for any help.
-G-
ChDir Not Working With Windows XP
Hello,
I am using data from Access and viewing it as a report in Crystal Reports. My problem is......... before printing report in the Crystal Report I am setting the path of the access file like this
Code: ChDrive App.Path
ChDir App.Path
This is working fine on windows 98,win 2000. But when the same program is run on Win xp it is changing the drive but not the directory and hence giving me an error of not finding the access file.
Can someone please help me with this problem.
Thanks in advance
Getting Error 430 When Working On Windows Vista
hi
i developed vb application using vb6.0 .when i tries to install on vista system i am getting
error 430:Class does not support Automation or does not support expected interface
i am unable to make binrayCompatability of MSCOmm dll.i think the error is coz of this one
please help me in solving this issue
Regards
Vinay Kumar
Application Is Not Working On Windows 2000
Hello all,
I a novice in VB. We needed application that will close an application programmatically. I found something in ms support site that will do exactly what we wanted. I tested the application it works fine on a xp station but it does not work at all on a windows 2000 machine. Could someone let me know what do I have to do to make this application work for windows2000 pc? here is the link to the application I downloaded : http://support.microsoft.com/?kbid=176391#kb2. thank you very much.
SendKeys "^A" Is Not Working..
Hi to all thread viewers,
I'm in need to select a text box contents and then delete using SendKeys..
My code is:
Quote:
SendKeys "^A"
SendKeys "{Delete}"
SendKeys "^A" is not working, while SendKeys "^Z" is working fine..
Please help...
Sendkeys "^c" To A Windows Application And Paste On Form
Hi,
I have a form (always on the foreground) with a button on it. If someone presses this button the selected text in a different application should be copied. The code works like this (the text selection is already done in another application)
Code:
'1) minimize form, so the application with the selected text on it is on the foreground
frmMain.hide
'2) short delay, so I'm sure frmMain is minimilized
sleep(200)
'3) simulate ctrl + c = copy (the application with the selected text knows this key combination)
sendkeys "^c", true
'4) show form again
frmMain.show
'5) paste the content of the clipboard in a textbox
textbox.text = clipboard.gettext
This code works without problems on most (standard) applications like word, excel, IE, ... But in some cases the selected text isn't always copied (ctrl c is recognized by the application). In other cases is works fine for a while, after that you have to click several times, ...
Does anyone know what the problem could be? I already tried to increase the delay (no result), to empty the clipboard first (clipboard.clear / no result) and to use DoEvents (no result). I really have no idea anymore what the problem could be
Sendkeys "^c" To A Windows Application And Paste On Form
Hi,
I have a form (always on the foreground) with a button on it. If someone presses this button the selected text in a different application should be copied. The code works like this (the text selection is already done in another application)
VB Code:
'1) minimize form, so the application with the selected text on it is on the foregroundfrmMain.hide '2) short delay, so I'm sure frmMain is minimilizedsleep(200) '3) simulate ctrl + c = copy (the application with the selected text knows this key combination)sendkeys "^c", true '4) show form againfrmMain.show '5) paste the content of the clipboard in a textboxtextbox.text = clipboard.gettext
This code works without problems on most (standard) applications like word, excel, IE, ... But in some cases the selected text isn't always copied (ctrl c is recognized by the application). In other cases is works fine for a while, after that you have to click several times, ...
Does anyone know what the problem could be? I already tried to increase the delay (no result), to empty the clipboard first (clipboard.clear / no result) and to use DoEvents (no result). I really have no idea anymore what the problem could be
EDIT: For persons with similar problems, I found this code to replace sendkeys by keybd_event (this should be more stable)
VB Code:
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_EXTENDEDKEY = &H1 Private Const KEYEVENTF_KEYUP = &H2 Public Sub KeyDown(KCC As KeyCodeConstants) keybd_event KCC, 0, 0, 0 End Sub Public Sub KeyUp(KCC As KeyCodeConstants) keybd_event KCC, 0, KEYEVENTF_KEYUP, 0 End Sub Public Sub KeyPress(KCC As KeyCodeConstants) KeyDown KCC KeyUp KCC End Sub Public Sub CtrlOnn() KeyDown vbKeyControl End Sub Public Sub CtrlOff() KeyUp vbKeyControl End Sub Private Sub Command1_Click() Text1.Text = "" Form1.Hide DoEvents Call CtrlOnn DoEvents Call KeyDown(vbKeyC) DoEvents Call KeyUp(vbKeyC) DoEvents Call CtrlOff Form1.Show DoEvents Text1.SetFocus Call CtrlOnn DoEvents Call KeyDown(vbKeyV) DoEvents Call KeyUp(vbKeyV) DoEvents Call CtrlOff End Sub
Adding Systray Icon; Working But On Windows ME...
Hi,
I have successfully put an icon on the systray when the user clicks the minimize button and everything works fine on XP but not quite on ME and I wanted to make it work because the computers at school use ME and the program is for the school.
on XP the icon is the first one in the systray from left to right but on ME it's the first one but from right to left meaning it's the alst one from left to right lol...
How can I make it to be put always in the first palce from left to right?
I have this on a module:
Code:
Public Declare Function Shell_NotifyIcon Lib _
"shell32.dll" Alias "Shell_NotifyIconA" _
(ByVal dwMessage As Long, lpData As NOTIFYICONDATA) As Long
Public Type NOTIFYICONDATA
cbSize As Long
hwnd As Long
uID As Long
uFlags As Long
uCallbackMessage As Long
hIcon As Long
szTip As String * 64
End Type
Global NotifyIcon As NOTIFYICONDATA
Global Const NIM_ADD = &H0
Global Const NIM_MODIFY = &H1
Global Const NIM_DELETE = &H2
Global Const NIF_MESSAGE = &H1
Global Const NIF_ICON = &H2
Global Const NIF_TIP = &H4
Global Const WM_MOUSEMOVE = &H200
And this on the form load:
Code:
NotifyIcon.cbSize = Len(NotifyIcon)
NotifyIcon.hwnd = sysIcon.hwnd
NotifyIcon.uID = 1&
NotifyIcon.uFlags = NIF_MESSAGE Or NIF_ICON Or NIF_TIP
NotifyIcon.uCallbackMessage = WM_MOUSEMOVE
NotifyIcon.hIcon = sysIcon.Picture
NotifyIcon.szTip = "Nazgulled - Sistema de Chat v0.31" & Chr$(0)
to show the icon I use "Shell_NotifyIcon NIM_ADD, NotifyIcon".
Any help would be hot
Thanks.
Program Created In Windows XP Not Working In 2000
Hey everyone,
i've completed my program at last, its all good and i've learnt some basic VB stuff now.
Anyways, I seem to have a problem. I have used the application and deployment wizard to create a setup and I put it on disk (created this in XP). I then put the disk in a Windows 2000 computer and it goes through the motions, but then I get something like following message:
"the files on your system are out of date, would you like to install the updated files. You must restart to continue installation."
I get some sort of message like the above. But when I restart and try and run the setup again it just gives me the same message. I have looked in the temp folder and notice that 3 of the .dll's appear there along with the program files, but the rest of the dll's seem to not be there.
I'm guessing that the first step of the setup is to copy the dll's, hence the other dll's have already been copyied. But then it stops because it cannot copy the other dll's and puts all my program files and the remaining dll's in the temp folder?.
I have also tried deleting the folder within the temp folder and checked autoexec.bat (autoexec.bat is empty).But whatever I do it just doesnt work. Now i'm starting to think that its something to do with the 3 dll's in the temp folder and compatibility with Windows 2000.
Any ideas would be greatly appreciated, thanks (* I will just go and find out what the dll's are, might help)
Visual Studio Installer Not Working In Windows Xp
i created an installation file for a VB program. it runs properly in windows xp. but after installation, whenever run the vb program windows xp will do configuration for the os. why? how to fix?
beside that how to specified the path for application folder other than under program files folder.
Setting A Window On Top Of All Other Windows Of All Currently Working Programs
Hi!
When my form is minimized, it is put to the tray thru code. When I double-click the tray icon, however, the form is positioned below the window that had the focus before my app's window was restored. How do I position it on top of all other windows (but not set it floating on top of windows forever, just bring it to the top of Z-Order). And by the way, what's the code for setting a window to the top of Z-Order for the life of the window?
Thanks in advance!
Stas
PS I already tried SetForegroundWindow and BringWindowToTop, but they seem to work within one application, not across processes.
VB Application Written In Windows98 Not Working On Windows NT
Hi,
I worte a VB Application in Windows98.This Application runs good in both Windows98 as well as Windows2000 but it doesn't work on WindowsNT.
It shows different errors on different machines.Like in one macahine it says that "Class is not registered" while on other mcahine it says " Provider error with DataSource,Userid or Password"
Can anyone tell me as why this is happening.Any suggestions would be highly appreciated
Regards
Mouse Hook Not Working After Windows Lost Focus.
I'm using mouse hook to detect if user is using the mouse, hence checking if my program is being used or just idle.
I put a timer that counts down 900 seconds, program would auto logout if the timer reaches 0, and whenever a mouse click is hooked it'll reset the timer to 900.
It works quite well, but if I switch to another window, click something, and then switch back to my program, the mouse hook doesn't work (not catching any mouse click event) anymore.
Would someone please tell me what's wrong with my code and how should I fix this problem? Thanks a lot!!
The code is very simple, there's a form that calls EnableHooks() on load and FreeHooks() when unload:
Code:
Public Const WH_MOUSE As Integer = 7
Public Const WM_LBUTTONDOWN = &H201
Public Const WM_RBUTTONDOWN = &H204
Public Const HC_ACTION = 0
Public TimeOutCounter As Long
Public Type POINTAPI
X As Long
Y As Long
End Type
Declare Function SetWindowsHookEx Lib "user32" Alias "SetWindowsHookExA" (ByVal idHook As Long, ByVal lpFn As Long, ByVal hmod As Long, ByVal dwThreadId As Long) As Long
Declare Function UnhookWindowsHookEx Lib "user32" (ByVal hHook As Long) As Long
Declare Function CallNextHookEx Lib "user32" (ByVal hHook As Long, ByVal nCode As Long, ByVal wParam As Long, lParam As Any) As Long
Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (lpvDest As Any, ByVal lpvSource As Long, ByVal cbCopy As Long)
Declare Function ScreenToClient Lib "user32" (ByVal hwnd As Long, lpPoint As POINTAPI) As Long
Public hHook As Long ' handle of Hook Procedure
Sub EnableHooks()
If hHook = 0 Then
hHook = SetWindowsHookEx(WH_MOUSE, AddressOf MouseHookProc, App.hInstance, 0)
End If
End Sub
Sub FreeHooks()
Dim ret As Long
If hHook <> 0 Then
ret = UnhookWindowsHookEx(hHook)
hHook = 0
End If
End Sub
Function MouseHookProc(ByVal code As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
If code < 0 Then
MouseHookProc = CallNextHookEx(hHook, code, wParam, lParam)
Exit Function
End If
If wParam = WM_RBUTTONDOWN Or wParam = WM_LBUTTONDOWN Then
TimeOutCounter = 900
End If
MouseHookProc = 0
Call CallNextHookEx(hHook, code, wParam, lParam)
End Function
GetMenu Is Not Working In Windows Explorer, Microsoft Word Etc.
Hi Friends,
I have one problem. When I use GetMenu function of API to get the application menu from my program, I can get the menu from Application like WordPad, NotePad, MS Paint etc. But If I try to get menu from application like Windows Explorer, Internet Explorer, MS Word etc., it does not return handle of the menu.
This may be because of the Menu of MS Word or others is on ToolBar. So that I am not able to get that menu.
Is there any other way to get the menu of these application?
Thanks.
File Read Code Not Working While Running As Windows Service.. Pls Help Me Out
Hi , please help. I have done a small application to read a xml file and copy the requirement contents to another text file in a fixed format. all these need to be run as a windows service during specfic intervals.
the code is working when it is executed separately with out making as service. but when i place that code in a timer function and make the application as service, the file read code is not working. please help me out ... i need to submit this assigment today.
Get FREE Copy Of Fully-Working TierDeveloper Windows Edition
AlachiSoft TierDeveloper is an O/R mapping and code generation tool that simplifies the complexities of N-Tier Applications and lets you develop real-life applications in matter of days instead of months. TierDeveloper Windows Edition let you map middle-tier data objects against database tables and generate fully functional MTS COM/COM+ components using VB or C++ language. It helps you accelerate N-tier enterprise application development against MS SQL Server, Oracle and IBM DB2 database servers. It also generates an ASP Test Web Application to let you verify the functionality of the generated MTS components.
To download your fully-working free copy (not an evaluation) of TierDeveloper Windows Edition click
URL
For product overview, visit URL
For more details, visit URL
Wave Files And Vista. Some Working And Some Not Working. Strange.
Hello everybody,
I have an application with embedded in the ressource file wave files. I use PlaySound to play them. This works perfectly up to Windows Xp.
Recently I have a friend testing the application on Vista. Certain files are not playing, and others are.
Any ideas why some would play and some wouldn't? It seems very strange.
Here is the code. It works for some wave files and not others
VB Code:
Call PlaySound("MY_EMBEDDED_WAVE_FILE", App.hInstance, SND_RESOURCE Or SND_NOWAIT Or SND_NODEFAULT Or SND_ASYNC)
Application Working On Office 97 But Not Working On Office2000 !
Hi everybody,
I use an application based on Excel working initially on office 97 developped by a workmate few years ago and now not working on office 2000. Here is the error raised and the part of code responsible for that :
=> EXECUTION ERROR : "1004"
Toolbars.Add Name:="Tableau de Bord"
Toolbars("Tableau de Bord").Visible = True
With Application
.ShowToolTips = True
.LargeButtons = False
.ColorButtons = True
End With
Toolbars("Tableau de Bord").ToolbarButtons.Add Button:=126, before:=1
Toolbars("Tableau de Bord").ToolbarButtons(1).OnAction = "AppelProcedure"
(here is the mistake !!!!) Toolbars("Tableau de Bord").ToolbarButtons.Add Button:=243, before:=2
Toolbars("Tableau de Bord").ToolbarButtons(2).OnAction = "AppelProcedure"
Toolbars("Tableau de Bord").ToolbarButtons.Add Button:=42, before:=3
Toolbars("Tableau de Bord").ToolbarButtons(3).OnAction = "AppelProcedure"
Toolbars("Tableau de Bord").Width = 1527
If someone has an idea ?
Thank you,by advance....
Program Was Working, Now Not Working Runtime Erros
I have a program that searches through a recordset for indexes to lines in an order.
The program worked fine until the owner re-indexed or rebuilt all the indexes. Basically all the pointers changed for these lines, and now my program is freakin out and saying it cant find data.
Heres the code that previously worked, and STILL works on some orders.
vb
Private Sub Command1_Click()
Set rstMyrecset = Nothing
Set Mas90 = Nothing
Do Until strNextline = 0
If Ordernumber <> strSalesorder Then
MsgBox Err.Source & "The order number has changed." & _
"This order is crosslinked." & Err.Description, , "Error"
GoTo error:
End If
cmdMyrecset.CommandText = "SELECT LineIndex, LinkToNextLine," & _
" SalesOrderNumber, LinkToPrevLine FROM SO2_SOEntryDetailLine WHERE" & _
"(LineIndex LIKE '%" & strNextline & "')"
Set rstMyrecset = cmdMyrecset.Execute
strLineindex = rstMyrecset.Fields.Item("LineIndex").Value
strPrevline = rstMyrecset.Fields.Item("LinkToPrevLine").Value
strNextline = rstMyrecset.Fields.Item("LinkToNextLine").Value
strSalesorder = rstMyrecset.Fields.Item("SalesOrderNumber").Value
txtLineindex.Text = strLineindex
txtPrevline.Text = strPrevline
txtNextline.Text = strNextline
txtOrdernumber.Text = strSalesorder
txtLineindex.Refresh
txtPrevline.Refresh
txtNextline.Refresh
txtOrdernumber.Refresh
'Sleep 1000
'DoEvents
'Open "c:windowsdesktopmylog.txt" For Append As #1
'Print #1, "Previous Line "; strPrevline, "Next Line "; strNextline, "Line Index "; strLineindex
'Close #1
Loop
MsgBox "The order started at 00 and ended in 00, and the order number did " & _
"not change. Pre-checking can be notified this order is OK."
error:
txtLineindex.Text = 0
txtPrevline.Text = 0
txtNextline.Text = 0
txtOrdernumber.Text = ""
txt02pointer.Text = 0
quit:
End Sub
/vb
I believe the offending code is the SELECT statement. The select statement gets the lines, and checks the order, to make sure no lines are crosslinked into another order. On some orders, it works fine, but others, where the lines are low numbers such as 1, 2, or 3, the program bombs, with a FILE i/o error: data not found.
Msdaora.1 Working But OraOLEDB.Oracle Not Working
I'm connecting to Oracle server with this code:
Dim db As New ADODB.Connection
Dim rs As New ADODB.Recordset
Dim str As String
str = "Provider=MSDAORA.1;User ID=*****;Data Source=***;"
db.CursorLocation = adUseClient
db.Open str
it's successfully connected to database... but to pass parameter to a stored procedure with ref cursor I need to use oraOLEDB.Oracle provider. when I'm typing :
str = "Provider=oraOLEDB.Oracle;User ID=*****;Data Source=***;PLSQLRSet=True;"
It's giving me an automation error..
Provider cannot be found. It may not be properly installed. error no. 3706
I don't know what to do.. I don't know why is that error. Could anybdoy Please help me how could i install oraOLEDB.Oracle provider.
Thanks
Mehedi
Working In Excel While VB Is Working -- RESOLVED
Hi
I have an application which creates a large Spreadsheet, it takes about 20 minutes all in.
This is not the problem.
The problem is while the Ssheet is being created the user cannot work on the
N other spreadsheets they have on the go.
I have used .visible = false, but to no avail.
Help, how do I keep the application from being shown/messed by a hyperactive user while it is being created.
Thanks
Simon
How Use Sendkeys
hi,
i want copy a selected text from notepad to my aplication using the sendkeys and clipboard of windows i using this code:
SendKeys "{end}", True
SendKeys "+{home}", True
Clipboard.Clear
SendKeys "{DOWN}", True
so far so good this can select the text that i want now i want send this selected text to the clipboard i using this:
'SendKeys "^{c}", True
but this donīt work and i canīt understand why
so my question is how can i press "CTR + C" by using the sendkeys to copy a selected text? or there is other way using a api to do this?
thanks a lot for your help
VBA Help With SendKeys On IE
I am trying to link my excel worksheet to automate searches on Google but I can't seem to get the "SendKeys" function to work. Can someone please help me?
Here's my VBA so far.
----------------------------------------
Function FillInternetForm()
Dim IE As Object
Dim wsMain As Worksheet
Dim iPos As Long
Set wsMain = ThisWorkbook.Worksheets("Sheet1")
Set IE = CreateObject("InternetExplorer.Application")
IE.navigate "http://www.google.ca"
IE.Visible = True
While IE.busy
DoEvents
Wend
iPos = 2
Do While Not wsMain.Cells(iPos, 1).Value = ""
IE.document.all("q").Value = wsMain.Cells(iPos, 1).Value
SendKeys "[enter]", True
iPos = iPos + 1
Loop
IE.Quit
End Function
|