Skip to content

Instantly share code, notes, and snippets.

View katahiromz's full-sized avatar
🐜

Katayama Hirofumi MZ katahiromz

🐜
View GitHub Profile
@katahiromz
katahiromz / japanese.c
Last active April 5, 2019 04:49
japanese.c
/*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS system libraries
* FILE: dll/win32/kernel32/winnls/string/japanese.c
* PURPOSE: Japanese era support
* PROGRAMMER: Katayama Hirofumi MZ
*/
#include <k32.h>
@katahiromz
katahiromz / browser-guid.txt
Created April 21, 2019 01:39
browser-guid.txt
MWebBrowserEx::QueryInterface: {00020400-0000-0000-C000-000000000046}: IDispatch
MWebBrowserEx::QueryInterface: {3050F6D0-98B5-11CF-BB82-00AA00BDCE0B}: IDocHostUIHandler2
MWebBrowserEx::QueryInterface: {6D5140C1-7436-11CE-8034-00AA006009FA}: IServiceProvider
MWebBrowserEx::QueryInterface: {9C2CAD80-3424-11CF-B670-00AA004CD6D8}: IOleInPlaceSiteEx
MWebBrowserEx::QueryInterface: {B196B289-BAB4-101A-B69C-00AA00341D07}: IOleControlSite
MWebBrowserEx::QueryInterface: {B6EA2050-048A-11D1-82B9-00C04FB9942E}: IAxWinHostWindow
MWebBrowserEx::QueryInterface: {B722BCCB-4E68-101B-A2BC-00AA00404770}: IOleCommandTarget
MWebBrowserEx::QueryInterface: {BD3F23C0-D43E-11CF-893B-00AA00BDCE1A}: IDocHostUIHandler
MWebBrowserEx::QueryInterface: {BF9D04BF-DBAD-40EF-B1A1-E4CC38FA8995}
MWebBrowserEx::QueryInterface: {C4D244B0-D43E-11CF-893B-00AA00BDCE1A}: IDocHostShowUI
@katahiromz
katahiromz / WinJIS.h
Created April 21, 2019 22:51
WinJIS.h --- Japanese encoding manipulation for Windows.
/* WinJIS.h --- Japanese encoding manipulation for Windows.
* This is public domain software.
* Copyright (C) 2019 Katayama Hirofumi MZ <[email protected]>.
*/
#ifndef WINJIS_H_
#define WINJIS_H_ 2 /* Version 2 */
#ifndef _INC_WINDOWS
#include <windows.h>
#endif
@katahiromz
katahiromz / MemCheck1.cpp
Created July 3, 2019 12:15
MemCheck1.cpp
#include <windows.h>
#include <vector>
#include <iostream>
int main(void)
{
MEMORYSTATUS ms1, ms2;
{
std::vector<DWORDLONG> vec(0xFFFFFF, 1);
@katahiromz
katahiromz / MemCheck2.cpp
Created July 3, 2019 12:16
MemCheck2.cpp
#include <windows.h>
#include <list>
#include <iostream>
int main(void)
{
MEMORYSTATUS ms1, ms2;
{
std::list<DWORDLONG> lst(0xFFFFFF, 1);
@katahiromz
katahiromz / GetPathOfShortcut.cpp
Created August 15, 2019 09:39
GetPathOfShortcut
#include <windows.h>
#include <shlobj.h>
BOOL GetPathOfShortcut(HWND hWnd, LPCTSTR pszLnkFile, LPTSTR pszPath)
{
TCHAR szPath[MAX_PATH];
#ifndef UNICODE
WCHAR wsz[MAX_PATH];
#endif
IShellLink* pShellLink;
@katahiromz
katahiromz / DoGetOSInfo.cpp
Created September 12, 2019 10:25
DoGetOSInfo.cpp
#include <windows.h>
#include <string>
#include <strsafe.h>
std::wstring DoGetOSInfo(void)
{
HKEY hKey = NULL;
WCHAR szText[32];
DWORD dwValue, cbData;
std::wstring ret;
@katahiromz
katahiromz / 15_548.cpp
Created September 23, 2019 03:04
15_548.cpp
#include <windows.h>
#include <shlobj.h>
#include <shlwapi.h>
#include <stdio.h>
#include <vector>
#pragma comment(lib, "shlwapi.lib")
std::vector<FILETIME> filetimes;
void DoRecurse(LPCWSTR dir)
{
WCHAR szPath[MAX_PATH];
@katahiromz
katahiromz / 3-clause-BSD-license.txt
Created October 19, 2019 05:28
the 3-clause BSD license
Copyright (c) 2019, Katayama Hirofumi MZ
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of Win Vector LLC nor the
@katahiromz
katahiromz / DoAspectAdapt.cpp
Last active November 4, 2019 17:03
DoAspectAdapt.cpp
enum ASPECT_MODE
{
ASPECT_MODE_IGNORE,
ASPECT_MODE_FIT,
ASPECT_MODE_TRIM
};
BOOL DoAspectAdapt(ASPECT_MODE mode, const SIZE *psizSrc,
const RECT *prcScreen, RECT *prcFrame)
{