On today, of all days, here's some help waking up...Your monitor at least!
- Posted: Nov 24, 2011 at 6:00 AM
- 4,973 Views
- 1 Comment
Loading User Information from Channel 9
Something went wrong getting user information from Channel 9
Loading User Information from MSDN
Something went wrong getting user information from MSDN
Loading Visual Studio Achievements
Something went wrong getting the Visual Studio Achievements
I debated doing a Gallery post for today since that it's the Thanksgiving holiday in the United States. But then realized I could do the that post title... ![]()
Today's entry is pretty simple, yet a pretty cool example too. Besides being C++, it's also something that struck a cord with many and seems to make allot of sense in concept.
I do use Kinect to wake up my monitor from sleeping (power down after screensaver).
This must be done when Kinect recognizes someone's body in front of his camera view.Open SDK's Sample Skeletal Viewer project.
Open NuiImpl.cpp file
Find the line:
if (pSkel->eSkeletonPositionTrackingState[i] != NUI_SKELETON_POSITION_NOT_TRACKED)This is the moment when Kinect recognizes the body and construct skeletal data ready to display.
Add the following inside the above function:
if (b_monitoroff)Of course, declare: bool b_monitoroff; in the beginning of SkeletalViewer.h
{
b_monitoroff = false;
// force monitor power up
SendMessage(HWND_BROADCAST, WM_SYSCOMMAND, SC_MONITORPOWER, (LPARAM)-1);
}Open SkeletalViewer.cpp
Find the main window (dialog) route function and add:
case WM_SYSCOMMAND:
switch (wParam)
{
case (SC_MONITORPOWER):
else if (lParam!=-1 && !b_monitoroff)
{
// monitor power gone down
b_monitoroff = true;
}
break;
default:
return 0;
}
break;That's all! From now, when you monitor gone down (with or without screensaver),
then when you will step beside Kinect camera, after a while the monitor will wake up....
Project Information URL: http://www.jgui.net/kinect/index.html#snippet1
Project Download URL: http://www.jgui.net/kinect/index.html#snippet1
Comments have been closed since this content was published more than 30 days ago, but if you'd like to continue the conversation,
please create a new thread in our Forums,
or
Contact Us and let us know.
Follow the Discussion
Oops, something didn't work.
What does this mean?
Following an item on Channel 9 allows you to watch for new content and comments that you are interested in. You need to be signed in to Channel 9 to use this feature.What does this mean?
Following an item on Channel 9 allows you to watch for new content and comments that you are interested in and view them all on your notifications page.sign up for email notifications?
You are not supposed to perform WM_SYSCOMMANDs by posting a message to HWND_BROADCAST, see Fumbling around in the dark and stumbling across the wrong solution. You should send the message to a single HWND that you own or call DefWindowProc directly...
Remove this comment
Remove this thread
close