Vindicator209 Posted September 9, 2006 Posted September 9, 2006 err... sorry.. in a rush, homework..due..tomorrow... how do i make a GUI stay on top? ive tried putting: Winactivate("My Gui" in the while loop but it makes everything go crazy... ahhh please help me! is there like some kind of directory i can use??? [center]"When you look at old, classic games like Snake, you often put it off because it's such a simple game, but it's only when you actually try and create your own unique game from scratch, do you finally appreciate those games."[/center][center]Don't ask for answers if you haven't TRIED yet![/center][center]Most answers can be answered in the help file! Use it![/center]
Moderators SmOke_N Posted September 9, 2006 Moderators Posted September 9, 2006 err... sorry.. in a rush, homework..due..tomorrow...how do i make a GUI stay on top? ive tried putting:Winactivate("My Gui"in the while loop but it makes everything go crazy... ahhh please help me! is there like some kind of directory i can use???Well, while you were in the help file... did you bother to look a bit further down for "OnTop" ... specifically WinSetOnTop? Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.
Vindicator209 Posted September 9, 2006 Author Posted September 9, 2006 uhm..err..yea..be right back..... [center]"When you look at old, classic games like Snake, you often put it off because it's such a simple game, but it's only when you actually try and create your own unique game from scratch, do you finally appreciate those games."[/center][center]Don't ask for answers if you haven't TRIED yet![/center][center]Most answers can be answered in the help file! Use it![/center]
Paulie Posted September 9, 2006 Posted September 9, 2006 Well, while you were in the help file... did you bother to look a bit further down for "OnTop" ... specifically WinSetOnTop?What about $WS_EX_TOPMOST As the extended property of your GUI?
Zedna Posted September 9, 2006 Posted September 9, 2006 If you wish to change stay on top atribute while running try this:Global Const $HWND_TOPMOST = -1 Global Const $HWND_NOTOPMOST = -2 Global Const $SWP_NOMOVE = 0x0002 Global Const $SWP_NOSIZE = 0x0001 $Form1 = GUICreate(...) SetWindowPos($Form1, $HWND_TOPMOST, 0, 0, 0, 0, BitOR($SWP_NOMOVE,$SWP_NOSIZE)) SetWindowPos($Form1, $HWND_NOTOPMOST, 0, 0, 0, 0, BitOR($SWP_NOMOVE,$SWP_NOSIZE)) Func SetWindowPos($hwnd, $InsertHwnd, $X, $Y, $cX, $cY, $uFlags) $ret = DllCall("user32.dll", "long", "SetWindowPos", "hwnd", $hwnd, "hwnd", $InsertHwnd, _ "int", $X, "int", $Y, "int", $cX, "int", $cY, "long", $uFlags) Return $ret[0] EndFunc Resources UDF ResourcesEx UDF AutoIt Forum Search
Riz Posted September 15, 2006 Posted September 15, 2006 Hi mate, I have tried this code it deosn't work for me. I don't know why? I'm looking for that script for long time I mean GUI always on the top. #include <GuiConstants.au3> Global Const $HWND_TOPMOST = -1 Global Const $HWND_NOTOPMOST = -2 Global Const $SWP_NOMOVE = 0x0002 Global Const $SWP_NOSIZE = 0x0001 $Form1 =GuiCreate("MyGUI", 702, 316,120, 180 ) SetWindowPos($Form1, $HWND_TOPMOST, 0, 0, 0, 0, BitOR($SWP_NOMOVE,$SWP_NOSIZE)) SetWindowPos($Form1, $HWND_NOTOPMOST, 0, 0, 0, 0, BitOR($SWP_NOMOVE,$SWP_NOSIZE)) $Button_1 = GuiCtrlCreateButton("Button1", 30, 80, 100, 50) $Input_2 = GuiCtrlCreateInput("Input2", 190, 80, 120, 60) $Date_3 = GuiCtrlCreateDate("Date3", 420, 50, 260, 80) GuiSetState() While 1 $msg = GuiGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case Else ;;; EndSelect WEnd Exit Func SetWindowPos($hwnd, $InsertHwnd, $X, $Y, $cX, $cY, $uFlags) $ret = DllCall("user32.dll", "long", "SetWindowPos", "hwnd", $hwnd, "hwnd", $InsertHwnd, _ "int", $X, "int", $Y, "int", $cX, "int", $cY, "long", $uFlags) Return $ret[0]EndFunc
Zedna Posted September 15, 2006 Posted September 15, 2006 Hi mate, I have tried this code it deosn't work for me. I don't know why? I'm looking for that script for long time I mean GUI always on the top. Hey man!! You must call these functions: SetWindowPos($Form1, $HWND_TOPMOST, 0, 0, 0, 0, BitOR($SWP_NOMOVE,$SWP_NOSIZE)) SetWindowPos($Form1, $HWND_NOTOPMOST, 0, 0, 0, 0, BitOR($SWP_NOMOVE,$SWP_NOSIZE)) from some buttons or menu items, first or second one. My code was only code snippet! If you don't understand this then it's not for you. Resources UDF ResourcesEx UDF AutoIt Forum Search
Riz Posted September 15, 2006 Posted September 15, 2006 Hey man!! You must call these functions: SetWindowPos($Form1, $HWND_TOPMOST, 0, 0, 0, 0, BitOR($SWP_NOMOVE,$SWP_NOSIZE)) SetWindowPos($Form1, $HWND_NOTOPMOST, 0, 0, 0, 0, BitOR($SWP_NOMOVE,$SWP_NOSIZE)) from some buttons or menu items, first or second one. My code was only code snippet! If you don't understand this then it's not for you. Ahhhha I got it now sorry about that. I was stupid, sorry agian
Richard Robertson Posted September 15, 2006 Posted September 15, 2006 Homework? How is AutoIt part of homework?
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