AutoHotkey Community

It is currently May 27th, 2012, 3:11 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 6 posts ] 
Author Message
 Post subject: %A_ThisMenuItem%
PostPosted: September 28th, 2005, 4:41 pm 
Offline

Joined: February 14th, 2005, 10:54 am
Posts: 447
Location: Texas, Usa
Code:
SplitPath, A_ThisMenuItem, OutFileName, Outdir, outextention, Filename, outdrive
MsgBox %A_ThisMenuItem%

Gosub, FillListBox
;Set and change window Title
WindowTitle = %ProgTitle% - [%A_ThisMenuItem%]
WinSetTitle, %ProgTitle%,, %WindowTitle%
Return


There is some pretty interesting behavior here. The menu that this is run from is built dynamically and currently has a bug, that is it adds the first item as 'ERROR' becuase its reading it from an ini, and I know there is nothing there for it to find(not a biggie). When a new file is opened from the open menu item, its file path is added to this menu, the one that runs the above. When its closed, its removed.

But here is the issue, when this label is executed from the menu item 'Error' the msgbox comes up with the expected result of 'error' and the wintitle changes, and all is well; However, when a file name is picked from that menu, the msgbox doesnt appear and the windows title is unchanged, But the Gosub label IS executed. Whats up with this? Please have a look.

_________________
my lame sig :)


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 28th, 2005, 4:57 pm 
Offline

Joined: March 2nd, 2004, 3:36 pm
Posts: 10720
Assuming you're running 1.0.38.04, this may have been fixed in newer versions. If that's not it, I could use a short test script to reproduce the issue.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 28th, 2005, 5:55 pm 
Offline

Joined: February 14th, 2005, 10:54 am
Posts: 447
Location: Texas, Usa
I was using 1.0.38.3 and downloaded the lastest and this is still the case.

I produced the following with out sucess of a reproduction, but this is damn close to what I do. :cry: And with futher testing the ListLines doesnt even show the Msgbox to executed or the two lines used to change the windowtitle, OR the splitpath
Code:

List = ERROR|%A_ScriptFullPath%

Menu, MenuSub, Add, TempItem, ChangeFile

Menu, MenuBar, Add, Window, :MenuSub

Menu, MenuSub, Delete, TempItem

Loop, Parse, List, |
   Menu, MenuSub, Add, %A_LoopField%, ChangeFile
   
Gui, Menu, MenuBar
Gui, Show, w100 h100, HelloWorld
Return

ChangeFile:
MsgBox, %A_ThisMenuItem%
GoSub, Here
Return

Here:
MsgBox, You've made it here
Return
 

_________________
my lame sig :)


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 28th, 2005, 8:54 pm 
Offline

Joined: March 2nd, 2004, 3:36 pm
Posts: 10720
If you can ever reproduce this please let me know. Lately, I'm trying to avoid chasing irreproducible bugs because it causes me to get further behind schedule on other improvements I want to make.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 3rd, 2005, 5:06 pm 
Offline

Joined: February 14th, 2005, 10:54 am
Posts: 447
Location: Texas, Usa
good thing you didnt chase this 'bug', the error, was on my part. When creating the dynamic menu, I was adding the wrong gosub(the gosub used in the routine, which caused my to think there was a bug). Thank you for your efforts anyway.

_________________
my lame sig :)


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 3rd, 2005, 8:59 pm 
Offline

Joined: March 2nd, 2004, 3:36 pm
Posts: 10720
Thanks for the follow-up. It definitely helps my peace of mind.


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 3 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group