Solved

Global Keyboard Hook on Startup

Posted on 1997-09-13
6
199 Views
Last Modified: 2013-12-29
My Win '95 application has a DLL that contains a global keyboard hook
that monitors all keyboard events.  I have come across a strange problem
and cannot figure out what is exactly happening.

When I manually run the application it runs fine and the DLL picks up
the key strokes and status with no problem.

However,  if the application is run automatacly from the Statup
directory,  and I open "My Connection" to connect to the internet the
keyboard status gets confused.

I check the ALT, CTRL and SHIFT keys with "GetKeyState(VK_CONTROL)",
and after  "My Connection" is started the GetKeyState() returns false
values.  But if I shut the application and restart it it works fine.

If anybody has any idea I would appreceate any help that you can give
me.


Thanks
Yaakov Blank
iti@netvision.net.il

0
Comment
Question by:yeb
  • 3
  • 2
6 Comments
 
LVL 12

Expert Comment

by:j2
ID: 1696583
When launching from teh startupo group, the program gets launched before the system has loaded all other modules.. Probably things get loaded in teh "wrong" order..

Add a delay at the start of your program and saee if that  helps.
0
 

Author Comment

by:yeb
ID: 1696584
That seems like an obvious cause but even with a 10 second Timer
delay before loading the DLL doesn't help.  I need to know more details if there is anyway to get a reliable Keyboard state and why it currently doesn't work
0
 
LVL 14

Accepted Solution

by:
smeebud earned 50 total points
ID: 1696585
yeb,
I believe you have posted in the wrong section. We have a programming section that can answer your question.
My answer would be, Don't have it in the Start Up group, or try loading it from win.ini from a RUN= OR A LOAD=
0
Do email signature updates give you a headache?

Are you constantly making changes to email signatures? Are the images not formatting how you want them to? Want high-quality HTML signatures on all devices, including on mobiles and Macs? Then, let Exclaimer solve all your email signature problems today.

 

Author Comment

by:yeb
ID: 1696586
Smeebud,

I put it in a run= in win.ini.  Do you have any idea why it was happening?

Also could you have multiple run= statements in the win.ini?

Thanks again





0
 
LVL 14

Expert Comment

by:smeebud
ID: 1696587
Did that fix it.
Yes tou can have multible run= statements
0
 

Author Comment

by:yeb
ID: 1696588
Thanks again and it fixed it !!!

0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Recently Microsoft released a brand new function called CONCAT. It's supposed to replace its predecessor CONCATENATE. But how does it work? And what's new? In this article, we take a closer look at all of this - we even included an exercise file for…
How to record audio from input sources to your PC – connected devices, connected preamp to record vinyl discs, streaming media, that play through your audio card: Vista, Windows 7, Windows 8, Windows 8.1 and Windows 10 – both 32 bit & 64.
The viewer will learn how to successfully create a multiboot device using the SARDU utility on Windows 7. Start the SARDU utility: Change the image directory to wherever you store your ISOs, this will prevent you from having 2 copies of an ISO wit…
The Task Scheduler is a powerful tool that is built into Windows. It allows you to schedule tasks (actions) on a recurring basis, such as hourly, daily, weekly, monthly, at log on, at startup, on idle, etc. This video Micro Tutorial is a brief intro…

895 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now