Jump to content

ControlTreeView Check & IsChecked refuse to work


Recommended Posts

I'm trying to (un)tick checkboxes and select radiobuttons using ControlTreeView. The problem is that both refuse to work. However, "Exists" and "Select" both work (Although I do not see a (blue or dotted) selection box the latter causes the treeview to scroll the item into view).

What is going on here, and how do I fix it ?

Remark:
I've been both googeling and searching this forum for quite a bit of time. Although the problem seems to exist for years I've not seen an explanation (other than a 32 vs 64 bit OS) nor found a solution. Is this one of those "won't fix" issues ?

Ah, I almost forgot: The version (AutoIt3.exe) shows 3.2.12.1

Link to comment
Share on other sites

  • Moderators

One more thing you forgot, @BitRot, your code :) Please post what you have, or a reproducer that shows your issue, so we're not guessing at what you're trying to do.

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
Share on other sites

One more thing you forgot, @BitRot, your code

I didn't. Forget that is. That was a consious decision. Including not mentioning the OS version it runs on.

What do you need ? And don't say "everything" please.

Mind you, I already mentioned that two other outof the same group seem to work.

But, lets see if you can spot a mistake :-)


$hProcess = Run('rundll32.exe shell32.dll,Options_RunDLL 0')

[snip making sure the proces and window are there]

$sAppletTitle = "Folder Options"
;Works
ConsoleWriteError (ControlTreeView($sAppletTitle,"","SysTreeView321","Select","Files and Folders|Do not cache thumbnails") & @crlf)
ConsoleWriteError (ControlTreeView($sAppletTitle,"","SysTreeView321","Exists","Files and Folders|Do not cache thumbnails") & @crlf)
;Fails
ConsoleWriteError (ControlTreeView($sAppletTitle,"","SysTreeView321","Check","Files and Folders|Do not cache thumbnails") & @crlf)
Fails (returns -1 , no checkable control found)
ConsoleWriteError (ControlTreeView($sAppletTitle,"","SysTreeView321","IsChecked","Files and Folders|Do not cache thumbnails") & @crlf)


Currently, after some testing (using a "real" programming language :-p ) I think I know why it fails (marshalling related), but I'm surprised that that I've not seen it mentioned anywhere, particulary including AutoIt's Help...


Link to comment
Share on other sites

For the off chance that anybody reads this:

The problem turned out not to be AutoIt (my apologies for assuming so), but rather the TreeView (as used by XPsp3's "Folder Options" dialog -> "View". It happens to fake checkboxes (and radio buttons) by re-purposing the "file extension" images. (thats the reason of the problem)

The begin of the solution for the faked checkboxes is to use _GUICtrlTreeView_SetImageIndex to assign the correct image. The faked radio buttons can also be altered this way too, but than the other radio buttons (in the same group) will not respond to the change. To get that to work the (much simpler) _GUICtrlTreeView_ClickItem should be used - which has an added benefit that the dialog registers a change and enables the "Apply" button at he bottom.
(thats the solution)

(hmm... I would have liked to see a preview of what I'm about to post. Will the above > convert or not ...)

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...