Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / .NET SDK / September 2004

Tip: Looking for answers? Try searching our database.

Menu accelerators

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Andrew Moore - 15 Sep 2004 17:47 GMT
Hi,

I have a Windows forms application in which I am using Direct3D for 3D
rendering. I have the application in a tight render loop using Win32 calls
as follows

private void DoEvents()
{
   Win32Lib.MSG msg;

   while(Win32Lib.User32.PeekMessage(out msg, System.IntPtr.Zero, 0, 0,
Win32Lib.User32.PM_REMOVE))
   {
       if(msg.message != Win32Lib.User32.WM_QUIT)
       {
           Win32Lib.User32.TranslateMessage(ref msg);
           Win32Lib.User32.DispatchMessage(ref msg);
       }
   }
}

I am using this loop in lieu of Application.DoEvents() due to unnecessary
memory allocations in this method.
The problem is that now menu shortcuts do not work. Is there some way I can
call TranslateAccelerators to get the shortcuts to work?
Thank you,
Andy
Dmitriy Lapshin [C# / .NET MVP] - 16 Sep 2004 17:57 GMT
Hi,

Please refer to the "Using Keyboard Accelerators" topic in the MSDN Library.
The examples there are in C++ but I think you should have no problem
translating them to C#.

Signature

Sincerely,
Dmitriy Lapshin [C# / .NET MVP]
Bring the power of unit testing to the VS .NET IDE today!
http://www.x-unity.net/teststudio.aspx

> Hi,
>
[quoted text clipped - 23 lines]
> Thank you,
> Andy
Andrew Moore - 17 Sep 2004 16:15 GMT
Dimitriy,

Thanks for your response.

The documentation makes sense, but it looks like I need to somehow load the
accelerator table from the resources. Even though I have set some menu
shortcuts, when I load the application and view resources, I don't see an
accelerator table. I guess I am looking for where these acclerators are
stored in a Windows Forms application. Do you know a way that I can get the
ID of the accelerator table to call LoadAcclerators?

Thank you,

Andy

> Hi,
>
[quoted text clipped - 30 lines]
> > Thank you,
> > Andy

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.