IE9はXPを切り捨てた事で、Vista以降のAPIやCOMを積極的に採用したが、Officeも同様かと想像。
具体的には、リボンはMFCのリボンコントロールでなくて、COMのリボンフレームワークになるのではと。 (本家本元なのだから)マークアップバイナリ化のコードとリソース更新用のAPIでDLLに対して用いれば 従来のユーザーが調整出来る仕組みを踏襲したまま移行も十分可能。
| [ | |
| uuid(7E3B563C-7CF6-475D-A3AD-15A5FC42CA25), | |
| version(1.0), | |
| helpstring("myRibbon") | |
| ] | |
| library myRibbon | |
| { | |
| importlib("stdole2.tlb"); | |
| // Forward declare all types defined in this typelib |
| 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&) |
| [ | |
| uuid(1431CA7D-F684-4eb3-B00D-E72D8B116E94), | |
| version(1.0), | |
| helpstring("test") | |
| ] | |
| library test | |
| { | |
| importlib("stdole2.tlb"); | |
| [ |
| #include <windows.h> | |
| #include <stdio.h> | |
| struct Vtable{ | |
| LPBYTE *ppCode; | |
| FARPROC ptr; | |
| }; | |
| void main() | |
| { |
元スレッド EXCEL:他のソフトを使っている間に自動保存する http://okwave.jp/qa/q7600555.html
OKWaveの仕様でインデントが崩れ左寄せになるのを 直すのが面倒なので、必要な判定も削りました。
| 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$ |
| #include <windows.h> | |
| void main() | |
| { | |
| HMODULE hDll = GetModuleHandleW(L"kernel32.dll"); | |
| FARPROC ptr = GetProcAddress(hDll,"OutputDebugStringW"); |
| '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& |