#1
|
|||
|
|||
Quick AHK Question for the experts
I'm trying to make a script to display the AvgPot size from the lobby somewhere on the table itself.
I checked out Roland's code from miniLobby to get the pot size, but what should I use to display it onto the table? Is there some AHK function to display text, thats not on a button? I suppose I could use ControlSetText on one of the buttons, but there's gotta be a better way. Is it possible to change the text of the title bar? Edit: Also, is this how I should ask questions like this? Edit: OK I found WinSetTitle. Will this mess with PP's execution in any way? Do you guys have any idea for a better way to display the info? |
#2
|
|||
|
|||
Re: Quick AHK Question for the experts
Alright - I have the code to get the avg pot for a table. Now I just need a way to display it. I tried using WinSetTitle and it doesn't seem to work. Maybe PP is resetting the table name, but if I use WinSetTitle and then immediately use WinGetTitle, I get the original name.
|
#3
|
|||
|
|||
Re: Quick AHK Question for the experts
In lack of a method to draw directly on the window with AHK (like PA HUd does), I throw up a GUI window with the text. Here are some code snippets from TN.
Gui, %guiNum%: +alwaysontop +Lastfound +Owner Gui, %guiNum%: Color, ffffff Gui, %guiNum%: Font, S9 Bold, Verdana Gui, %guiNum%: -Caption Gui, %guiNum%: Add, Text, x8 y2 w95 , POT_AVERAGE Gui, %guiNum%: Show, w100 h20 x%x% y%y% NoActivate You need to manage a different gui for every table, and have a timer check if the gui should be shown or not. See my AutoSit code in TN for more. Adde |
#4
|
|||
|
|||
Re: Quick AHK Question for the experts
OK - great. Thanks Adde. I should have this script done sometime soon.
|
#5
|
|||
|
|||
Re: Quick AHK Question for the experts
This script is all but done, except for one minor thing:
Is there a way to have the gui be only on top of a specific table? Using +alwaysontop makes it so that if something overlaps the table, the gui will display on top. That's a slight annoyance (though, it works correctly when the table gets minimized). |
#6
|
|||
|
|||
Re: Quick AHK Question for the experts
[ QUOTE ]
In lack of a method to draw directly on the window with AHK (like PA HUd does), I throw up a GUI window with the text. Here are some code snippets from TN. [/ QUOTE ] I think this might be possible using DllCall and the SetParent() function. Mogobu tried this (even though SetParent isn't meant to be used on other processes' windows) and it seems to work fine. Juk [img]/images/graemlins/smile.gif[/img] |
#7
|
|||
|
|||
Re: Quick AHK Question for the experts
[ QUOTE ]
I think this might be possible using DllCall and the SetParent() function. Mogobu tried this (even though SetParent isn't meant to be used on other processes' windows) and it seems to work fine. Juk [img]/images/graemlins/smile.gif[/img] [/ QUOTE ] Where is this code? |
#8
|
|||
|
|||
Re: Quick AHK Question for the experts
http://www.autohotkey.com/docs/commands/DllCall.htm
http://msdn.microsoft.com/library/defaul...s/setparent.asp The bit that says: "The new parent window and the child window must belong to the same application." may cause problems as your not really supposed to do this, but Mogobu did test this and found it worked ok for Party. |
#9
|
|||
|
|||
Re: Quick AHK Question for the experts
Sorry, I meant where is Mogobu's code that does that? It isn't really clear to me how it'd work.
|
|
|