Check state of rollout in Render Setup Dialog

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

THREAD CLOSED
 
Thread Tools Search this Thread Display Modes
  03 March 2013
Check state of rollout in Render Setup Dialog

Hello!
I want to expand rollup in renderSceneDialog. There are some buttons inside (for the finalRender) that can't be set only by maxscript commands and i press them by SendMessage and mouse click (even BM_SETCHECK doesn't work? but this doesn't matter). So i should expand a rollout, as you can see in the image.



The problem is i don't know what's is the class of this rollout. For example i change the Tab in this Dialog by:

  TCM_FIRST = 0x1300
  TCM_SETCURSEL = 0x130C
  TCM_SETCURFOCUS = TCM_FIRST + 48
  BM_SETCHECK = 0x00F1
  WM_LBUTTONDOWN = 0x0201
  WM_LBUTTONUP = 0x0202
  
  renderSceneDialog.close()
  renderSceneDialog.open()
  rs_hwnd = for i in (windows.getChildrenHWND (windows.getdesktopHWND())) where matchPattern i[5] pattern: "Render Setup:*" do exit with i[1]
  
  widget_hwnd = for i in windows.getChildrenHWND rs_hwnd where i[4] == "SysTabControl32" do exit with i[1]
  -- CHANGE TAB TO RAYTRACER
  Windows.SendMessage widget_hwnd TCM_SETCURFOCUS 2 0
  Windows.SendMessage widget_hwnd TCM_SETCURSEL 2 0
  
     


So, i know that the tab widget is TabControl and i found it's messages. But i can't find out, what is Rollup.
It seems to be a max rollout. But then i know it's handle and don't know how to expand rollout by its handle.
The only method is to check the size of the next child - the expanded contents. But is there any decision to expand this rollout properly by SendMessage or any other compiled function?
Thanks in advance!

Last edited by mr-asa : 03 March 2013 at 06:21 AM.
 
  03 March 2013
there are some easier ways to accomplish this.

fn setScriptsRollupOpen =
(
	renderSceneDialog.close()
	renderSceneDialog.open()
	tabbedDialogs.setCurrentPage #render (tabbedDialogs.getPageID #render 1)
	local rollupHwnd = for w in windows.getChildrenHwnd (windows.getDesktopHwnd()) where w[4] == "RollupPanelTitle" and w[5] == "Scripts" do exit with w[2]
	windows.sendMessage rollupHwnd 0x040A 0 0
)


If you want to avoid closing and opening the renderSceneDialog in case it's already open, you'll need a c# assembly that exposes the IsWindowVisible winapi function. You can then use this to determine the closed/open state of the rollout (by checking if it's 2nd child is visible or not)

Last edited by lo : 03 March 2013 at 04:11 PM.
 
  03 March 2013
thank you very much for your answer!
It works.
But i wonder how did you find this message code: 0x040A?
I found it by Spy++ tool from VisualStudio, checking WM_USER checkbox logging properties. This is a method, but before this i searched in MaxSDK documentation, and there are a lot of messages like CC_SPINER_CHANGE and so on, but nothing about 'WM_USER + 10'..

So, can you please tell me where did you find it?
 
  03 March 2013
Originally Posted by mr-asa: thank you very much for your answer!
It works.
But i wonder how did you find this message code: 0x040A?
I found it by Spy++ tool from VisualStudio, checking WM_USER checkbox logging properties. This is a method, but before this i searched in MaxSDK documentation, and there are a lot of messages like CC_SPINER_CHANGE and so on, but nothing about 'WM_USER + 10'..

So, can you please tell me where did you find it?


I found it similarly as you did, but not using Spy++, I use WindowShopper, which is a small maxscript I wrote for these kind of tasks. You can find it in 'free tools' on my webpage in the signature.

You are correct that there is no description of it in the Max SDK docs or files, but I noticed by observation that it toggles a rollup open/closed.
 
  03 March 2013
Originally Posted by lo: WindowShopper

Good thing! Thank you very much.
 
  03 March 2013
Originally Posted by lo: If you want to avoid closing and opening the renderSceneDialog in case it's already open, you'll need a c# assembly that exposes the IsWindowVisible winapi function.


Hello Rotem, does this not accomplish the same?

renderSceneDialog.isopen()
__________________
Regards,
Pete

Read my technical blog - lonerobot.net
 
  03 March 2013
Sorry, I skipped a few steps there. What I meant to explain is that using this method it is necessary to close and reopen the render scene dialog, the reason being that if it's already open the scripts rollup may already be open, and sending it the toggle message would close it, accomplishing the opposite goal. Reopening the dialog ensures the scripts rollup starts closed. This could be circumvented with a IsWindowVisible call if needed, which is unfortunately a win32 call.
 
  03 March 2013
Thread automatically closed

This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
__________________
CGTalk Policy/Legalities
Note that as CGTalk Members, you agree to the terms and conditions of using this website.
 
Thread Closed share thread



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
CGSociety
Society of Digital Artists
www.cgsociety.org

Powered by vBulletin
Copyright 2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump
Miscellaneous

All times are GMT. The time now is 01:58 AM.


Powered by vBulletin
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.