Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Global Keyboard Hook on Startup

Posted on 1997-09-13
6
Medium Priority
?
213 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 100 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
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 

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

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

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

A small collection of useful tips and tricks for Windows 10 users that I decided to write as a result of recent questions that were asked and answered at Experts Exchange. Two short video tutorials included. Enjoy..
Know the reasons and solutions to move/import EDB to New Exchange Server. Also, find out how to recover an Exchange .edb file and to restore the file back.
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…
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…

926 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