Skip to content

Instantly share code, notes, and snippets.

[
uuid(7E3B563C-7CF6-475D-A3AD-15A5FC42CA25),
version(1.0),
helpstring("myRibbon")
]
library myRibbon
{
importlib("stdole2.tlb");
// Forward declare all types defined in this typelib
@kumatti1
kumatti1 / gist:2296026
Created April 3, 2012 22:40
クラスモジュール
Option Explicit
Implements IUICommandHandler
Implements IUIApplication
Const E_NOTIMPL = &H80004001
Const MyButton = 30002
Private Declare Sub RtlMoveMemory Lib "Kernel32.dll" (ByVal Destination&, ByVal Source&, ByVal length&)
Option Explicit
'UserFormモジュール
Private Declare Function FreeLibrary& Lib "Kernel32.dll" (ByVal hModule&)
Private Declare Function LoadLibraryW& Lib "Kernel32.dll" (ByVal lpFileName&)
Private Declare Function WindowFromAccessibleObject& Lib "Oleacc.dll" (ByVal pacc&, ByVal phwnd&)
Private Declare Function GetTopWindow& Lib "User32.dll" (ByVal hWnd&)
Private Declare Function GetModuleHandleW& Lib "Kernel32.dll" (ByVal lpModuleName&)
Private Declare Function GetWindowLongW& Lib "User32.dll" (ByVal hWnd&, ByVal nIndex&)
@kumatti1
kumatti1 / ReadMe.md
Created April 9, 2012 23:12
次期Office15予想

次期Office15予想

IE9はXPを切り捨てた事で、Vista以降のAPIやCOMを積極的に採用したが、Officeも同様かと想像。

具体的には、リボンはMFCのリボンコントロールでなくて、COMのリボンフレームワークになるのではと。 (本家本元なのだから)マークアップバイナリ化のコードとリソース更新用のAPIでDLLに対して用いれば 従来のユーザーが調整出来る仕組みを踏襲したまま移行も十分可能。

[
uuid(1431CA7D-F684-4eb3-B00D-E72D8B116E94),
version(1.0),
helpstring("test")
]
library test
{
importlib("stdole2.tlb");
[
@kumatti1
kumatti1 / otukare.asm
Created April 16, 2012 06:39
ああー、マイクのテスト中
#include <windows.h>
#include <stdio.h>
struct Vtable{
LPBYTE *ppCode;
FARPROC ptr;
};
void main()
{
@kumatti1
kumatti1 / README.md
Created August 15, 2012 01:55
ディアクテイブでタイマー

元スレッド EXCEL:他のソフトを使っている間に自動保存する http://okwave.jp/qa/q7600555.html

OKWaveの仕様でインデントが崩れ左寄せになるのを 直すのが面倒なので、必要な判定も削りました。

質問者に分かればいいので。

@kumatti1
kumatti1 / gist:3718117
Created September 13, 2012 22:17
起動済みExplorerの検索
Declare Function ILCreateFromPathW& Lib "Shell32.dll" (ByVal pszPath&)
Declare Sub MoveMemory Lib "kernel32" Alias "RtlMoveMemory" _
(Destination As Any, Source As Any, ByVal Length As Long)
Declare Sub ILFree Lib "Shell32.dll" (ByVal pidl&)
Declare Function ILGetSize& Lib "Shell32.dll" (ByVal pidl&)
Sub hoge()
Dim IE As Object
Dim tmp&, pidl&, v, strPath$
@kumatti1
kumatti1 / gist:3875998
Created October 11, 2012 22:40
otukare.cpp
#include <windows.h>
void main()
{
HMODULE hDll = GetModuleHandleW(L"kernel32.dll");
FARPROC ptr = GetProcAddress(hDll,"OutputDebugStringW");
@kumatti1
kumatti1 / CIE.cls
Created November 6, 2012 23:34
CommandStateChange イベントでよろしく。
'YU-TAMG氏のコード改
'https://gist.github.com/1619670
' 要・Microsoft Internet Controls 参照設定
Option Explicit
Private Declare PtrSafe Function PostMessage Lib "user32" Alias "PostMessageA" (ByVal hwnd As LongPtr, ByVal wMsg As Long, ByVal wParam As LongPtr, ByVal lParam As LongPtr) As Long
Private Declare PtrSafe Function GetLastActivePopup Lib "user32" (ByVal hwndOwnder As LongPtr) As LongPtr
Private Declare PtrSafe Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As LongPtr
Private Const WM_COMMAND As Long = &H111&