arrow keys for child window of dialog box #2

Hi,
   I have created a dialog box with MFC. I have created an opengl
window as a child to the dialog box. on the window I am drawing using
opengl. now I want to update my drawing if the arrow keys are pressed.
How should I do it . I am new to MFC.
Thanks and Regards.

0
noor.fatma (12)
6/8/2006 6:53:22 AM
vc.mfc 33608 articles. 0 followers. Follow

3 Replies
688 Views

Similar Articles

[PageSpeed] 3

Hi,

Handle WM_KEYDOWN message (let the wizard do it for you as you are new to 
MFC).

Then you can put some kode like so:

void CMyWnd::OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags) 
{
	switch (nChar)
	{
	case VK_LEFT:
		YourUpdateCode1();
		break;
	case VK_UP:
		YourUpdateCode2();
		break;
	case VK_RIGHT:
		YourUpdateCode3();
		break;
	case VK_DOWN:
		YourUpdateCode4();
		break;
	}
}



"noor.fatma@gmail.com" wrote:

> Hi,
>    I have created a dialog box with MFC. I have created an opengl
> window as a child to the dialog box. on the window I am drawing using
> opengl. now I want to update my drawing if the arrow keys are pressed.
> How should I do it . I am new to MFC.
> Thanks and Regards.
> 



-- 
======
Arman 
0
armancho_x1 (249)
6/8/2006 11:45:02 AM
Hi Arman,

    I tried doing what you said. but when I press the arrow keys, the
focus keeps on moving on the buttons I have pasted on the dialog box. I
debugged and found out that the control was not going to the onkeydown
method though I have written it in the message map.


Arman Sahakyan (donotspam) wrote:
> Hi,
>
> Handle WM_KEYDOWN message (let the wizard do it for you as you are new to
> MFC).
>
> Then you can put some kode like so:
>
> void CMyWnd::OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags)
> {
> 	switch (nChar)
> 	{
> 	case VK_LEFT:
> 		YourUpdateCode1();
> 		break;
> 	case VK_UP:
> 		YourUpdateCode2();
> 		break;
> 	case VK_RIGHT:
> 		YourUpdateCode3();
> 		break;
> 	case VK_DOWN:
> 		YourUpdateCode4();
> 		break;
> 	}
> }
>
>
>
> "noor.fatma@gmail.com" wrote:
>
> > Hi,
> >    I have created a dialog box with MFC. I have created an opengl
> > window as a child to the dialog box. on the window I am drawing using
> > opengl. now I want to update my drawing if the arrow keys are pressed.
> > How should I do it . I am new to MFC.
> > Thanks and Regards.
> > 
> 
> 
> 
> -- 
> ======
> Arman

0
noor.fatma (12)
6/9/2006 8:57:06 AM
<noor.fatma@gmail.com> wrote in message 
news:1149843426.025697.171690@y43g2000cwc.googlegroups.com...
> Hi Arman,
>
>    I tried doing what you said. but when I press the arrow keys, the
> focus keeps on moving on the buttons I have pasted on the dialog box. I
> debugged and found out that the control was not going to the onkeydown
> method though I have written it in the message map.
>

Try handling WM_GETDLGCODE and returning DLGC_WANTARROWS.
-- 
Jeff Partch [VC++ MVP]


0
jeffp (1711)
6/9/2006 11:32:55 AM
Reply:

Similar Artilces:

2 Page Newsletters
I am trying to open a 2 page newsletter from someone they they saved on my computer. On his computer it is two pages and there is the 1,2 page numbers you can click on the bottom. When he sends it to me it only shows one page. When he comes to my computer and tries to open his from my computer it does the same, only one page. Can anyone help with this? After managing to set up OE-QuoteFix on his new PC, Ed reads a message from dpandozzi@r-masters.com <anonymous@discussions.microsoft.com>... > I am trying to open a 2 page newsletter from someone they > they saved on my comp...

check box #3
I want to put some check boxes on my worksheet. When the boxes are checked I want them to be totaled at the end of the column. I inserted the check boxes but when I put the formulas for the sum of the columns I get an error message. I am guessing that I have to make a positive check box = the value of one. Don't have a clue on how to do it. Any help would be appreciated. Dennis You can set up a linked cell for each of the checkboxes. The way you do that depends on the type of checkbox you used. If you used a checkbox from the Forms toolbar, rightclick on it and choose Forma...

Disabling F1 key's Windows Help Function
We'll I guess the title says it all :) Just curious if there is an easy way to disable F1 from always trying to bring up Window's help whenever it is hit within the program. I find it more than a little annoying because even in my program where (I thought) I was capturing all keystrokes for a keyDown event (I added UINT MyClass:OnGetDlgCode() { return DLGC_WANTARROWS|DLGC_WANTALLKEYS|DLGC_WANTCHARS; } Hmmm, so can I add something else to this line perhaps (going to check on this now) in order to catch ALL keystrokes (or at least add something so windows help function will be di...

Icon in dialog caption
Is there any possibility to hide/remove icon in resizable dialog window(WS_THICKFRAME), please? If I try to set icon to NULL (WM_SETICON message, or SetIcon method) I get only windows default white icon and that is not what I need. WS_SYSMENU cannot be disabled, because I do not want to remove cross-button in right part of window caption. I just want resizable window but without the icon, like with dialog frame style. Thanks! "Martin" <Martin@discussions.microsoft.com> wrote in message news:5A610A6E-810C-4DD2-AFCB-D1EBA7A1B7AD@microsoft.com... > Is there any possib...

Print Reconcilliation #2
Is it possible to print a reconcilliation when you are done with it? I could always do this in Quicken but can't see how to do it in Money. Money doesn't have a reconciliation report. This, and many workarounds and near workarounds have been discussed numerous times in the last month or so. (These things come in cycles--this is the cycle for reconciliation report, apparently.) Get more headers or search archives of this group at http://groups.google.com. "Thomas Schiessl" <Schiessl@athenet.net> wrote in message news:319901c37573$1a2d6fa0$a301280a@phx.gbl... &g...

GALMOD32.exe not working #2
Hello. When the users of the domain run GALMOD32.exe it acts like it saves the settings but when I look at the gal those settings don't stick. I have done the following site suggestions about adding "self" to delegate control, but still no luck. Anyone have any suggestions on how I can get users to update the gal themselves and have it actually stick. http://mcpmag.com/columns/article.asp?EditorialsID=873 Thanks, -comb In article <MPG.1ef200b44f090d1b989684@news.newsreader.com>, whore@whore.com says... > Hello. > > When the users of the domain run GALM...

Get $500 to your PAYPAL Account by just one CLICK #2
i have hidden the form of getting $500 to your PAYPAL ACCOUNT....CLICK on the IMAGE which is on the RIGHT SIDE of the website http://tricks-4u.4-all.org/ ...

Windows Live Messenger doesn't "remember" me
Hi All, My Windows Live Messenger doesn't "remember" my username/ID. I click remember me and then when having signed off I restart it or the computer again, it doesn't "remember" me. Help! ...

Kamasutra Full B-Grade Movie With Nudity Must See (1 Hour 50 Min ) #2
Kamasutra Full B-Grade Movie With Nudity Must See (1 Hour 50 Min ) At http://iceboob.Co.CC Due to GOOGLE security risks, i have hidden the videos(15) in an image. in that website on Right side below search box click on image and watch videos in all angles. ...

Header and Footer Locations (2)
Gord Dibben: Excuse my ignorance, but where do I find "Custom Settings" so I can move the Header and Footer margins in? Thanks, Bernie Bernie View>Header and Footer>Custom To have a left footer several spaces in from default, enter the footer using one of the buttons provided then click in box and enter the spaces before the actual footer. This is not an exact science, so some experimentation will take place. Gord On Tue, 13 Jul 2004 20:32:51 GMT, "Bernie Beal" <bquest@optonline.net> wrote: >Gord Dibben: > >Excuse my ignorance, but where do...

How do I change the text size in a drop down box
I am using excel 2003. It seems to default to 10pts. Changing the size in the source list or the default in the general tab did not change the size. ...

SHARING WORKBOOKS #2
I HAVE AN EXCEL SPREADSHEET THAT NEEDS TO BE AVAILABLE ON TWO COMPUTERS AND SHOW THE SAME INFORMATION INCLUDING CHANGES. HOW DO I DO THIS? Hi check out 'Tools - Share workbooks' Note: shared workbooks have many restrictions (several functions are not available for them). IMHO Excel is not well suited for beeing shared. You may condiser using a different type of application for this (e.g. a database) -- Regards Frank Kabel Frankfurt, Germany "ALSHORTMAN" <ALSHORTMAN@discussions.microsoft.com> schrieb im Newsbeitrag news:C0807914-A81F-4719-A37C-3F22160C2EB3@microsoft...

XL2007
I have a spreadsheet that uses the following sequence to scale the y axis of an X-Y scatter graph with lines drawn between points from VBA and it works perfectly in all previous versions of Excel. It fails with XL2007 rather catastrophically. The main spreadsheet was imported from XL2003. I have looked in the KB and archives here and not found any other reports of this problem so I don't know if it is something peculiar about this particular installation or what. It is reproducible in a toy chart in pure XL2007. The failing lines are; ActiveChart.Axes(xlSecondary).Select ok = Applicati...

Problem with Text box and Background
I am using the background as a temple for a form I add test boxes where I want to have text typed in The problem is when I print the page the text I have typed in isn't where it is supposed to be It is below the line of the background form How do I solve this problem? Web page? Best asked in the publisher.webdesign group -- Mary Sauer MSFT MVP http://office.microsoft.com/ http://msauer.mvps.org/ news://msnews.microsoft.com "News" <gmhull@sbcglobal.net> wrote in message news:pOKFf.27487$F_3.19174@newssvr29.news.prodigy.net... >I am using the background as a t...

Outlook notification #2
in outlook 2003, we now have that cool little box that comes up when new mail hits the mailbox. Is there a way to set up a different folder to do a similar bubble message? You have to set up a rule. It's one of the action options for incoming messages ----- Philip wrote: ---- in outlook 2003, we now have that cool little box that comes up when new mail hits the mailbox. Is there a way to set up a different folder to do a similar bubble message? ...

Problem when adding an appointment in CRM from the SFO ver. 1.2
When the users make an appointment in the SFO, its fails. The SFO makes the activity on the contact, but the Outlook synchronisation fails. The appointment does not appear in the Outlook calendar. Then we reinstall the appointment form in Outlook, clear the forms cache, and the problem is resolved. Then after some time (weeks) the problem comes back. Any ideas? Best regards Jacob Mondrup IT Manager, Cultivator Denmark. have you loaded the latest rollup patch for the outlook client? http://www.microsoft.com/downloads/details.aspx?FamilyID=127a274d-bc20-4e2f-be0d-1247455748...

text boxes that label axes in line/scatter graphs
I tried to use "SAT-M" as y-axis label, but "M" was cut off (actually went to second line that could not be seen). I tried every trick I know to lengthen the text box, to fit label on one line. Hi, The only way to length chart textboxes is with more text. But at some point more text will cause the content to wrap. The charts textboxes do not have the ability to be sized manually even though the bounding box and grab handles would suggest otherwise. Try adding a few spaces or even non-breaking spaces ALT+0160 (Numpad) Cheers Andy Peg wrote: > I tried to use &qu...

Dialog text only updated on mouse moves
My PreTranslateMessage() function has code in it to update some of the text in one of my dialog boxes. It works, but instead of updating it every second, it only udpates the text when my mouse is moving or clicking. Any ideas on what might be causing this? Thank you! Well, that's becuase PreTranslateMessage gets called only when there is message in the queue for that window. Instead use a timer. See OnTimer (WM_TIMER) AliR. <PloutzMR@Npt.NUWC.Navy.Mil> wrote in message news:1154456910.215194.170930@s13g2000cwa.googlegroups.com... > My PreTranslateMessage() function has c...

Windows Live Mail (news)?
Hi, I am only using WLM and nothing else from Windows Live-id I see that on my PC there is also WLM(news). First question: How can i remove it ? Second question: I see that after start-up (or after stand-by) and immediately going to WLM often my connection to my provider fails ? Although and immediate connection with IE8 never fails and is very quick. Waiting a few seconds to activate WLM is aways ok and messages are read normally. Who can give any advice? Regards Huib Alt + T, Options, Connection, uncheck Hang up after sending and receiving. -- Ron Somm...

Upgrade to exchange enterprise #2
Hello I have just moved to exchange enterprise from exchange standard(with the mailbox move method). Everything has gone well but i'm noticing that i'm still getting event 1221 messages stating that there is x amount of space in the public and private message stores. Just wondering if i should still be getting these messages. I'm aware though that exchange space is white space based and that when you exceed the amount of white space the database will grow again. But just wondering if i should still be getting those 1221's. Thanks On Mon, 6 Jun 2005 09:17:03 -070...

Air Framing Nailer Kit 8-10 Gauge - 2"
Price:$250.99 Image: http:///image.php?id=B000UFSL5G Best deal: http:///index.php?id=B000UFSL5G Neiko Tools USA 8-10 Gauge 2"~ 3-1/2" Air Framing Nailer Kit * Large Piston For Increasing Power * Stong and Light Weight Die-Cast Body * Drivers Full-Head Nails from 2" to 3-1/2" Long * Includes: Goggles, Oil, Wrenches and Instruction * Max Capacity: 40 pcs * 72-120 psi * Air Inlet: 1/4" NPT * 21 Degree Angle ...

GetItemRect() not consistent with display after updating iIntegral #2
Sorry about the repost. I am trying to set the height of a CTreeCtrl item using the iIntegral property of TVITEMEX and SetItem. This is within the context of a splitter window with a left and a right pane. The left pane contains the tree and the right pane displays graphical elements which are vertically aligned with corresponding tree items. When iIntegral is set, the tree redisplays as expected, however the results from GetItemRect() do not change. As a result, the graphical elements in the right pane are not correctly vertically aligned. The only thing that seems to update GetItemRect...

Problem installing CRM 1.2 on Win2003
Hello, I get the following error installing the product: Setup was unable to install the Windows installer package.msi of microsoft CRM Server Setup. Any ideas? Michael Where can I find an installation guide? Thanks Michael Hi Micheal, There is a CRM installation guide from Microsoft called Installing_and_Securing_CRM_on_SBS.doc. I found this guide extremely useful. I recommend thoroughly reading it before implementing any of it. http://www.microsoft.com/downloads/details.aspx?FamilyID=C835F117-A447-48DB-940B-48EF88A192A3&displaylang=en Regards, Chris Netarus, LLC http://www...

Result of one combo box, affecting results of another...
Just out of curiousity... Is there a way to have what the user selects in one combo box on a form, affect what is available for the user on another box!? For instance... Box A has 8 different addresses.. Within those addresses there are 12 different building ID locations... Instead of having all 12 building locations for each address always appear in the combo box, If the user picks building 4, is there a way to just have the building ID options for building 4 showing in combo box B? Charles! Use your favorite search engine. Use "Cascading Combo boxes" for search terms. -- Reg...

Handling key presses
I have tree and list views (contained in a CSplitter) in which I would like to handle keyboard input. The up, down, left and right arrow keys work for traversing the tree / list, but I want the space bar to perform an action and the tab / shift-tab to move between the views. I have added handlers for =TVN_KEYDOWN and WM_KEYDOWN to the tree view and put breakpoints in them but neither get called when I press a key from within the tree view. So how do I do this? --- Al. ...