AutoHotkey Community

It is currently May 27th, 2012, 5:13 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: December 15th, 2005, 11:07 pm 
Offline

Joined: July 12th, 2005, 1:21 pm
Posts: 633
I have a strange bug in my application! (Hehe, this is why I am in the Bug Forum.. ^^)

In this mini-gui I open a second gui via button.
On the second button is also only one button. If I press him I would like to see a text and the contents of a variable which is empty (in my original application this can be caused by empty control-contents).
Normally this shouldn't be any problem, but the OnMessage-Function "Tooltipp" influences this handling!

So if I press the little button at the second gui the text is not displayed and instead I see only the name of the Button in it!!!

Code:
Gui, Add, Button, x320 y180 w80 h30 section gTier_Suche, Suche...
Gui, Show, x600 ycenter, Tiere

Process, Exist
PID := ErrorLevel
WinGet, hw_gui, ID, ahk_class AutoHotkeyGUI ahk_pid %PID%

WM_MOUSEMOVE = 0x200
OnMessage(WM_MOUSEMOVE, "Tooltipp")
return

Tier_Suche:
Gui, 2: Add, Button, xs+0 gTier_nach_Kriterien_suchen vTier_nach_Kriterien_suchen Default section, Suche...
Gui, 2: Show, w50 h50, Test
return

Tier_nach_Kriterien_suchen:
msgbox, What happens here? %i%
return

GuiClose:
ExitApp

Tooltipp(WPARAM , LPARAM , Message, HWND)
{
   global   WM_MOUSEMOVE
   
   if (Message = WM_MOUSEMOVE)
   {
      if A_GuiControl = Tier_MR      ;If I remove this line I get "1" in the messagebox!
      {
               ;Doesn't matter if here are any commands
        }
   }

}



If I comment out the whole OnMessage-Part it works fine. For testing you can replace the tooltipp-function by this:

Quote:
Tooltipp(WPARAM , LPARAM , Message, HWND)
{
global WM_MOUSEMOVE

}


If I just remove a part of the function the result in the messagebox is always "1":

Code:
Tooltipp(WPARAM , LPARAM , Message, HWND)
{
   global   WM_MOUSEMOVE
   
   if (Message = WM_MOUSEMOVE)
   {

   }

}
If anyone knows what happens, please tell me ;)

Thx!
Thalon

_________________
AHK-Icon-Changer
AHK-IRC
deutsches Forum


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 16th, 2005, 9:59 am 
Offline

Joined: February 7th, 2005, 11:11 am
Posts: 192
Location: Munich, Germany
Hi Thalon!
If I try this:
Code:
...
Tooltipp(WPARAM , LPARAM , Message, HWND)
{
   global   WM_MOUSEMOVE
   ToolTip
   if (Message = WM_MOUSEMOVE)
   {
      if (A_GuiControl = Tier_MR)      ;If I remove this line I get "1" in the messagebox!
      {
               ToolTip, Hallo
        }
   }
   
}

I'll get always a "Hallo" until I'm touching the "Search"-Button. After pressing this button the game continous within the second window. So the message is inactive if you press the button, and therefore you get no result. :?

If you want to have a ToolTip along with the button use this:
Code:
...
Tooltipp(WPARAM , LPARAM , Message, HWND)
{
   global   WM_MOUSEMOVE
   MouseGetPos,,,WinName,ControlName
   if (ControlName = "Button1")
       ToolTip, %WinName% Press here to continue... ; "WinName" ist just to show that you can decide between windows also
   else
        ToolTip
}

_________________
Peter

Wisenheiming for beginners: KaPeGe (German only, sorry)


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 16th, 2005, 12:28 pm 
Offline

Joined: July 12th, 2005, 1:21 pm
Posts: 633
It is very strange!
At my pc at work my original script of first post works as expected...

I will test it another time at home, maybe with a different ahk-version...

@kapege.de
The Tooltip-code itself was already working correct, the only thing is it influenced the displayed Text in my msgbox when pressing button in Gui 2.
Instead of "What happens here" "Tier_nach_Kriterien_suchen" is displayed and this is the name of my Button in Gui2.

Maybe you also do not have this problem, so thx for your code, also if it wasn't my problem...

I feel very confused at the moment, because same code works with same version at work, but not at home...

Thalon

Edit:
I am not shure why it worked after an version-update at home, because there were no bugs solved, but it works now, with no changes...

Thalon

_________________
AHK-Icon-Changer
AHK-IRC
deutsches Forum


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

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 2 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