ScriptSpot home

Simple hWnd Viewer

Downloads

Release history (3)
  • Version 0.13Listed version

    Listing updated

    No download linked to this version

  • Version 0.14

    Release notes

    v0.14 - added Resume button

  • Version 0.12

    Release notes

    v0.12 - added up to 10 parents info

3ds Max compatibility
Unknown
Report a problem
Community compatibilityNo compatibility reports yet

No reports yet for the available releases.

Community reviewsNo reviews yet.

Listing details

Version
v0.13
Author’s update date
Legacy votes
8
Listing created
How compatibility works

Compatibility comes from the author’s supported range or requirements in the original listing. A tested version records what the author tried.

“2020 unconfirmed” in the catalog means support for 3ds Max 2020 is still unknown.

Community reports record successful tests on specific releases.

Posted by

pixamoon

Credited author: Pixamoon

More by this author

Description


This is just simple tool to check window element handle - hwnd under mouse pointer.

I did it some time ago to test reading info from ListBox but it can be used it to inspect UI elements you need to work with later.

Note: This tool is can be useful only for people who writes maxscripts.

Changelog:
v0.14
 - added Resume button
v0.12
 - added up to 10 parents info

Best,
Pixamoon

 

Comments (7)
pixamoon

`

Hi,

I didn't try with QT panel yet,

Will try to get info from that and let you know.

Best,
Pixmaoon

tasurnin

Really nice tool,
Do you ever try to do the same with the new QT panel (max 2018)?
I need to change some parameters(material Rendering Level) for the "viewport per-view Settings" but the command UIAccessor.GetChildWindows for this windows is empty.

Thanks

Reply to tasurnin
Vojtech Cada

Here you go

This will give you the children of the Per-View Preferences widget:

(
	local ctypes = python.import "ctypes"
	local QtWidgets = python.import "PySide2.QtWidgets"

	actionMan.executeAction 0 "63578"
	windows.processPostedMessages()
	local viewPref = ctypes.windll.user32.GetActiveWindow() as IntegerPtr

	local widget = QtWidgets.QWidget.find viewPref
	local widgetChildren = widget.children() as array
)

You can call python help command on those that you care about to find out more, say

	local builtin = python.import "__builtin__"
	builtin.help widgetChildren[1]
Reply to Vojtech Cada
pixamoon

`

Ah, nice, thanks,

Will try to implement it to get python widgets under a mouse too.

Here is just code to set Material Rendering Level:


(

  local ctypes = python.import "ctypes"
  local QtWidgets = python.import "PySide2.QtWidgets"
 
  actionMan.executeAction 0 "63578"
  windows.processPostedMessages()

  local viewPref = ctypes.windll.user32.GetActiveWindow() as IntegerPtr
   
  local widget = QtWidgets.QWidget.find viewPref
  --local widgetChildren = widget.children() as array
  
  
  local combo_box
  local ok_button
  
  fn find_material_combo widget = 
  (
    for w in (widget.children() as array) where w != undefined while combo_box == undefined or ok_button == undefined do
    (
      if matchpattern (w as string) pattern:"*QComboBox*" and \
         matchpattern ((w.parentWidget()) as string) pattern:"*QGroupBox*" and \
         (w.parentWidget()).title() == "Additional Parameters" and \
         w.findText("Basic Material") > -1 \
      then
      (
        combo_box = w
      )
      else
      (
        if ok_button == undefined and matchpattern (w as string) pattern:"*button*" and tolower (w.text()) == "ok" do ok_button = w
        
        find_material_combo w
      )
    )
  )
  
  find_material_combo widget

  if combo_box != undefined do combo_box.setCurrentIndex 0 -- set index as you need (0 - based)
    
  if ok_button != undefined do ok_button.click()
  
  ok
)

Best,

Vojtech Cada

Nice script

Couldn't resist and added some more info to the printout:

Attachments
kyle108

cool idea, I'm going to use this quite a bit.