Solved

Global Keyboard Hook on Startup

Posted on 1997-09-13
6
198 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
Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Several part series to implement Internet Explorer 11 Enterprise Mode
Join Greg Farro and Ethan Banks from Packet Pushers (http://packetpushers.net/podcast/podcasts/pq-show-93-smart-network-monitoring-paessler-sponsored/) and Greg Ross from Paessler (https://www.paessler.com/prtg) for a discussion about smart network …
This Micro Tutorial will give you a basic overview of Windows DVD Burner through its features and interface. This will be demonstrated using Windows 7 operating system.
Windows 8 came with a dramatically different user interface known as Metro. Notably missing from that interface was a Start button and Start Menu. Microsoft responded to negative user feedback of the Metro interface, bringing back the Start button a…

762 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