473,505 Members | 13,805 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 2223
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
10046
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
2829
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
2522
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
8065
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
1850
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
23715
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
2291
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
2324
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
3609
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
1447
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
7213
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7098
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7298
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
7017
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5610
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
3187
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3176
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1526
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
754
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.