GodlessSinner Posted August 15, 2009 Posted August 15, 2009 #include <WinAPI.au3> #include <WindowsConstants.au3> #include <StaticConstants.au3> #include <GUIConstantsEx.au3> $Form = GUICreate("Main window", 260, 99, 542, 678, BitOR($WS_POPUP,$WS_BORDER)) Opt("TrayMenuMode",1) $open = TrayCreateItem("About") TrayCreateItem("") $exititem = TrayCreateItem("Exit") GUISetState(@SW_SHOW) $Form1 = GUICreate("About", 240, 127, 500, 500, BitOR($WS_SYSMENU,$WS_CAPTION,$WS_POPUP,$WS_POPUPWINDOW,$WS_BORDER,$WS_CLIPSIBLINGS)) While 1 $nMsg = GUIGetMsg(1) $tray = TrayGetMsg() Switch $tray Case $exititem Exit Case $open GUISetState(@SW_SHOW,$Form1) WinSetOnTop ($Form, "", 0) EndSwitch Select Case $nMsg[0] = $GUI_EVENT_CLOSE If $nMsg[1] = $Form1 Then GUISetState(@SW_HIDE, $Form1) ElseIf $nMsg[1] = $Form Then Exit EndIf Case $GUI_EVENT_PRIMARYDOWN _SendMessage($Form, $WM_SYSCOMMAND, 0xF012, 0) EndSelect WEnd Why "About" window can't be active? And how to prevent from clicking in main window when "About" is shown? thanks. _____________________________________________________________________________
Moderators Melba23 Posted August 15, 2009 Moderators Posted August 15, 2009 (edited) Godless,Your SendMessage is constantly reactivating the main window. Try testing to see if the "About" window is active before sending. As to preventing clicking in the main window, just Disable/Enable it when the "About" window shows:expandcollapse popup#include <WinAPI.au3> #include <WindowsConstants.au3> #include <StaticConstants.au3> #include <GUIConstantsEx.au3> Opt("TrayMenuMode", 1) $open = TrayCreateItem("About") TrayCreateItem("") $exititem = TrayCreateItem("Exit") $Form = GUICreate("Main window", 260, 99, 542, 678, BitOR($WS_POPUP, $WS_BORDER)) GUISetState(@SW_SHOW) $Form1 = GUICreate("About", 240, 127, 500, 500, BitOR($WS_SYSMENU, $WS_CAPTION, $WS_POPUP, $WS_POPUPWINDOW, $WS_BORDER, $WS_CLIPSIBLINGS)) GUISetState(@SW_HIDE) While 1 $tray = TrayGetMsg() Switch $tray Case $exititem Exit Case $open GUISetState(@SW_SHOW, $Form1) WinSetOnTop($Form, "", 0) GUISetState(@SW_DISABLE, $Form) EndSwitch $nMsg = GUIGetMsg(1) Select Case $nMsg[0] = $GUI_EVENT_CLOSE If $nMsg[1] = $Form1 Then GUISetState(@SW_HIDE, $Form1) GUISetState(@SW_ENABLE, $Form) ElseIf $nMsg[1] = $Form Then Exit EndIf Case $GUI_EVENT_PRIMARYDOWN If BitAND(WinGetState($Form1), 2) <> 2 Then _SendMessage($Form, $WM_SYSCOMMAND, 0xF012, 0) EndSelect WEndM23Edit: Speeling Edited August 15, 2009 by Melba23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area
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