473,395 Members | 1,348 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,395 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 2214
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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
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,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.