Jump to content

Recommended Posts

Posted

Nice, i like this. Good work.

One point:

I think it may be better to hook WM_NOTIFY with an own Callback windows procedure. So it's not required to use the special function __GUICtrlTreeViewTab_WM_NOTIFY for this. And so the usage of GUIRegisterMsg is like known.

Best Regards BugFix  

Posted

  On 7/12/2012 at 5:42 AM, 'BugFix said:

I think it may be better to hook WM_NOTIFY with an own Callback windows procedure.

Yes, that's what i saw in your MenuEx UDF, i definitely will use this idea, thanks.

 

  Reveal hidden contents

 

 

AutoIt is simple, subtle, elegant. © AutoIt Team

Posted

It's a little bit tricky to use this method, i have to set window hook for every gui that treeviewtab is created in, and then release each one of them after the control is destroyed...

 

  Reveal hidden contents

 

 

AutoIt is simple, subtle, elegant. © AutoIt Team

Posted

Update...

  Quote

1.2

* WM_NOTIFY window message replaced with Callback windows procedure (thanks to BugFix).

* Fixed issue with adding new control, if it's added after TreeViewTabItem deleted, the control added outside TabItems.

* Removed TreeViewTab_Adlib.au3 due to replacement of WM_NOTIFY window message.

 

  Reveal hidden contents

 

 

AutoIt is simple, subtle, elegant. © AutoIt Team

  • 4 years later...
Posted (edited)

Hello @MrCreatoR,

I often use this UDF, it works great.

Since I use it not only for installations, but also as a management surface for tools, I was missing the possibility to switch inside functions by the current focussed TreeviewTab-ID.

Here is my solution for this:

; #Region Global Variables:
; added
Global $g_iFocussedTVTID = 0 ; the current focussed TreeviewTab-ID

; __GUICtrlTreeViewTab_SelChanged:
Func __GUICtrlTreeViewTab_SelChanged()
    AdlibUnRegister('__GUICtrlTreeViewTab_SelChanged')

    Local $hWndFrom = $a_TVT_hWndID[0]
    Local $iIDFrom = $a_TVT_hWndID[1]
    
    ; added:
    ;======================================== the focussed TreeviewTab-ID
    $g_iFocussedTVTID = $iIDFrom
    ;====================================================================
    
    ;...
    
; new function:
Func _GUICtrlTreeViewTab_GetCurrentItemID()
    Return $g_iFocussedTVTID
EndFunc

Now I can get the current ID with _GUICtrlTreeViewTab_GetCurrentItemID()

 

Edited by BugFix

Best Regards BugFix  

  • 2 weeks later...
Posted (edited)

Why you can not use $a_TVT_hWndID[1]?

Func _GUICtrlTreeViewTab_GetCurrentItemID()
    Return $a_TVT_hWndID[1]
EndFunc

Edit: oh sorry, but then you need to comment/remove the line:

Dim $a_TVT_hWndID[2]

 

Edited by MrCreatoR

 

  Reveal hidden contents

 

 

AutoIt is simple, subtle, elegant. © AutoIt Team

  • 4 months later...
Posted

Hey,

I like this UDF ;)

 

But i have a Problem with this UDF.

If you for example have an error in your Script:

global $error[1]
$error[5] = 4

AutoitIT and Scite shows this error as soon as it hits this script line.

if you put the above error right after:

_GUICtrlTreeViewTab_CreateTab

and run the Script. Autoit Hangs/Crashes with no error information.

 

I have a larga Script and its hard to find simple mistakes like this.

 

I have to uncomment:

$ah_TVT_WinProc[$ah_TVT_WinProc[0][0]][1] = _WinAPI_SetWindowLong($hParent, $GWL_WNDPROC, DllCallbackGetPtr($h_TVT_WinCallback_Proc))

in the "_GUICtrlTreeViewTab_CreateTab" function.  Then Autoit Shows me the error like it should. But switching "tabs" is not possible then.

 

Anyone has an idea what is causing autoit not to show errors after "_GUICtrlTreeViewTab_CreateTab" ?

  • 2 weeks later...
Posted
  On 10/13/2017 at 1:08 PM, Shikutoku said:

I have a larga Script and its hard to find simple mistakes like this.

Expand  

Sorry, but this is not simple mistake, it's something that you should prevent.

If you set array for 1 dimension, then use 1 dimension.

If the array is dynamic, then always check the array dimension before using it.

 

 

  Reveal hidden contents

 

 

AutoIt is simple, subtle, elegant. © AutoIt Team

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
×
×
  • Create New...