473,320 Members | 2,146 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Web Browser

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
Jul 21 '05 #1
1 2206
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

Jul 21 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
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...
16
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...
17
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...
2
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
1
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...
4
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...
15
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,...
16
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...
5
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...
0
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...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
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...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
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)...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
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
0
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 using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.