Notifications
Clear all
[Closed] switch to Havok3 by script?
5 Replies
1 Reply
it’s possible…
fn setHavok id:1 =
(
UtilityPanel.OpenUtility reactor
utip = for w in (windows.getChildrenHWND #max) where w[5] == "Command Panel" do exit with w[1]
if utip != OK do
(
cbox = for w in (windows.getChildrenHWND utip) where w[4] == "ComboBox" and matchpattern w[5] pattern:"Havok*" do exit with w[1]
if cbox != OK do
(
CB_GETCURSEL = 0x0147
CB_SETCURSEL = 0x014E
WM_COMMAND = 0x0111
CBN_SELCHANGE = 0x0001
if (windows.sendMessage cbox CB_GETCURSEL 0 0) != id do
(
windows.sendMessage cbox CB_SETCURSEL id 0
wparent = UIAccessor.GetParentWindow cbox
cbox_id = UIAccessor.getWindowResourceID cbox --0x04ac
windows.sendMessage wparent WM_COMMAND (bit.or (CBN_SELCHANGE*0x010000) cbox_id) cbox
id
)
)
)
)
setHavok id:0 – Havok 1
setHavok id:1 – Havok 3
it looks a little crazy but it should work…
Oct 14, 2009 10:51 am
You would probably have to use the UIAccessor or the .Net Windows Structure as there is no direct access.
-Eric
Oct 14, 2009 10:51 am
It works fine but I have to close the popup Analyse window. I don’t really understand how the UI AAccessor works. I just want to uncheck the “Analyse on Solver Switch button” in the Reactor Utils or to close the window when popup.
1 Reply
fn havokAnalyzeSwitchToggle =
(
UtilityPanel.OpenUtility reactor
utip = for w in (windows.getChildrenHWND #max) where w[5] == "Command Panel" do exit with w[1]
if utip != OK do
(
cbox = for w in (windows.getChildrenHWND utip) where matchpattern w[5] pattern:"Analyze On Solver Switch" do exit with w[1]
if cbox != OK do
(
-- WM_LBUTTON_DOWN = 0x0201
-- WM_LBUTTON_UP = 0x0202
windows.sendMessage cbox 0x0201 0 0
windows.sendMessage cbox 0x0202 0 0
)
)
)
its toggles the check box state, but i don't know how to get state of the checkbox