egalvez Posted September 1, 2005 Posted September 1, 2005 (edited) Hello. I'm having trouble with a menu item that should allow the user to make the GUI window always on top. Here are my relevant code snippets. What am I doing wrong, please?$mcGui = GuiCreate("Verse Quizzer - Multiple Choice", 480, 340,-1,-1,-1,-1) .... $MenuOptionsAlwaysOnTopItem = GUICtrlCreateMenuitem ("&Always on Top",$MenuOptions) GUICtrlSetOnEvent($MenuOptionsAlwaysOnTopItem, "MenuOptionsAlwaysOnTopClicked") .... Func MenuOptionsAlwaysOnTopClicked() If IniRead ( "config.txt", "Settings", "AlwaysOnTop", "NotFound" ) = "1" Then;ALWAYSONTOP IS ON, LET'S TURN IT OFF GUICtrlSetState($MenuOptionsAlwaysOnTopItem,$GUI_UNCHECKED) IniWrite ( "config.txt", "Settings", "AlwaysOnTop", "0" ) Else;ALWAYSONTOP IS OFF, LET'S TURN IT ON GUICtrlSetState($MenuOptionsAlwaysOnTopItem,$GUI_CHECKED) IniWrite ( "config.txt", "Settings", "AlwaysOnTop", "1" ) GUICtrlSetStyle ( $mcGui,$WS_EX_TOPMOST ) GUISetState () EndIf EndFuncI'm obviously doing something wrong. I did search the forums on $WS_EX_TOPMOST but still don't know how to resolve this. Please advise.By the way, I'm using Opt("GUIOnEventMode", 1) Edited September 1, 2005 by egalvez
AutoChris Posted September 1, 2005 Posted September 1, 2005 Hello. I'm having trouble with a menu item that should allow the user to make the GUI window always on top. Here are my relevant code snippets. What am I doing wrong, please?$mcGui = GuiCreate("Verse Quizzer - Multiple Choice", 480, 340,-1,-1,-1,-1)$mcGui = GuiCreate("Verse Quizzer - Multiple Choice", 480, 340, -1, -1, "", $WS_EX_TOPMOST)
egalvez Posted September 1, 2005 Author Posted September 1, 2005 Thank you, but if I'm not mistaken, your code will make the dialog topmost from its inception. I only want the dialog to be topmost when the user clicks an Always On Top menuitem. I want to be able to change the topmost setting on the fly, depending on whether or not the Always on Top menuitem has a checkmark next to it or not. Forgive me, please, if I'm missing something with your code.
AutoChris Posted September 1, 2005 Posted September 1, 2005 My apologies. I misunderstood what you were looking for.In that case, just create a button that will use the WinSetOnTop() function for your GUI window. If you aren't sure how to create buttons and call them from within a GUIGetMsg() loop then let me know and I will post an example. (Busy at work just now)
egalvez Posted September 1, 2005 Author Posted September 1, 2005 Thank you, SerialKiller. That works well with the menuitem.
Orochimaru Posted September 1, 2005 Posted September 1, 2005 Thank you, SerialKiller. That works well with the menuitem. <{POST_SNAPBACK}>Hey everyone, darn im soo tired i've been trying to find out how to make a dialog box by pressing a shortcutkey. After the dialog has poped up i wanted to type somthing and then click ok and then make it Sleep(3000) after that open notepad and make it Send w/e i typed. But ofcourse i havnt got to do that, thats why im here for help.I did that with a INput box here is the code:HotKeySet("{F5}", "Type")HotKeySet("{F8}", "Pause")HotKeySet("{F9}", "Quit")While 1Sleep(100)WendFunc Type()While 1$clip1 = InputBox("Message", "Enter/Paste text to Spam", "" )Run("C:\Program Files\Starcraft\Starcraft.exe")Sleep(700)$i=0DoSend("{Enter}")Send("" & $clip1)Send("{Enter}")until $i=10wendEndFuncFunc Quit()While 1Exit 0WendEndfuncFunc Pause()While1WendEndfuncBasically all that does is when i press F5 a inputbox pops up and what ever i type in it. Gets send to w/e window im on after its sleep time.So i wanted to do that with a Dialog box because i wanted to Send Profiles that are more then 1 line at once.This is what i have so far but it seems to make no sense what so ever:dim $clip1HotKeySet("{F7}", "Type")HotKeySet("{F9}", "Pause")Func Pause()While 1WendEndfuncfunc type()while 1$clip1 = Dialog BoxSleep(700)$i=0DoSend("{Enter}")Send("" & $clip1)Send("{Enter}")until $i=10wendEndFuncGUICreate("Type What You Want To Spam Below") ; will create a dialog box that when displayed is centeredGUISetState (@SW_SHOW) ; will display an empty dialog box$GUI_EVENT_CLOSE = "1"$nEdit = GUICtrlCreateEdit ("Type Here", 3,3,300,180)GUICtrlCreateButton ("Ok", 20,200,50)GUISetState ()for $n=1 to 5GUICtrlSetData ($nEdit,@CRLF & "line "& $n)next$EM_LINEINDEX = 0x00BB$EM_LINEFROMCHAR = 0x00C9Do$msg = GUIGetMsg()if $msg >0 then$n=GUICtrlSendMsg ($nEdit, $EM_LINEINDEX,-1,0)$nline=GUICtrlSendMsg( $nEdit, $EM_LINEFROMCHAR,$n,0)GUICtrlSetState ($nEdit,256) ; set focusMsgBox (0,"Currentline",$nLine)EndifUntil $msg = $GUI_EVENT_CLOSEAll this does is when i run it a Dialog box pops up right away and then when i press F7 it types random words or numbers...Also i didnt include#include gui.........au3.because it says "Error reading #include gui.........au3."Can anyone please look at these sources and see if they can help me, i really need it thank you for reading.
AutoChris Posted September 1, 2005 Posted September 1, 2005 (edited) "Enter text to spam"?! Nice.First of all, it is #include <GuiConstants.au3>, and your script will not run without it. Second, it is very hard to read your code since you did not put it in the code tags: here is my codeI would help, but I do not really have the time to go through all of your messy code at the moment. Perhaps someone else is willing to take more time, or else you could clean it up a bit and re-post it. Edited September 1, 2005 by SerialKiller
Valuater Posted September 1, 2005 Posted September 1, 2005 "Enter text to spam"?! Nice.<{POST_SNAPBACK}>I would'nt have helped a spammer either, however i saw this in the scriptRun("C:\Program Files\Starcraft\Starcraft.exe")and i wrote a script in his thread. but he should not post here also8)
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now