Skip to content

Instantly share code, notes, and snippets.

@BojanKomazec
BojanKomazec / main.cpp
Created October 4, 2017 16:23
MFC: Adding tray icon to the window
#include <stdafx.h>
...
// tray icon ID
#define ID_SYSTEMTRAY 0x1000
// custom message ID
#define WM_TRAYICON_EVENT (WM_APP + 1)
// tray icon resource ID
@superlucky8848
superlucky8848 / GetFileVersion.cpp
Created April 4, 2016 02:25
C++ Get file version and return formatted string(Windows)
#pragma comment(lib,"Version.lib")
#define MAX_LINE_LENGTH 4096
CString GetFileVersion(LPCTSTR filePath)
{
CString ret(_T(""));
DWORD dummy;
DWORD dwSize = GetFileVersionInfoSize(filePath, &dummy);
if (dwSize == 0) ret = _T("Error retriving version(Module Not Found)");
@flowtwo
flowtwo / count-download
Last active December 23, 2019 22:23
Count downloads of files from the WordPress Media Library
<?php
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
global $download_base_dir;
$download_base_dir = dirname(__FILE__);
global $download_prefix;
$download_prefix = 'download_';
function gr_download_init() {