Then MrCreatoR pointed out it could be done via a different approach, so I updated using his way
Examples below are for both re-sizing and non re-sizing as well as 2 Examples that don't appear in the TaskBar, this is due to using the hidden window [AutoItWinGetTitle()] as the parent handle.
Any suggestions, then please post below. Thanks.
Examples:
#include <GUIConstantsEx.au3> #include <WindowsConstants.au3> Example1() ; Without Re-Sizing. Example2() ; With Re-Sizing. Example3() ; Without Re-Sizing & No TaskBar. Example4() ; With Re-Sizing & No TaskBar. Func Example1() ; Without Re-Sizing. Local $hGUI = GUICreate('GUI With Only Close', 250, 250, -1, -1, BitXOR($GUI_SS_DEFAULT_GUI, $WS_MINIMIZEBOX)) GUISetState(@SW_SHOW, $hGUI) While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop EndSwitch WEnd GUIDelete($hGUI) EndFunc ;==>Example1 Func Example2() ; With Re-Sizing. Local $hGUI = GUICreate('GUI With Only Close', 250, 250, -1, -1, BitXOR($GUI_SS_DEFAULT_GUI, $WS_SIZEBOX, $WS_MINIMIZEBOX)) GUISetState(@SW_SHOW, $hGUI) While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop EndSwitch WEnd GUIDelete($hGUI) EndFunc ;==>Example2 Func Example3() ; Without Re-Sizing & No TaskBar. Local $hGUI = GUICreate('GUI With Only Close', 250, 250, -1, -1, BitXOR($GUI_SS_DEFAULT_GUI, $WS_MINIMIZEBOX), -1, WinGetHandle(AutoItWinGetTitle())) GUISetState(@SW_SHOW, $hGUI) While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop EndSwitch WEnd GUIDelete($hGUI) EndFunc ;==>Example3 Func Example4() ; With Re-Sizing & No TaskBar. Local $hGUI = GUICreate('GUI With Only Close', 250, 250, -1, -1, BitXOR($GUI_SS_DEFAULT_GUI, $WS_SIZEBOX, $WS_MINIMIZEBOX), -1, WinGetHandle(AutoItWinGetTitle())) GUISetState(@SW_SHOW, $hGUI) While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop EndSwitch WEnd GUIDelete($hGUI) EndFunc ;==>Example4
Old way I was doing it:
#include <GUIConstantsEx.au3> #include <WindowsConstants.au3> Example5() ; Old Way Of Doing It! Func Example5() ; Old Way Of Doing It! Local $hGUI = GUICreate('GUI With Only Close', 250, 250, -1, -1, BitOR($WS_SIZEBOX, $WS_DLGFRAME)) GUIRegisterMsg($WM_SYSCOMMAND, 'WM_SYSCOMMAND') GUISetState(@SW_SHOW, $hGUI) While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop EndSwitch WEnd GUIDelete($hGUI) EndFunc ;==>Example5 Func WM_SYSCOMMAND($hWnd, $iMsg, $iwParam, $ilParam) #forceref $hWnd, $iMsg, $ilParam Local Const $SC_MAXIMIZE = 0xF030, $SC_MINIMIZE = 0xF020, $SC_RESTORE = 0xF120, $SC_SIZE = 0xF000 ; $SC_MOVE = 0xF010 Switch BitAND($iwParam, 0xFFF0) Case $SC_MAXIMIZE, $SC_MINIMIZE, $SC_RESTORE, $SC_SIZE Return -1 EndSwitch Return $GUI_RUNDEFMSG EndFunc ;==>WM_SYSCOMMAND
Additional information by MrCreatoR.
Edited by guinness, 08 October 2012 - 02:58 PM.








