Re: .NET Event Handling (timers, Mouse movement)
From: Frank Hickman [MVP] (fhickman_NOSP_at_M_noblesoft.com)
Date: 02/13/05
- Next message: Tim Roberts: "Re: dll problems in VC++"
- Previous message: Frank Hickman [MVP]: "Re: [newbie] memchr"
- In reply to: TogaKangaroo: ".NET Event Handling (timers, Mouse movement)"
- Messages sorted by: [ date ] [ thread ]
Date: Sat, 12 Feb 2005 22:50:24 -0500
"TogaKangaroo" <gmauer@gmail.com> wrote in message
news:1108242304.584743.251280@c13g2000cwb.googlegroups.com...
> Hi, I'm trying to get intimate with my new copy of the .NET Pro
> developing environment, specifically C++ Visual Studio. I have a book
> (VC++ in 21 days) that I am going through following their examples.
> However the book treats the MS VC++ 6.0 environment and I...as I
> mentioned am learning .NET.
>
> It hasn't been too large a problem so far, I'm have a comp sci degree
> and have done plenty of c++ so where the two don't match up I've been
> mostly able to figure it out. However I am having problems figuring
> out how to make an event handler for timers or mouse actions.
>
> I think It all spawns from the same problem so if I can figure out
> timers I can probably handle the rest. So far I have done the
> following:
> -Added a resource symbol ID_CLOCK_TIMER (am I correct that this simply
> adds a #define ID_CLOCK_TIMER line to resource.h?)
> -did SetTimer(ID_CLOCK_TIMER, 1000,NULL); in OnInitDialog()
>
> Now the book states I can click on my main dialog box(main window) and
> do add event handler to handle the WM_TIMER message. .NET won't let me
> add an event handler to the main message box however and for no place
> where I CAN add an event handler do I see the WM_TIMER message as an
> option in the wizard. I tried adding a handler manually (from what I
> understood should be done)
> and added
> public:
> afx_msg void OnTimer(UINT_PTR nIDEvent);
> to my main dialog class (it is derived from CDialog)
> as well as a definition
> void CTimeyDlg::OnTimer(UINT_PTR nIDEvent) {
> MessageBox("Yo");
> }
>
> Nothing happens however.
>
> Can anyone help me out here?
> Thanks a lot
> Toga
>
When you have your dialog class up in the code editor, open/select the
properties window. Beside the button for adding events (lightening bolt)
you'll see a mini-window for messages. This is where the WM_TIMER can be
specified.
-- ============ Frank Hickman Microsoft MVP NobleSoft, Inc. ============ Replace the _nosp@m_ with @ to reply.
- Next message: Tim Roberts: "Re: dll problems in VC++"
- Previous message: Frank Hickman [MVP]: "Re: [newbie] memchr"
- In reply to: TogaKangaroo: ".NET Event Handling (timers, Mouse movement)"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|