Hi,
Not too sure if this is the write place to post this, im sure someone will
correct me if im in the wrong place.
I have been developing a C# DLL component based on the WBCustomizer object
from microsoft.
The problem i have reached is that i want to be able to fire KeyUp, KeyPress
and KeyDown events from the TranslateAccelerator method. The reason for this
is as follows, i am disabling certain accelerator keys (Ctrl+5, Ctrl+F5,
etc...), these accelerator key presses are eaten up by translate accelerator
because they are disabled, but i still need to access these key presses as
my application uses them in a number of ways.
I can modify the translate accelerator to check the KeyDown, KeyPress and
KeyUp messages but i need to raise these events back to the caller (i guess
in this case that means the web browser or document).
I have seen some code in C++ but as i am not a C++ developer i do not
understand what is going on, could anyone possibly help me with translating
the C++, and what equivelants there are in C#.
VOID Fire_KeyPress(SHORT KeyCode)
{
T* pT = static_cast<T*>(this);
int nConnectionIndex;
CComVariant* pvars = new CComVariant[1];
int nConnections = m_vec.GetSize();
for (nConnectionIndex = 0; nConnectionIndex < nConnections;
nConnectionIndex++)
{
pT->Lock();
CComPtr<IUnknown> sp = m_vec.GetAt(nConnectionIndex);
pT->Unlock();
IDispatch* pDispatch = reinterpret_cast<IDispatch*>(sp.p);
if (pDispatch != NULL)
{
pvars[0] = KeyCode;
DISPPARAMS disp = { pvars, NULL, 1, 0 };
pDispatch->Invoke(0x6, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD,
&disp, NULL, NULL, NULL);
}
}
delete[] pvars;
}
Thanks in advance for your help
Regards
Neil 1 2208
Neil,
In this newsgroup are a lot active who know C# and C++ however a better
place for me is in my opinion.
microsoft.public.dotnet.languages.csharp
There are more.
Cor
"Neil Stevens" <ne**********@blueyonder.co.uk> Hi,
Not too sure if this is the write place to post this, im sure someone will correct me if im in the wrong place.
I have been developing a C# DLL component based on the WBCustomizer object from microsoft.
The problem i have reached is that i want to be able to fire KeyUp, KeyPress and KeyDown events from the TranslateAccelerator method. The reason for this is as follows, i am disabling certain accelerator keys (Ctrl+5, Ctrl+F5, etc...), these accelerator key presses are eaten up by translate accelerator because they are disabled, but i still need to access these key presses as my application uses them in a number of ways.
I can modify the translate accelerator to check the KeyDown, KeyPress and KeyUp messages but i need to raise these events back to the caller (i guess in this case that means the web browser or document).
I have seen some code in C++ but as i am not a C++ developer i do not understand what is going on, could anyone possibly help me with translating the C++, and what equivelants there are in C#.
VOID Fire_KeyPress(SHORT KeyCode) { T* pT = static_cast<T*>(this); int nConnectionIndex; CComVariant* pvars = new CComVariant[1]; int nConnections = m_vec.GetSize();
for (nConnectionIndex = 0; nConnectionIndex < nConnections; nConnectionIndex++) { pT->Lock(); CComPtr<IUnknown> sp = m_vec.GetAt(nConnectionIndex); pT->Unlock(); IDispatch* pDispatch = reinterpret_cast<IDispatch*>(sp.p); if (pDispatch != NULL) { pvars[0] = KeyCode; DISPPARAMS disp = { pvars, NULL, 1, 0 }; pDispatch->Invoke(0x6, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &disp, NULL, NULL, NULL); } } delete[] pvars;
}
Thanks in advance for your help Regards Neil This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Szar |
last post by:
JS noob. I've seen plenty of browser detection scripts but they all seem to
be slightly different and don't really fit my needs. I have various places
where if the browser is IE I'd like to display...
|
by: Java script Dude |
last post by:
To all Mozilla JS Guru's (IE dudes welcome),
I have spent the last three years developing complex DHTML
applications that must work in IE 5.5sp2+ but I use Mozilla 1.3+** to
do all my...
|
by: lawrence |
last post by:
How is it possible that the question "How do I detect which browser
the user has" is missing from this FAQ:
http://www.faqts.com/knowledge_base/index.phtml/fid/125
and is only here on this...
|
by: Craig G |
last post by:
is there a way to distinguish whether a client is using IE or Netscape?
is there some sorta check i can run on the Page_Load event? or where would
be the best place to do this?
Cheers,
Craig
|
by: Dave Harrington |
last post by:
Greetings all -
We have a client who uses Lotus Notes as their default e-mail. The version
of Lotus they use can run internet explorer windows within Lotus. I'd like
to find if they are...
|
by: Peter Larsen |
last post by:
Hi,
I want to be able to show a file browser embedded on a form - a browser
which is similar to the browser you get by SHBrowseForFolder().
Is that possible ?
Thank you in advance.
BR
Peter...
|
by: CMM |
last post by:
So I'm half way through overseeing a large project in ASP.NET 2.0. My
superiors have decided that it would be nice if we ensured the site worked
on all the major platforms (as they see it: IE,...
|
by: petermichaux |
last post by:
Hi,
Does anyone have a a cross-browser setOpacity function that does not
use browser sniffing? I looked at the Yahoo! UI function and it detects
IE by looking for window.ActiveXObject. I also...
|
by: Mufasa |
last post by:
We want to keep track of what OS/Browser people are using for our website.
How can I find that out so that I can write it to a DB ? I know how to get
it into the DB; I just need to know how to get...
|
by: etnaelk |
last post by:
Hi all, I have a real bugger of a problem that I just haven't been able to figure
out. I am working on writing my own proxy server in C# using TcpListener,
TcpClient, HttpWebRequest/Response and...
|
by: ryjfgjl |
last post by:
ExcelToDatabase: batch import excel into database automatically...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: jfyes |
last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
|
by: ArrayDB |
last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
|
by: PapaRatzi |
last post by:
Hello,
I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
|
by: CloudSolutions |
last post by:
Introduction:
For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
|
by: af34tf |
last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
|
by: Faith0G |
last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome former...
| |