Posts

Showing posts with the label c++

How to monitor a directory for changes with ReadDirectoryChangesW

Here's how to use  ReadDirectoryChangesW  without knowing all of this and without using this overkill C++ class library (remove the &o parameter in the call to make it blocking instead of async. Note: This only returns one change, you have to step trough a buffer of FILE_NOTIFY_INFORMATIONs if you need to get more): HANDLE hDirectory ; OVERLAPPED o = { 0 }; union { FILE_NOTIFY_INFORMATION i ; char d [ sizeof ( FILE_NOTIFY_INFORMATION )+ MAX_PATH ]; } fni ; int checkAutoCompile () { DWORD b ; if (! hDirectory ) { hDirectory = CreateFile ( "." , FILE_LIST_DIRECTORY | GENERIC_READ , FILE_SHARE_READ | FILE_SHARE_WRITE , 0 , OPEN_EXISTING , FILE_FLAG_BACKUP_SEMANTICS | FILE_FLAG_OVERLAPPED , 0 ); o . hEvent = CreateEvent ( 0 , 0 , 0 , 0 ); } ReadDirectoryChangesW ( hDirectory , & fni , sizeof ( fni ), TR...

Simple Multitouch on Windows

Image
Quickliy coded a dll ( packaged as a Game Maker extension here , but can be used with any HWND) that gives a simple interface to multi touch handling on Windows. All source files included.

highgui.h, highgui.dll download

fatal error C1083: Cannot open include file: 'highgui.h': No such file or directory Just came across some OpenGL Tutorials  which depend on OpenCV Lib's Image loading. OpenCV is a huge library with tons of other stuff you won't need for compiling these samples, so I went ahead and repacked just everything you need for compiling and running these samples (only tested simpleGLUT-Texturing). highgui_h_lib_ocv_x86_vs10.zip  (only vs10x86 binaries and required headers included) When compiling these samples, make sure to set Linker > General > Output File back to default and remove any input libraries, then add the ones included here (e.g. by just drag and dropping them into the source file area of vs10) and copy the dlls in bin to your project dir.