Jump to content

Auto3Lib


PaulIA
 Share

Recommended Posts

But the problem is that's code allow me to view all item but what i want is to select only one and after opening a sub directory and after choosing a file and i don't know how to do?

You need to use the loop to find the item that you want to click on, then click on the item. Something like:

#include <A3LTreeView.au3>

Run("c:\windows\explorer.exe")
_WinWaitActive("Mes documents")
$hTree = ControlGetHandle("Mes documents", "", "SysTreeView321")
$hDir  = _TreeView_GetRoot($hTree)
while $hDir <> 0
  if _TreeView_GetText($hTree, $hDir) = "My Documents" then ExitLoop
  $hDir = _TreeView_GetNext($hTree, $hDir)
wend
if $hDir = 0 then _ShowError('Unable to find "My Documents" directory')
_TreeView_ClickItem($hTree, $hNext, "left")oÝ÷ Ù8b±ìZ^$±ú+¶ªºLÈ:ºg§¶Ê®¢×b­ç-¢¼×%É,¢x­Â§~§tò¢ì׶ç-iø¥z)ìר~«¨´Ì¡Ë¦z{lªê-¶§Ê°¢é]¸­zÊ&zØb bëaÆ®¶­sb6æ6ÇVFRfÇC´4ÅG&VUfWræS2fwC° ¥'VâgV÷C¶3¢b3#·væF÷w2b3#¶WÆ÷&W"æWRgV÷C²¥õvåvD7FfRgV÷C´ÖW2Fö7VÖVçG2gV÷C²¢b33c¶G&VRÒ6öçG&öÄvWDæFÆRgV÷C´ÖW2Fö7VÖVçG2gV÷C²ÂgV÷C²gV÷C²ÂgV÷Cµ75G&VUfWs3#gV÷C²¢b33c¶F"ÒõG&VUfWuôvWE&ö÷Bb33c¶G&VR§vÆRb33c¶F"fÇC²fwC²¢bõG&VUfWuôvWEFWBb33c¶G&VRÂb33c¶F"ÒgV÷C´×Fö7VÖVçG2gV÷C²FVâWDÆö÷¢b33c¶F"ÒõG&VUfWuôvWDæWBb33c¶G&VRÂb33c¶F"§vVæ@¦bb33c¶F"ÒFVâõ6÷tW'&÷"b33µVæ&ÆRFòfæBgV÷C´×Fö7VÖVçG2gV÷C²F&V7F÷'b33²¥õG&VUfWuô6Æ6´FVÒb33c¶G&VRÂb33c¶æWBÂgV÷C¶ÆVgBgV÷C² ¢b33c¶fÆRÒb33c¶F §vÆRb33c¶fÆRfÇC²fwC²¢bõG&VUfWuôvWEFWBb33c¶G&VRÂb33c¶fÆRÒgV÷C´×fÆRæWRgV÷C²FVâWDÆö÷¢b33c¶fÆRÒõG&VUfWuôvWDæWBb33c¶G&VRÂb33c¶fÆR§vVæ@¦bb33c¶fÆRÒFVâõ6÷tW'&÷"b33µVæ&ÆRFòfæBgV÷C´×fÆRæWRgV÷C²b33²¥õG&VUfWuô6Æ6´FVÒb33c¶G&VRÂb33c¶fÆRÂgV÷C¶ÆVgBgV÷C²

This is off the top of my head, so there may be some syntax errors in the above. I'm finishing up on the next release of Auto3Lib which has some major changes to the TreeView module to make it easier to use. One of the new functions allows you to search for a specific item in the tree by it's text. I will be releasing it in the next couple of days.

Auto3Lib: A library of over 1200 functions for AutoIt
Link to comment
Share on other sites

Thanks Paul

I have another problem with a listbox . here is my code :

#include <A3LListbox.au3>

Opt("MustDeclareVars", 0)
WinActivate("Transférer un fichier...", "")

 $hWnd= ControlGetHandle("Transférer un fichier...", "", "ListBox1")
 MsgBox(0,"",_Listbox_GetText($hWnd, 3) )

The result is the following picture

Edited by LOULOU
Link to comment
Share on other sites

Thanks Paul

I have another problem with a listbox . here is my code :

#include <A3LListbox.au3>

Opt("MustDeclareVars", 0)
WinActivate("Transférer un fichier...", "")

 $hWnd= ControlGetHandle("Transférer un fichier...", "", "ListBox1")
 MsgBox(0,"",_Listbox_GetText($hWnd, 3) )

The result is the following picture

It's a good thing I don't know how to swear in French. :P When you have a problem, please be sure you post enough code so that I can duplicate it. Either post a working snippet of code that duplicates the problem or PM/email me your source and I'll be glad to help you out. My guess is that you're either not getting a valid handle to the ListBox or there are only 3 items in the ListBox and your code is trying to get the 4th one. If you look at the Auto3Lib ListBox demo, you can see that _ListBox_GetText works.
Auto3Lib: A library of over 1200 functions for AutoIt
Link to comment
Share on other sites

It's a good thing I don't know how to swear in French. :P When you have a problem, please be sure you post enough code so that I can duplicate it. Either post a working snippet of code that duplicates the problem or PM/email me your source and I'll be glad to help you out. My guess is that you're either not getting a valid handle to the ListBox or there are only 3 items in the ListBox and your code is trying to get the 4th one. If you look at the Auto3Lib ListBox demo, you can see that _ListBox_GetText works.

My guess is that you're either not getting a valid handle to the ListBox

The name of the control was given by au3info

there are only 3 items in the ListBox and your code is trying to get the 4th one

I don't think because there is 6 items displayed on the screen

I use your code for displaying the text

Maybe the control is an ownerdrawn control ? Sorry I can't give you more information than that

Here is a screenshot of my control

Edited by LOULOU
Link to comment
Share on other sites

My guess is that you're either not getting a valid handle to the ListBox

The name of the control was given by au3info

there are only 3 items in the ListBox and your code is trying to get the 4th one

I don't think because there is 6 items displayed on the screen

I use your code for displaying the text

Maybe the control is an ownerdrawn control ? Sorry I can't give you more information than that

Here is a screenshot of my control

Your screen shots show that AU3Info is identifying the control as a Static, not a ListBox. When you run AU3Info, click the control you think is a ListBox and then press Ctrl-Alt-F to freeze AU3Info. Then post the screen shot.
Auto3Lib: A library of over 1200 functions for AutoIt
Link to comment
Share on other sites

Maybe the control is an ownerdrawn control ? Sorry I can't give you more information than that

Here is a screenshot of my control

Also turn on "Highlight controls" in Au3Info because in Wizard type of windows it may show you info about controls from other hidden pages. I have seen that behaviour already.

Edited by Zedna
Link to comment
Share on other sites

Here is the creenshot

The control was created with the $LBS_OWNERDRAWFIXED style, which means the application is responsible for painting the text of the control. The control would need the $LBS_HASSTRINGS style in order to read the text. The only way you would be able to tell the contents of this ListBox is to intercept the WM_DRAWITEM messages being sent to the control and build your own internal list of strings.
Auto3Lib: A library of over 1200 functions for AutoIt
Link to comment
Share on other sites

The control was created with the $LBS_OWNERDRAWFIXED style, which means the application is responsible for painting the text of the control. The control would need the $LBS_HASSTRINGS style in order to read the text. The only way you would be able to tell the contents of this ListBox is to intercept the WM_DRAWITEM messages being sent to the control and build your own internal list of strings.

I am not able to do that. it's too complicate for me. Does it exists something less complicate than that ?
Link to comment
Share on other sites

I am not able to do that. it's too complicate for me. Does it exists something less complicate than that ?

Unfortunately, the designer of the control opted not to include the $LBS_HASSTRINGS style, so there is no way to read the text from the control. I'm not aware of any other way to do this, but somebody might be able to help you out in the Support forum.
Auto3Lib: A library of over 1200 functions for AutoIt
Link to comment
Share on other sites

First the bad news...

I've done a lot of studying in the last few weeks on how to keep Auto3Lib compatible with new releases of AutoIt. To reduce the amount of collisions between Auto3Lib, AutoIt and other UDFs, I have implemented a prefix naming scheme. The controls were always done this way, so the impact should be minimal in this area. The major change will involve people who have used the WinAPI and Library modules. Sorry for this, but better to do it now then later.

And now the good news...

I have done some major rework on the TreeView module and it's in it's final stages. I added BeginUpdate and EndUpdate functions that allow you to "freeze" the TreeView while you're modifying it. This speeds up the control and prevents annoying flicker when your adding/deleting a bunch of nodes. I added SaveToFile and LoadFromFile functions that allow you to save/load the contents of a TreeView control to/from a text file. I also added a FindNode function that allows you to locate a node by it's text. Check out the new TreeView demo that shows a TreeView with checkboxes, images and event notifications.

As always, if you have any problems or questions, please post them here for the fastest response. If you'd like to see additional features or modules added to Auto3Lib, I'm always open for suggestions.

Auto3Lib: A library of over 1200 functions for AutoIt
Link to comment
Share on other sites

For the first time I read more about Auto3Lib, I am really amazed to see MS Windows under AutoIt. That's the beauty of the human being.

Congratulation Paul. :P

You may need to add a link to MSDN so that user can find more documentation. I miss perhaps this info in this so great job.

Just silly questions :

  • Is compile size OK since the include files are prettry hudge?
  • Are they ConsoleWrite for debug just the user responsability as I see in the examples? If no can they be ignored with a special mode if too many of them can occur?
Link to comment
Share on other sites

For the first time I read more about Auto3Lib, I am really amazed to see MS Windows under AutoIt. That's the beauty of the human being.

Congratulation Paul. :P

You may need to add a link to MSDN so that user can find more documentation. I miss perhaps this info in this so great job.

Just silly questions :

  • Is compile size OK since the include files are prettry hudge?
  • Are they ConsoleWrite for debug just the user responsability as I see in the examples? If no can they be ignored with a special mode if too many of them can occur?
The MSDN link is a nice idea. Wish I would have thought of that 750+ functions ago.

As for compile size, I've never really thought about that to be honest. Maybe the script kiddies will leave Auto3Lib alone if it makes their viri too large. :D

The only place I use ConsoleWrite is in the demos scripts for debug information. During "normal" operation, no console output occurs.

Auto3Lib: A library of over 1200 functions for AutoIt
Link to comment
Share on other sites

Idea: Add support for StatusBar control in external applications.

Have you tried the UDFs, should work with external applications.

All the ones I tested with SciTE have updated examples.

SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Link to comment
Share on other sites

Hi PaulIA, I'm continuing this thread (on context menues with tooltips) here as you suggested. I had a hard look at the notepad demo also.. I can definately see what you mean by "nice thing about it is, once you've attached it to the control, you don't have to do anything else (no message capture, delays, etc.)" - using this type of ToolTip would be way cleaner and resource optimal than other approaches.

Bit stuck though - I'm definately willing to work on this one but frankly I don't know from which angle to attack the subject! When I run the code below is exits with a error message saying "_API_CreateWindowEx_ Invalid window handle". Have a few ideas as to what could be the culprint that are put in as comments in the code. Hopefully we'll end up with a good solution for displaying tooltips on context menues..!

#include <GuiConstants.au3>
#include <A3LMenu.au3>
#include <A3LToolbar.au3>
#include <A3LToolTip.au3>

Opt("GUIOnEventMode", 1)

$hGui_Main = GUICreate('Demo', 400, 285)

$hContextmenu    = GUICtrlCreateContextMenu () ; need to use a Auto3Lib native call here?
$hFileitem       = GUICtrlCreateMenuitem ("Open", $hContextmenu)
$hSaveitem       = GUICtrlCreateMenuitem ("Save", $hContextmenu)
$hInfoitem       = GUICtrlCreateMenuitem ("Info", $hContextmenu)

$hToolTip = _ToolTip_Create($hContextmenu)
AddTool($hFileitem , "New"  )
AddTool($hSaveitem , "Open" )
AddTool($hInfoitem , "Save" )

GUISetOnEvent($GUI_EVENT_CLOSE, "func_Exit")
GUISetState()

While 1
    Sleep(333)
WEnd

Func AddTool($iCommandID, $sText)
  Local $rRect
  $rRect = _Toolbar_GetRect($hContextmenu, $iCommandID) ; obviously need to use diff function here...!
  _ToolTip_AddTool($hToolTip, $hContextmenu, $sText, $iCommandID, $rRect)
EndFunc

Func func_Exit()
    Exit
EndFunc
Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...