| View previous topic :: View next topic |
| Author |
Message |
DeathByNukes
Joined: 25 Mar 2007 Posts: 14 Location: Mabase
|
Posted: Sun Apr 08, 2007 10:59 am Post subject: Scrolling with PostMessage won't work in a function |
|
|
I made a function to add text to an edit box and scroll it to the bottom but for some reason it doesn't scroll.
| Code: | echo( text )
{
GuiControlGet, ConText,, Console
GuiControl,, Console, %ConText%%text%
PostMessage, 0x115, 7,,, ahk_id %ConsoleHWND% ; WM_VSCROLL = 0x115 , SB_BOTTOM = 7
} |
If I copy the PostMessage and place it after calling the function then it works. Is this a bug or did I miss something about functions? |
|
| Back to top |
|
 |
PhiLho
Joined: 27 Dec 2005 Posts: 6721 Location: France (near Paris)
|
Posted: Sun Apr 08, 2007 12:49 pm Post subject: |
|
|
Your variables seems to be global.
Either pass them as parameters, or use the global keyboard on start of the function body. _________________
vPhiLho := RegExReplace("Philippe Lhoste", "^(\w{3})\w*\s+\b(\w{3})\w*$", "$1$2") |
|
| Back to top |
|
 |
DeathByNukes
Joined: 25 Mar 2007 Posts: 14 Location: Mabase
|
Posted: Sun Apr 08, 2007 6:35 pm Post subject: doh! |
|
|
| Heh, I didn't know functions couldn't normally get global variables. Thanks! |
|
| Back to top |
|
 |
|