AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Gui,Submit problem

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
adamrgolf



Joined: 28 Dec 2006
Posts: 386

PostPosted: Wed Jul 02, 2008 8:49 am    Post subject: Gui,Submit problem Reply with quote

I'm having a problem here... I don't know what I'm doing wrong. Can someone check out the code below and tell me why it doesn't function properly.

When it starts up, the msgbox will show you the value of the edit control. but then when you hover over the control the WM_MOUSEMOVE seems to not grab the contents of the edit box... what do you think:

Code:
#SingleInstance,Force
OnExit,GuiClose

Gui,Add,Edit,vcurious,%A_Now%
curious_TT :=

Gui,Show
OnMessage(0x200, "WM_MOUSEMOVE")

Gui,Submit,NoHide
msgbox % curious

Return

WM_MOUSEMOVE()
   {
      Gui,Submit,NoHide
      static CurrControl, PrevControl, _TT  ; _TT is kept blank for use by the ToolTip command below.
      CurrControl := A_GuiControl
      If (CurrControl <> PrevControl and not InStr(CurrControl, " "))
         {
           displaytext := %CurrControl%_TT
            IfInString,CurrControl,curious
               {
                  FormatTime,readableTime,%curious%,dddd MMMM d, hh:mm:ss tt
                  displaytext = Call Time: %readableTime%
                  Tooltip %displaytext%`nbecause: '%curious%' is blank!
               }
            SB_SetText(displaytext)
           PrevControl := CurrControl
         }
      Return
   }

GuiClose:
   ExitApp
Back to top
View user's profile Send private message
tonne



Joined: 06 Jun 2006
Posts: 1190
Location: Denmark

PostPosted: Wed Jul 02, 2008 9:24 am    Post subject: Reply with quote

Code:
...
      Gui,Submit,NoHide
      global curious
      static CurrControl, PrevControl, _TT  ; _TT is kept blank for use by the ToolTip command below.
...

_________________
there's a dog barking close within the range of my ear
sounds like he wants to escape the chain
he would probably bite me to death if he could
but the chain lets me spit in his face

- Kashmir
Back to top
View user's profile Send private message
adamrgolf



Joined: 28 Dec 2006
Posts: 386

PostPosted: Wed Jul 02, 2008 9:27 am    Post subject: Reply with quote

tonne wrote:
Code:
...
      Gui,Submit,NoHide
      global curious
      static CurrControl, PrevControl, _TT  ; _TT is kept blank for use by the ToolTip command below.
...


wow that works, but can you explain why?
Back to top
View user's profile Send private message
tonne



Joined: 06 Jun 2006
Posts: 1190
Location: Denmark

PostPosted: Wed Jul 02, 2008 9:59 am    Post subject: Reply with quote

The
Code:
Gui,Add,Edit,vcurious,%A_Now%
adds a global variable named curious,
Quote:
To refer to an existing global variable inside a function (or create a new one), declare the variable as global prior to using it.

_________________
there's a dog barking close within the range of my ear
sounds like he wants to escape the chain
he would probably bite me to death if he could
but the chain lets me spit in his face

- Kashmir
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group