;============================================================ ; iron_ribbon_native.hsp — Windows Ribbon Framework (完全版) ; ; hspribbon.dll (UIRibbon COM)。Windows 7 以降。 ; uicc.exe (Windows SDK) でリボンマークアップをコンパイル。 ; #ifndef __iron_ribbon_native_hsp__ #define __iron_ribbon_native_hsp__ #ifdef hsp3cl_64 #uselib "hspribbon_64.dll" #else #ifdef hsp64 #uselib "hspribbon_64.dll" #else #uselib "hspribbon.dll" #endif #endif #func global _rib_init "ribbon_init" int #func global _rib_load "ribbon_load_markup" wstr #func global _rib_load_dll "ribbon_load_dll" str, wstr #func global _rib_poll "ribbon_poll_cmd" var, var #cfunc global _rib_last_int "ribbon_get_last_int" #func global _rib_set_modes "ribbon_set_modes" int #func global _rib_invalidate "ribbon_invalidate" int, int #cfunc global _rib_height "ribbon_get_height" #func global _rib_minimize "ribbon_minimize" int #func global _rib_bgcolor "ribbon_set_background_color" int, int, int #func global _rib_load_bml "ribbon_load_bml" str #func global _rib_load_xml "ribbon_load_xml" str, str #func global _rib_set_event "ribbon_set_event_mode" int, int #cfunc global _rib_get_msgid "ribbon_get_event_msgid" #func global _rib_destroy "ribbon_destroy" #module iron_ribbon_native dim _rib_cmd, 1 dim _rib_verb, 1 #deffunc ribbon_native_init _rib_init hwnd return stat #deffunc ribbon_native_load str res _rib_load res return stat #deffunc ribbon_native_load_dll str dllpath, str res _rib_load_dll dllpath, res return stat ; Poll for command. stat=1 if command was fired. ; Use ribbon_native_cmd_id() / ribbon_native_cmd_verb() to get details. #deffunc ribbon_native_poll _rib_poll _rib_cmd, _rib_verb return stat #defcfunc ribbon_native_cmd_id return _rib_cmd #defcfunc ribbon_native_cmd_verb return _rib_verb #defcfunc ribbon_native_last_int return _rib_last_int() #defcfunc ribbon_native_height return _rib_height() #deffunc ribbon_native_minimize int sw _rib_minimize sw return #deffunc ribbon_native_set_modes int mask _rib_set_modes mask return stat #deffunc ribbon_native_set_bgcolor int r, int g, int b _rib_bgcolor r, g, b return ; Load pre-compiled BML file directly (no uicc needed at runtime) ; Creates a temporary resource DLL automatically. #deffunc ribbon_native_load_bml str bml_path _rib_load_bml bml_path return stat ; Compile XML → BML → Load in one step. ; uicc_path: full path to uicc.exe (Windows SDK) ; If uicc_path is "", searches PATH. #deffunc ribbon_native_load_xml str xml_path, str uicc_path _rib_load_xml xml_path, uicc_path return stat ; Enable event mode: oncmd で受信。wm_id はカスタム可 (0=デフォルト WM_APP+100) #deffunc ribbon_native_set_event_mode int enabled, int wm_id _rib_set_event enabled, wm_id return #defcfunc ribbon_native_get_event_msgid return _rib_get_msgid() #deffunc ribbon_native_destroy _rib_destroy return #global #endif