-
September 28th, 2012, 03:01 AM
#1
Need some help.
Can anyone help me with this.. I have gotten so close, but yet so far away.
Need this to be changed to where if the Value is 47 then a keyboard event will happen. The default value is 00. I have it running on a timer. Can anyone help?
---------------------------------------------------------------
ULONG Addr, Value; HRESULT hr; char *stop_at;
Addr = strtoul(m_RegAddr,&stop_at,36);
hr = Lib_RegRead(Addr, 1, &Value);
----------------------------------------------------------------
Tries so far (gonna need to ask for help from people)
hr = Lib_RegRead(Addr, 1, &Value);
if ????????????????????????
{
keybd_event(0x21, 0, 0, 0);
}
-
September 28th, 2012, 03:07 AM
#2
Re: Need some help.
else
{
m_RegValue.Format(_T("%02X"),Value);
m_StatusMsg = _T("Backend Register Read Success!");
}
Perhaps I could do something with this.... I want an event in between those 2 lines that will do a keyb_event, based on what the value is.. If its 00 or 16 or 47 or whatever.
-
September 28th, 2012, 03:28 AM
#3
Re: Need some help.
else
{
m_RegValue.Format(_T("%02X"),Value);
m_StatusMsg = _T("Backend Register Read Success!");
if ( etLib2_RegRead = (Addr, 1, 47))
{
keybd_event(0x21, 0, 0, 0);
}
}
Yeah this is what I need I guess.. thought it doesn't work.
-
September 28th, 2012, 08:26 AM
#4
Re: Need some help.
Assuming your code is valid (i.e. Lib_RegRead() and keybd_event() do actually whatever they're supposed to do) surely you just need something like this:-
Code:
hr = Lib_RegRead(Addr, 1, &Value);
if (Value == 47)
{
keybd_event(0x21, 0, 0, 0);
}
Are you trying to simulate a keypress event? That's a very unusual thing to do in Windows programming.
"A problem well stated is a problem half solved.” - Charles F. Kettering
-
September 28th, 2012, 08:28 AM
#5
Re: Need some help.
All fixed! Thanks!
When in doubt, try everything! =)
Yeah its to interface with AutoHotKey.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|