 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
adamrgolf
Joined: 28 Dec 2006 Posts: 390
|
Posted: Wed Jul 02, 2008 7:49 am Post subject: Gui,Submit problem |
|
|
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 |
|
 |
tonne
Joined: 06 Jun 2006 Posts: 1249 Location: Denmark
|
Posted: Wed Jul 02, 2008 8:24 am Post subject: |
|
|
| 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 |
|
 |
adamrgolf
Joined: 28 Dec 2006 Posts: 390
|
Posted: Wed Jul 02, 2008 8:27 am Post subject: |
|
|
| 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 |
|
 |
tonne
Joined: 06 Jun 2006 Posts: 1249 Location: Denmark
|
Posted: Wed Jul 02, 2008 8:59 am Post subject: |
|
|
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 |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|