Jump to content
Sign in to follow this  
jennico

disable/grey out maximize/minimize/exit buttons

Recommended Posts

jennico

i have searched the forum without success.

how can i temporarily disable (grey out) the the three caption buttons (maximize/minimize/exit buttons) ?

i don't want to hide them, and i don't want to create the GUI in another style. i want to disable and grey out the three buttons.

here are lots of not working examples from the forum:

Run("notepad")
WinWait("Untitled - Notepad")
;WinWait("Unbenannt - Editor")
$calcHwnd = WinGetHandle("Untitled - Notepad")
;$calcHwnd = WinGetHandle("Unbenannt - Editor")

Global Const $SC_CLOSE = 0xF060
Global Const $SC_MINIMIZE = 0xF020
Global Const $SC_MAXIMIZE = 0xF030;
Global Const $SC_RESTORE = 0xF120

$menu = DllCall("user32.dll","hwnd","GetSystemMenu","hwnd", $calcHwnd, "int",0)
DllCall("user32.dll", "int", "RemoveMenu", "hwnd", $menu[0] , "int", $SC_MINIMIZE, "int", 0x0)
DllCall("user32.dll", "int", "RemoveMenu", "hwnd", $menu[0] , "int", $SC_MAXIMIZE, "int", 0x0)
DllCall("user32.dll", "int", "RemoveMenu", "hwnd", $menu[0] , "int", $SC_CLOSE, "int", 0x0)
DllCall("user32.dll", "int", "RemoveMenu", "hwnd", $menu[0] , "int", $SC_RESTORE, "int", 0x0)


#include <GUIConstants.au3>

Opt('GUICloseOnEsc', 0)

;Global Const $SC_CLOSE        = 0xF060
Global Const $MF_GRAYED        = 0x00000001

$hGUI    = GUICreate('Test')
$Btn    = GUICtrlCreateButton('Exit', 100, 100, 70, 25)
GUISetState()

$hMenu = DllCall('user32.dll', 'int', 'GetSystemMenu', 'hwnd', $hGUI, 'int', 0)
DllCall('user32.dll', 'int', 'EnableMenuItem', 'hwnd', $hMenu[0], 'int', $SC_CLOSE, 'int', $MF_GRAYED)
DllCall('user32.dll', 'int', 'EnableMenuItem', 'hwnd', $hMenu[0], 'int', $SC_MINIMIZE, 'int', $MF_GRAYED)
DllCall('user32.dll', 'int', 'EnableMenuItem', 'hwnd', $hMenu[0], 'int', $SC_MAXIMIZE, 'int', $MF_GRAYED)

Do
    $Msg = GUIGetMsg()
Until $Msg = $BtnoÝ÷ Ù«­¢+Ø¥¹±Õ±ÐíÝ¥¹Á¤¹ÔÌÐì(ÀÌØí¡}Õ¤ôU%
ÉÑ ÅÕ½ÐíµäÕ¤ÅÕ½Ðì¤)U%MÑMÑÑ ¤((ÀÌØí¹}Ñ¥µÈôQ¥µÉ%¹¥Ð ¤)]¡¥±U%Ñ5Í ¤±ÐìÐì´Ì(%ÀÌØí¹}Ñ¥µÈÐìÀ¹Q¥µÉ¥ ÀÌØí¹}Ñ¥µÈ¤¼ÄÀÀÀÐìôÌQ¡¸(}]¥¹Iµ½Ù5¥¹5á  ½à ÀÌØí¡}Õ¤¤(ÀÌØí¹}Ñ¥µÈôÀ(¹%)]¹(()Õ¹}]¥¹Iµ½Ù5¥¹5á  ½à ÀÌØí¡}ݹ¤(1½°
½¹ÍÐÀÌØí]1}}MQe1ô´ÄØ(1½°
½¹ÍÐÀÌØí]M}}5a%5%i  =`ôÁàÀÀÄÀÀÀÀ(1½°
½¹ÍÐÀÌØí]M}}5%9%5%i =`ôÁàÀÀÈÀÀÀÀ((%%ÍMÑÉ¥¹ ÀÌØí¡}ݹ¤Q¡¸ÀÌØí¡}ݹô]¥¹Ñ!¹± ÀÌØí¡}ݹ¤((1½°ÀÌØí}½±}ÍÑå±ô±±
±° ÅÕ½ÐíÕÍÈÌȹ±°ÅÕ½Ðì°ÅÕ½Ðí¥¹ÐÅÕ½Ðì°ÅÕ½ÐíÑ]¥¹½Ý1½¹ÅÕ½Ðì°ÅÕ½Ðí¡Ý¹ÅÕ½Ðì°ÀÌØí¡}ݹ°ÅÕ½Ðí¥¹ÐÅÕ½Ðì°ÀÌØí]1}}MQe1¤(%ÉɽÈQ¡¸IÑÕɸMÑÉÉ½È Ä°À°À¤((1½°ÀÌØí¥}ÍÑå±ôÀ(%    ¥Ñ9 ÀÌØí}½±}ÍÑå±lÁt°ÀÌØí]M}}5a%5%i    =`¤Q¡¸ÀÌØí¥}ÍÑå±ô  ¥Ñ=H ÀÌØí¥}ÍÑå±°ÀÌØí]M}}5a%5%i  =(%  ¥Ñ9 ÀÌØí}½±}ÍÑå±lÁt°ÀÌØí]M}}5%9%5%i   =`¤Q¡¸ÀÌØí¥}ÍÑå±ô  ¥Ñ=H ÀÌØí¥}ÍÑå±°ÀÌØí]M}}5%9%5%i =((%9½ÐÀÌØí¥}ÍÑå±Q¡¸IÑÕɸÀÌØí}½±}ÍÑå±lÁt((1½°ÀÌØí}ÍÑ}Ý¥¹½Üô±±
±° ÅÕ½ÐíÕÍÈÌȹ±°ÅÕ½Ðì°ÅÕ½Ðí¥¹ÐÅÕ½Ðì°ÅÕ½ÐíMÑ]¥¹½Ý1½¹ÅÕ½Ðì°ÅÕ½Ðí¡Ý¹ÅÕ½Ðì°ÀÌØí¡}ݹ°ÅÕ½Ðí¥¹ÐÅÕ½Ðì°ÀÌØí]1}}MQe1°ÅÕ½Ðí±½¹ÅÕ½Ðì°ÀÌØí}½±}ÍÑå±lÁt´ÀÌØí¥}ÍÑ層(%ÉɽÈQ¡¸IÑÕɸMÑÉÉ½È È°À°À¤((ì
¡ÀÝäѼÉÉÍ Ñ¡Ñ¥Ñ±È(]¥¹MÑQ¥Ñ± ÀÌØí¡}ݹ°ÅÕ½ÐìÅÕ½Ðì°]¥¹ÑQ¥Ñ± ÀÌØí¡}ݹ¤¤((IÑÕɸÀÌØí}ÍÑ}Ý¥¹½ÝlÁt)¹Õ¹oÝ÷ Ù«­¢+Ø¥¹±Õ±ÐíU%
½¹ÍѹÑ̹ÔÌÐì(¥¹±Õ±Ðí]¥¹½ÝÍ
½¹ÍѹÑ̹ÔÌÐì((ÀÌØí¥MÑå±Äô ¥Ñ=È ÀÌØí]M}5a%5%i   =`°ÀÌØí]M}5%9%5%i  =`°ÀÌØí]M}
AQ%=8°ÀÌØí]M}A=AU@°ÀÌØí]M}MeM59T¤ìMÑå±Ý¥Ñ µ¥¹¥µ¥é½à(ÀÌØí¥MÑå±Èô    ¥Ñ=È ÀÌØí]M}5a%5%i   =`°ÀÌØí]M}
AQ%=8°ÀÌØí]M}A=AU@°ÀÌØí]M}MeM59T¤ìMÑå±Ý¥Ñ¡½Õе¥¹¥µ¥é½à((ÀÌØíÕ¤ôU%
ÉÑ ÌäìÌäì°ÈÀÀ°ÈÀÀ°´Ä°´Ä°ÀÌØí¥MÑå±Ä¤(ÀÌØíÐÄôU%
Ñɱ
ÉÑ    ÕÑѽ¸ Ìäí
±¥¬µÑ¼¹±Ìäì°Ô°Ô°ÄÈÀ°ÈÔ¤(ÀÌØíÐÈôU%
Ñɱ
ÉÑ    ÕÑѽ¸ Ìäí
±¥¬µÑ¼¥Í±Ìäì°Ô°ÌÔ°ÄÈÀ°ÈÔ¤)U%MÑMÑÑ ¤()]¡¥±Ä(ÀÌØí´ôU%Ñ5Í ¤(MÝ¥Ñ ÀÌØí´(
ÍÀÌØíU%}Y9Q}
1=M(á¥Ñ1½½À(
ÍÀÌØíÐÄ(U%MÑMÑå± ÀÌØí¥MÑå±Ä¤(
ÍÀÌØíÐÈ(U%MÑMÑå± ÀÌØí¥MÑå±È¤(¹MÝ¥Ñ )]¹

anyone has a working method meanwhile ?

thx j.


Spoiler

I actively support Wikileaks | Freedom for Julian Assange ! | Defend freedom of speech ! | Fight censorship ! | I will not silence.OixB7.jpgDon't forget this IP: 213.251.145.96

 

Share this post


Link to post
Share on other sites
wraithdu

Use this option -

GUIEventOptions Change special event behavior or GUI function return values.

0 = (default) Windows behavior on click on Minimize,Restore, Maximize, Resize.

1 = suppress windows behavior on minimize, restore or maximize click button or window resize. Just sends the notification.

and handle the notifications yourself. It won't gray out the buttons, but it will give control of their behavior to you.

Edited by wraithdu

Share this post


Link to post
Share on other sites
martin

If you want the buttons greyed out and inactive there might be some clever way to do it, but the only way I know to make the window look disabled is to either use GuiSetSate(4) which will only last as long as you don't click on it, or to continually set focus to some other window which could be hidden and will produce some unpleasant effects.

So I would take a screen shot of the buttons on a disabled window, make a pic of them on a tiny popup window which is positioned over the real buttons, and keep it in the correct position somehow. That would give the look posibly and prevent the buttons from operating.

Edited by martin

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

Share this post


Link to post
Share on other sites
jennico

no no, i want them disabled (and greyed out) so that the user knows they are disabled. that's the question. seems easy but nobody knows.

j.

So I would d take a screen shot of the buttons on a disabled window, make a pic of them on a tiny popup window which is positioned over the real buttons, and keep it in the correct position somehow. That would give the look posibly and prevent the buttons from operating.

complicated and you do not know how the buttons look like on the other machine (styles). Edited by jennico

Spoiler

I actively support Wikileaks | Freedom for Julian Assange ! | Defend freedom of speech ! | Fight censorship ! | I will not silence.OixB7.jpgDon't forget this IP: 213.251.145.96

 

Share this post


Link to post
Share on other sites
youknowwho4eva

get the new nvidia driver :) I have issues all the time with it disabling windows. close minimize and maximize tend to still work though.


Giggity

Share this post


Link to post
Share on other sites
jennico

when nvidia can do it, there must be a way for everyone.

btw: GuiSetState(4) does nothing to me. (4 = Window is enabled)?

Edited by jennico

Spoiler

I actively support Wikileaks | Freedom for Julian Assange ! | Defend freedom of speech ! | Fight censorship ! | I will not silence.OixB7.jpgDon't forget this IP: 213.251.145.96

 

Share this post


Link to post
Share on other sites
martin

when nvidia can do it, there must be a way for everyone.

btw: GuiSetState(4) does nothing to me. (4 = Window is enabled)?

Then try this, which will only stay looking deactivaqted until you click on it.

#include <GUIConstants.au3>
#include <WindowsConstants.au3>
$gui2 = GUICreate("dummy",100,60)
$iStyle1 = BitOr($WS_MAXIMIZEBOX, $WS_MINIMIZEBOX, $WS_CAPTION, $WS_POPUP, $WS_SYSMENU); Style with minimize box
$iStyle2 = BitOr( $WS_CAPTION, $WS_POPUP, $WS_SYSMENU); Style without minimize box

$gui = GUICreate('', 200, 200, -1, -1, $iStyle1)
$bt1 = GUICtrlCreateButton('Click me to enable', 5, 5, 120, 25)
$bt2 = GUICtrlCreateButton('Click me to disable', 5, 35, 120, 25)

GUISetState(4)


While 1
    $gm = GUIGetMsg()
    Switch $gm
        Case $GUI_EVENT_CLOSE
            ExitLoop
        Case $bt1
           ;GUISetStyle($iStyle1)
            GUISetState()
        Case $bt2
           ;GUISetStyle($iStyle2)
    EndSwitch
WEnd

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

Share this post


Link to post
Share on other sites
wraithdu

This is as close as I can get. If you choose a window style with the minimize / maximize boxes, you cannot gray them out. You can remove the menu item, which effectively disables their function, but they will not look grayed out.

#include <guimenu.au3>
#include <windowsconstants.au3>

$gui = GUICreate("Disable exit button", 400, 400, -1, -1, BitOR($WS_SYSMENU, $WS_CAPTION))
$close = GUICtrlCreateButton("Close", 10, 10, 50, 30)

GUISetState()

$menu = _GUICtrlMenu_GetSystemMenu($gui)
_GUICtrlMenu_EnableMenuItem($menu, $SC_CLOSE, 1, False)

Do
    $msg = GUIGetMsg()
    Switch $msg
        Case $close
            $msg = -3
    EndSwitch
Until $msg == -3

Share this post


Link to post
Share on other sites
martin

This is a crude example of the way I suggested just for the record.

#include <GUIConstants.au3>
#include <WindowsConstants.au3>
#include <screencapture.au3>
$iStyle1 = BitOr($WS_MAXIMIZEBOX, $WS_MINIMIZEBOX, $WS_CAPTION, $WS_POPUP, $WS_SYSMENU); Style with minimize box
$iStyle2 = BitOr( $WS_CAPTION, $WS_POPUP, $WS_SYSMENU); Style without minimize box

$gui = GUICreate('', 200, 200, 400,400, $iStyle1)
$bt1 = GUICtrlCreateButton('Click me to enable', 5, 5, 120, 25)
$bt2 = GUICtrlCreateButton('Click me to disable', 5, 35, 120, 25)

GUISetState(4)
sleep(100);in case window doesn't show straight away
_ScreenCapture_Capture(@scriptdir & "\disabled1.bmp",400+134,405,400+202,405+21)
$g2 = GUICreate("Dummy",202-134,21,400+134,405,$WS_POPUP)
GUICtrlCreatePic(@scriptdir & "\disabled1.bmp",0,0,202-134,21)
GUISetState()
winsetontop($g2,"",1)
;GUISwitch($gui)
GUIRegisterMsg($WM_MOVE,"moved")
While 1
    $gm = GUIGetMsg()
    Switch $gm
        Case $GUI_EVENT_CLOSE
            ExitLoop
        Case $bt1
            WinSetState($g2,"",@SW_HIDE)
           ;GUISetStyle($iStyle1)
            GUISetState()
        Case $bt2
            
            WinSetState($g2,"",@SW_SHOW)
           ;GUISetStyle($iStyle2)
    EndSwitch

     
     
WEnd

Func moved()
    $wp = WinGetPos($gui)
    WinMove($g2,"",$wp[0]+134,$wp[1] + 5)
    
EndFunc

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

Share this post


Link to post
Share on other sites
jennico

@martin: :) very clever !!!! (but they are not grey !)

i've googled it, nothing to find. so i think:

- close button can be disabled (see above examples).

- maximize button can be disabled by style (see above).

- minimize button cannot be disabled.

- minimize and maximize button can be hidden by style, close button not.

j.


Spoiler

I actively support Wikileaks | Freedom for Julian Assange ! | Defend freedom of speech ! | Fight censorship ! | I will not silence.OixB7.jpgDon't forget this IP: 213.251.145.96

 

Share this post


Link to post
Share on other sites
martin

@martin: :) very clever !!!! (but they are not grey !)

They are now

;mainly bty Siao, then Paulie, improved by Rover
;thread = http://www.autoitscript.com/forum/index.php?s=&showtopic=69930&view=findpost&p=512959
#include <GDIPlus.au3>
#include <ScreenCapture.au3>
#include <GUIConstantsEX.au3>
#include <WindowsConstants.au3>
#include <GUIConstants.au3>
#include <WindowsConstants.au3>
#include <screencapture.au3>
$iStyle1 = BitOr($WS_MAXIMIZEBOX, $WS_MINIMIZEBOX, $WS_CAPTION, $WS_POPUP, $WS_SYSMENU); Style with minimize box
$iStyle2 = BitOr( $WS_CAPTION, $WS_POPUP, $WS_SYSMENU); Style without minimize box

$gui = GUICreate('', 200, 200, 400,400, $iStyle1)
$bt1 = GUICtrlCreateButton('Click me to enable', 5, 5, 120, 25)
$bt2 = GUICtrlCreateButton('Click me to disable', 5, 35, 120, 25)

GUISetState(4)
sleep(100);in case window doesn't show straight away


HotKeySet("{ESC}", "Quit")

Func Quit()
    Exit
EndFunc  ;==>Quit

Global Const $STM_SETIMAGE = 0x0172
Global Const $IMAGE_BITMAP = 0
Global $hBitmap, $hImage1, $hImage2, $oldBitmap
Global $hGui, $hPic

_GDIPlus_Startup()
$hBitmap = _ScreenCapture_Capture("",400+134,405,400+202,405+21,False)
$hImage1 = _GDIPlus_BitmapCreateFromHBITMAP($hBitmap)
_WinAPI_DeleteObject($hBitmap)
$hImage2 = _GDIPlus_ImageGreyscale($hImage1)
_GDIPlus_ImageDispose($hImage1)
$hBitmap = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hImage2, 0x00000000)


$g2 = GUICreate("Dummy",202-134,21,400+134,405,$WS_POPUP, BitOR($WS_EX_TOPMOST, $WS_EX_TOOLWINDOW))
$hPic  = GUICtrlCreatePic("",0,0,202-134,21)
$hPic = GUICtrlGetHandle($hPic)

If IsHWnd($hPic) Then
    ConsoleWrite("ok line 50" & @CRLF)
    $oldBitmap = DllCall("user32.dll", "hwnd", "SendMessage", "hwnd", _
            $hPic, "int", $STM_SETIMAGE, "int", $IMAGE_BITMAP, "int", $hBitmap)
    If $oldBitmap[0] Then
        _WinAPI_DeleteObject($oldBitmap[0]); not needed in this usage,
       ; but necessary to prevent resource leaks when SendMessage used to
       ; replace existing image.
    EndIf
EndIf
_GDIPlus_ImageDispose($hImage2)
_GDIPlus_Shutdown()

;WinSetTrans($hGui, "", 0)
GUISetState()

GUIRegisterMsg($WM_MOVE,"moved")
While 1
    $gm = GUIGetMsg()
    Switch $gm
        Case $GUI_EVENT_CLOSE
            ExitLoop
        Case $bt1
            WinSetState($g2,"",@SW_HIDE)
          ;GUISetStyle($iStyle1)
            GUISetState()
        Case $bt2
            
            WinSetState($g2,"",@SW_SHOW)
          ;GUISetStyle($iStyle2)
    EndSwitch

    
    
WEnd

Func moved()
    $wp = WinGetPos($gui)
    WinMove($g2,"",$wp[0]+134,$wp[1] + 5)
    
EndFunc


;; _GDIPlus_ImageGreyscale()
;;  Creates a greyscale copy of Image object and returns its handle.
;;  To destroy it, use _GDIPlus_ImageDispose() or _GDIPlus_BitmapDispose()
Func _GDIPlus_ImageGreyscale(Const ByRef $hImage)
    Local $tColorMatrix, $x, $hImgAttrib, $iW = _GDIPlus_ImageGetWidth($hImage), _
            $iH = _GDIPlus_ImageGetHeight($hImage), $hGraphics, $hGraphics2, $hBitmap
   ;;create color matrix data
    $tColorMatrix = DllStructCreate("float[5];float[5];float[5];float[5];float[5]")
   ;greyscale values:
    $x = DllStructSetData($tColorMatrix, 1, 0.3, 1) _
             * DllStructSetData($tColorMatrix, 1, 0.3, 2) _
             * DllStructSetData($tColorMatrix, 1, 0.3, 3) _
             * DllStructSetData($tColorMatrix, 2, 0.59, 1) _
             * DllStructSetData($tColorMatrix, 2, 0.59, 2) _
             * DllStructSetData($tColorMatrix, 2, 0.59, 3) _
             * DllStructSetData($tColorMatrix, 3, 0.11, 1) _
             * DllStructSetData($tColorMatrix, 3, 0.11, 2) _
             * DllStructSetData($tColorMatrix, 3, 0.11, 3) _
             * DllStructSetData($tColorMatrix, 4, 1.0, 4) _
             * DllStructSetData($tColorMatrix, 5, 1.0, 5)
   ;;create an image attributes object and update its color matrix
    $hImgAttrib = _GDIPlus_ImageAttributesCreate()
    _GDIPlus_ImageAttributesSetColorMatrix($hImgAttrib, 1, _
            DllStructGetPtr($tColorMatrix))
   ;;copy image
    $hGraphics = _GDIPlus_ImageGetGraphicsContext($hImage)
    $hBitmap = _GDIPlus_BitmapCreateFromGraphics($iW, $iH, $hGraphics)
    $hGraphics2 = _GDIPlus_ImageGetGraphicsContext($hBitmap)
   ;;draw original into copy with attributes
    _GDIPlus_GraphicsDrawImageRectRectEx($hGraphics2, $hImage, _
            0, 0, $iW, $iH, 0, 0, $iW, $iH, 2, $hImgAttrib)
   ;;clean up
    _GDIPlus_GraphicsDispose($hGraphics)
    _GDIPlus_GraphicsDispose($hGraphics2)
    _GDIPlus_ImageAttributesDispose($hImgAttrib)

    Return $hBitmap
EndFunc  ;==>_GDIPlus_ImageGreyscale

Func _GDIPlus_ImageAttributesSetColorMatrix($hImgAttrib, $iColorAdjustType, _
        $pColorMatrix = 0, $pGreyMatrix = 0, $iColorMatrixFlags = 0)
    Local $fEnable = 1, $aResult = DllCall($ghGDIPDll, "int", _
            "GdipSetImageAttributesColorMatrix", "ptr", $hImgAttrib, "int", $iColorAdjustType, _
            "int", $fEnable, "ptr", $pColorMatrix, "ptr", $pGreyMatrix, "int", $iColorMatrixFlags)
    Return SetError($aResult[0], 0, $aResult[0] = 0)
EndFunc  ;==>_GDIPlus_ImageAttributesSetColorMatrix

;;Creates ImageAttributes object
Func _GDIPlus_ImageAttributesCreate()
    Local $aResult = DllCall($ghGDIPDll, "int", _
            "GdipCreateImageAttributes", "ptr*", 0)
    Return SetError($aResult[0], 0, $aResult[1])
EndFunc  ;==>_GDIPlus_ImageAttributesCreate

;;Deletes ImageAttributes object
Func _GDIPlus_ImageAttributesDispose($hImgAttrib)
    Local $aResult = DllCall($ghGDIPDll, "int", _
            "GdipDisposeImageAttributes", "ptr", $hImgAttrib)
    Return SetError($aResult[0], 0, $aResult[0] = 0)
EndFunc  ;==>_GDIPlus_ImageAttributesDispose

;; _GDIPlus_GraphicsDrawImageRectRectEx()
;; Same as _GDIPlus_GraphicsDrawImageRectRect(),
;; but adds 1 optional parameter - $hImgAttrib (handle to ImageAttributes object)
Func _GDIPlus_GraphicsDrawImageRectRectEx($hGraphics, $hImage, $iSrcX, $iSrcY, $iSrcWidth, _
        $iSrcHeight, $iDstX, $iDstY, $iDstWidth, $iDstHeight, $iUnit = 2, $hImgAttrib = 0)
    Local $aResult = DllCall($ghGDIPDll, "int", "GdipDrawImageRectRectI", "hwnd", _
            $hGraphics, "hwnd", $hImage, "int", $iDstX, "int", _
            $iDstY, "int", $iDstWidth, "int", $iDstHeight, "int", $iSrcX, "int", $iSrcY, "int", _
            $iSrcWidth, "int", $iSrcHeight, "int", $iUnit, "ptr", $hImgAttrib, "int", 0, "int", 0)
    Return SetError($aResult[0], 0, $aResult[0] = 0)
EndFunc  ;==>_GDIPlus_GraphicsDrawImageRectRectEx

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

Share this post


Link to post
Share on other sites
youknowwho4eva

Double click on the titlebar :-P, Also, it's all gray in a rectangle. the space between the buttons is gray, and in my xp style, the corners where they are rounded.

Edit, you can also still edit from the taskbar.

Edited by youknowwho4eva

Giggity

Share this post


Link to post
Share on other sites
Valuater

That look s cool martin, until you double-click on the title bar :)

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites
martin

That look s cool martin, until you double-click on the title bar :o

8)

Well yes, it was only for a bit of fun. It needs more work to make it useful but I've exhausted my interest in it now :)

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

Share this post


Link to post
Share on other sites
AoRaToS

Someone once gave me this when I asked for help on the matter of disabling the minimize button.

I changed it a bit and there is something unusual, about it, check it out. If you remove the maximize from style 2 and press to disable they both disappear.

#include <GUIConstants.au3>
#include <WindowsConstants.au3>

$iStyle1 = BitOr( $WS_MINIMIZEBOX, $WS_CAPTION, $WS_SYSMENU); Style with minimize box
$iStyle2 = BitOr($WS_MAXIMIZEBOX, $WS_CAPTION, $WS_SYSMENU); Style without minimize box

$gui = GUICreate('', 200, 200, Default, Default, $iStyle1)
$bt1 = GUICtrlCreateButton('Click me to enable', 5, 5, 120, 25)
$bt2 = GUICtrlCreateButton('Click me to disable', 5, 35, 120, 25)
GUISetState()

While 1
    $gm = GUIGetMsg()
    Switch $gm
        Case $GUI_EVENT_CLOSE
            ExitLoop
        Case $bt1
            GUISetStyle($iStyle1)
        Case $bt2
            GUISetStyle($iStyle2)
    EndSwitch
WEnd
Edited by AoRaToS

s!mpL3 LAN Messenger

Current version 2.9.8.8 [30/09/2015]

Download Here

s!mpL3

Share this post


Link to post
Share on other sites
jennico

so i have to correct my final conclusions:

- close button can be disabled (see above examples).

- maximize button can be disabled by style BitOr($WS_MINIMIZEBOX, $WS_CAPTION, $WS_SYSMENU)

- minimize button can be disabled by style BitOr($WS_MAXIMIZEBOX, $WS_CAPTION, $WS_SYSMENU)

- both minimize and maximize button cannot disabled together.

- both minimize and maximize button can be hidden by style, close button not.

i wonder why MS forgot that feature .....


Spoiler

I actively support Wikileaks | Freedom for Julian Assange ! | Defend freedom of speech ! | Fight censorship ! | I will not silence.OixB7.jpgDon't forget this IP: 213.251.145.96

 

Share this post


Link to post
Share on other sites
jennico

i have a small linguistic problem:

many members here and msdn itself spell it gray out ($MF_GRAYED).

i think it has to be grey out (from the color grey).

is gray synonymous to grey or does it mean something different?

is gray allowed ?

j.

Edited by jennico

Spoiler

I actively support Wikileaks | Freedom for Julian Assange ! | Defend freedom of speech ! | Fight censorship ! | I will not silence.OixB7.jpgDon't forget this IP: 213.251.145.96

 

Share this post


Link to post
Share on other sites
martin

i have a small linguistic problem:

many members here and msdn itself spell it gray out ($MF_GRAYED).

i think it has to be grey out (from the color grey).

is gray synonymous to grey or does it mean something different?

is gray allowed ?

j.

Gray is US English afaik, and yes it's allowed. Same with color which is US English whereas I use colour (and so does ResNullius).

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

Share this post


Link to post
Share on other sites
jennico

ok, thx, i have never come across "gray" before. funny.


Spoiler

I actively support Wikileaks | Freedom for Julian Assange ! | Defend freedom of speech ! | Fight censorship ! | I will not silence.OixB7.jpgDon't forget this IP: 213.251.145.96

 

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×