Solved

Global Keyboard Hook on Startup

Posted on 1997-09-13
6
201 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
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 

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

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

Suggested Solutions

Our Group Policy work started with Small Business Server in 2000. Microsoft gave us an excellent OU and GPO model in subsequent SBS editions that utilized WMI filters, OU linking, and VBS scripts. These are some of experiences plus our spending a lo…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
In this video, we discuss why the need for additional vertical screen space has become more important in recent years, namely, due to the transition in the marketplace of 4x3 computer screens to 16x9 and 16x10 screens (so-called widescreen format). …
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…

770 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