Jump to content
Sign in to follow this  
gseller

Need help validating _GUICtrlListView_?

Recommended Posts

gseller

Can someone help me? I am afraid I am not doing very well with the new 3.2.10.0 syntax when it comes to the new _GUICtrlListView_?? I have this function working all except it will not work right on the "if then" validating if a selection is made from the listview before sending on to the ShellExecute and so on. Any help would be much apreciated.. Below are several failed attempts to validate...

Thank You in advance..

Func execute()
 $CurIndex = _GUICtrlListView_GetSelectedIndices($ListViewID,true)
 If $CurIndex = 0 Then
  MsgBox(0, "Error", "You must select a session from the list" )
  Return
 EndIf
 ShellExecute("HOSTEX32.EXE", " " & _GUICtrlListView_GetItemText($ListViewID, $CurIndex[1], 1), @ProgramFilesDir & "\Hummingbird\Connectivity\10.00\HostExplorer", "")
 SplashTextOn( "Please Stand by", "Launching: "  & @CRLF & _GUICtrlListView_GetItemText($ListViewID, $CurIndex[1], 0), 300, 75, -1, -1,17 )
 Sleep(1000)
 SplashOff()
EndIfoÝ÷ Ù«­¢+ÙÕ¹áÕÑ ¤(ÀÌØí
ÕÉ%¹àô}U%
Ñɱ1¥ÍÑY¥Ý}ÑM±Ñ%¹¥Ì ÀÌØí1¥ÍÑY¥Ý%±ÑÉÕ¤)%}U%
Ñɱ1¥ÍÑY¥Ý}Ñ%ѵQáÐ ÀÌØí1¥ÍÑY¥Ý%°ÀÌØí
ÕÉ%¹álÁt°Ä¤ôÀQ¡¸(5Í    ½à ÐÀäØ°ÅÕ½ÐìÅÕ½Ðì°ÅÕ½Ðíe½ÔµÕÍÐͱÐÍÍÍ¥½¸É½´Ñ¡±¥ÍÐÅÕ½Ðì¤)±Í(M¡±±áÕÑ ÅÕ½Ðí!=MQ`ÌȹaÅÕ½Ðì°ÅÕ½ÐìÅÕ½ÐìµÀì}U%
Ñɱ1¥ÍÑY¥Ý}Ñ%ѵQáÐ ÀÌØí1¥ÍÑY¥Ý%°ÀÌØí
ÕÉ%¹álÅt°Ä¤°Aɽɵ¥±Í¥ÈµÀìÅÕ½ÐìÀäÈí!Õµµ¥¹¥ÉÀäÈí
½¹¹Ñ¥Ù¥ÑäÀäÈìÄÀ¸ÀÀÀäÈí!½ÍÑáÁ±½ÉÈÅÕ½Ðì°ÅÕ½ÐìÅÕ½Ðì¤(MÁ±Í¡QáÑ=¸ ÅÕ½ÐíA±ÍMѹäÅÕ½Ðì°ÅÕ½Ðí1Õ¹¡¥¹èÅÕ½ÐìµÀì
I1µÀì}U%
Ñɱ1¥ÍÑY¥Ý}Ñ%ѵQáÐ ÀÌØí1¥ÍÑY¥Ý%°ÀÌØí
ÕÉ%¹álÅt°À¤°ÌÀÀ°ÜÔ°´Ä°´Ä°Äܤ(M±À ÄÀÀÀ¤(MÁ±Í¡= ¤)¹%oÝ÷ Ù«­¢+ÙÕ¹áÕÑ ¤(%ÀÌØí
ÕÉ%¹àô}U%
Ñɱ1¥ÍÑY¥Ý}ÑM±Ñ%¹¥Ì ÀÌØí1¥ÍÑY¥Ý%±ÑÉÕ¤ôÀQ¡¸(5Í  ½à ÐÀäØ°ÅÕ½ÐìÅÕ½Ðì°ÅÕ½Ðíe½ÔµÕÍÐͱÐÍÍÍ¥½¸É½´Ñ¡±¥ÍÐÅÕ½Ðì¤)±Í(M¡±±áÕÑ ÅÕ½Ðí!=MQ`ÌȹaÅÕ½Ðì°ÅÕ½ÐìÅÕ½ÐìµÀì}U%
Ñɱ1¥ÍÑY¥Ý}Ñ%ѵQáÐ ÀÌØí1¥ÍÑY¥Ý%°ÀÌØí
ÕÉ%¹álÅt°Ä¤°Aɽɵ¥±Í¥ÈµÀìÅÕ½ÐìÀäÈí!Õµµ¥¹¥ÉÀäÈí
½¹¹Ñ¥Ù¥ÑäÀäÈìÄÀ¸ÀÀÀäÈí!½ÍÑáÁ±½ÉÈÅÕ½Ðì°ÅÕ½ÐìÅÕ½Ðì¤(MÁ±Í¡QáÑ=¸ ÅÕ½ÐíA±ÍMѹäÅÕ½Ðì°ÅÕ½Ðí1Õ¹¡¥¹èÅÕ½ÐìµÀì
I1µÀì}U%
Ñɱ1¥ÍÑY¥Ý}Ñ%ѵQáÐ ÀÌØí1¥ÍÑY¥Ý%°ÀÌØí
ÕÉ%¹álÅt°À¤°ÌÀÀ°ÜÔ°´Ä°´Ä°Äܤ(M±À ÄÀÀÀ¤(MÁ±Í¡= ¤)¹%oÝ÷ Ù«­¢+ÙÕ¹áÕÑ ¤(%ÀÌØí
ÕÉ%¹àô}U%
Ñɱ1¥ÍÑY¥Ý}ÑM±Ñ%¹¥Ì ÀÌØí1¥ÍÑY¥Ý%±ÑÉÕ¤ôÀQ¡¸(5Í  ½à ÐÀäØ°ÅÕ½ÐìÅÕ½Ðì°ÅÕ½Ðíe½ÔµÕÍÐͱÐÍÍÍ¥½¸É½´Ñ¡±¥ÍÐÅÕ½Ðì¤)±Í(M¡±±áÕÑ ÅÕ½Ðí!=MQ`ÌȹaÅÕ½Ðì°ÅÕ½ÐìÅÕ½ÐìµÀì}U%
Ñɱ1¥ÍÑY¥Ý}Ñ%ѵQáÐ ÀÌØí1¥ÍÑY¥Ý%°ÀÌØí
ÕÉ%¹álÅt°Ä¤°Aɽɵ¥±Í¥ÈµÀìÅÕ½ÐìÀäÈí!Õµµ¥¹¥ÉÀäÈí
½¹¹Ñ¥Ù¥ÑäÀäÈìÄÀ¸ÀÀÀäÈí!½ÍÑáÁ±½ÉÈÅÕ½Ðì°ÅÕ½ÐìÅÕ½Ðì¤(MÁ±Í¡QáÑ=¸ ÅÕ½ÐíA±ÍMѹäÅÕ½Ðì°ÅÕ½Ðí1Õ¹¡¥¹èÅÕ½ÐìµÀì
I1µÀì}U%
Ñɱ1¥ÍÑY¥Ý}Ñ%ѵQáÐ ÀÌØí1¥ÍÑY¥Ý%°ÀÌØí
ÕÉ%¹álÅt°À¤°ÌÀÀ°ÜÔ°´Ä°´Ä°Äܤ(M±À ÄÀÀÀ¤(MÁ±Í¡= ¤)¹%
Edited by gesller

Share this post


Link to post
Share on other sites
GaryFrost

Try:

Func execute()
 $CurIndex = _GUICtrlListView_GetSelectedIndices($ListViewID,true)
 If $CurIndex[0] = 0 Then
  MsgBox(0, "Error", "You must select a session from the list" )
  Return
 EndIf
 ShellExecute("HOSTEX32.EXE", " " & _GUICtrlListView_GetItemText($ListViewID, $CurIndex[1], 1), @ProgramFilesDir & "\Hummingbird\Connectivity\10.00\HostExplorer", "")
 SplashTextOn( "Please Stand by", "Launching: "  & @CRLF & _GUICtrlListView_GetItemText($ListViewID, $CurIndex[1], 0), 300, 75, -1, -1,17 )
 Sleep(1000)
 SplashOff()
EndIf

SciTE for AutoItDirections for Submitting Standard UDFs

 

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

 

Share this post


Link to post
Share on other sites
gseller

Gary That works Great! Can't tell you how grateful I am. I have Been pulling my hair out over this and I think I finally have it converter from the new syntax. Thanks Again..

Share this post


Link to post
Share on other sites
Thatsgreat2345

Func execute() ummmmm I may be mistaken but I thought you could not use current command names as functions ?

Share this post


Link to post
Share on other sites
gseller

My apologies.. Just a fictitious name as the other contained proprietary info for my job.. LOL Good eye tho!

Thanks again all.. :D

Share this post


Link to post
Share on other sites
Thatsgreat2345

My apologies.. Just a fictitious name as the other contained proprietary info for my job.. LOL Good eye tho!

Thanks again all.. :D

:P gotcha just making sure you don't run into any problems. Good luck with your program.

Share this post


Link to post
Share on other sites
gseller

Sweet, nice to have all the help here when one hits a snag.

Share this post


Link to post
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
Sign in to follow this  

×