How to create virtual webcam in Windows 10?

Virtual webcam is typically a software only implementation that application discover as if it is a device with physical representation. The mentioned applications use APIs to work with web cameras and ability to extend the APIs and add your own video source is the way to create a virtual web camera. In Windows there are … Read more

Alignment requirements for atomic x86 instructions vs. MS’s InterlockedCompareExchange documentation?

x86 does not require alignment for a lock cmpxchg instruction to be atomic. However, alignment is necessary for good performance. This should be no surprise, backward compatibility means that software written with a manual from 14 years ago will still run on today’s processors. Modern CPUs even have a performance counter specifically for split-lock detection … Read more

Windows API: ANSI and Wide-Character Strings — Is it UTF8 or ASCII? UTF-16 or UCS-2 LE?

Are those above all correct? Yes, if you don’t assume the existence of characters not encoded in Unicode (for most practical applications, this assumption is fine). Do the Windows “A” functions (like SetWindowTextA) take in ASCII strings? Or “multi-byte strings” (more questions on this below)? They take byte strings (i.e., strings whose code unit is … Read more

Can a Win32 console application detect if it has been run from the explorer or not?

See http://support.microsoft.com/kb/99115, “INFO: Preventing the Console Window from Disappearing”. The idea is to use GetConsoleScreenBufferInfo to determine that the cursor has not moved from the initial 0,0 position. Code sample from @tomlogic, based on the referenced Knowledge Base article: // call in main() before printing to stdout // returns TRUE if program is in its … Read more

How do I send key strokes to a window without having to activate it using Windows API?

Alright, this is kind of disappointing I’m sure, but you fundamentally cannot do this with 100% reliability. Windows assumes that the active window is the one getting keyboard input. The proper way to fake keyboard input is with SendInput, and you’ll notice that it sends messages to the active window only. That being said, you … Read more

Win32: full-screen and hiding taskbar

Edit 2. There is even a better way for doing fullscreen, the chromium way, source taken from here: http://src.chromium.org/viewvc/chrome/trunk/src/ui/views/win/fullscreen_handler.cc?revision=HEAD&view=markup void FullscreenHandler::SetFullscreenImpl(bool fullscreen, bool for_metro) { ScopedFullscreenVisibility visibility(hwnd_); // Save current window state if not already fullscreen. if (!fullscreen_) { // Save current window information. We force the window into restored mode // before going fullscreen … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)