Jump to content

None Gui window styling


Recommended Posts

I'm trying to style a none GUI window/opendialog. I found ANYGUI(), but it doesn't seem to work on the current version of Autoit. I tried transferring the GuiList to GUiListView and ...ListBox, but can't get it to go. Does anyone know the current way, if there is one, to style a none gui window?

Link to comment
Share on other sites

I'm trying to style a none GUI window/opendialog. I found ANYGUI(), but it doesn't seem to work on the current version of Autoit. I tried transferring the GuiList to GUiListView and ...ListBox, but can't get it to go. Does anyone know the current way, if there is one, to style a none gui window?

Do you mean you want a special shape for a window?
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.
Link to comment
Share on other sites

No, I mean applying styles like remove title bar, borders, topmost. I found scripts to help solve the main problem but I can't seem to set the external app/open dialog to topmost

Here are the main function codes

Func _OFN_HookProc($hWnd, $Msg, $wParam, $lParam)
    Switch $Msg
        Case $WM_NOTIFY
            Local $hWndFrom, $iIDFrom, $iCode, $tNMHDR
            $tNMHDR = DllStructCreate("hwnd hWndFrom;int idFrom;int code", $lParam)
            $hWndFrom = DllStructGetData($tNMHDR, "hWndFrom")
            $iIDFrom = DllStructGetData($tNMHDR, "idFrom")
            $iCode = DllStructGetData($tNMHDR, "code")
            Switch $iCode
                Case $CDN_INITDONE
                Case $CDN_FOLDERCHANGE
                    If $f_CDN_Start Then;if executing first time
                        Local $hODLV = _FindWindowEx($hWndFrom, 0, "SHELLDLL_DefView", "")
                        If $hODLV <> 0 Then
                            DllCall('user32.dll','int','SendMessage','hwnd',$hODLV,'uint',$WM_COMMAND,'wparam',$ODM_VIEW_DETAIL,'lparam',0)
                        EndIf
                        $f_CDN_Start = 0;to make sure these tweaks happens only once.
                    EndIf
                        WinMove($hWndFrom, "", 0,$GUI_Main_YPos+86,$GUIWidth+2,$GUIHeight)
                        WinSetStyle($hWndFrom, $WS_POPUP+$WS_BORDER, $WS_EX_TOPMOST + $WS_EX_TOOLWINDOW)
;                       ;_ConsoleWrite(WinGetState($GUIMain))
;                       $State1 = WinGetState($Slide2)
;                       If  BitAND($State1, 2) Then;In case dialog is being opened from the menu items                  
;                           _WinAnimate($hWndFrom, $AW_SLIDE_IN_TOP, 700)
;                       EndIf
                Case $CDN_SELCHANGE
                Case $CDN_FILEOK
            EndSwitch
        Case Else
    EndSwitch
EndFunc

Func _FindWindowEx($hWndParent,$hWndChildAfter,$sClassName,$sWinTitle="")
    Local $aRet = DllCall('user32.dll','hwnd','FindWindowEx', 'hwnd', $hWndParent,'hwnd',$hWndChildAfter,'str',$sClassName,'str',$sWinTitle)
    If $aRet[0] = 0 Then ConsoleWrite('_FindWindowEx() Error : ' & _WinAPI_GetLastErrorMessage())
    Return $aRet[0]
EndFunc

;Set Window Styles
Func WinSetStyle($hWnd, $Style = -1, $ExStyle = 0)
    Local Const $GWL_STYLE = -16
    Local Const $GWL_EXSTYLE = -20
    Local Const $SWP_NOMOVE = 0x2
    Local Const $SWP_NOSIZE = 0x1
    Local Const $SWP_SHOWWINDOW = 0x40
    Local Const $SWP_NOZORDER = 0x4
    Local $iFlags = BitOR($SWP_NOSIZE, $SWP_NOMOVE, $SWP_NOZORDER)
    If $Style = -1 Then $Style = $WS_MINIMIZEBOX + $WS_CAPTION + $WS_POPUP + $WS_SYSMENU
    DllCall("User32.dll", "int", "SetWindowLong", "hwnd", $hWnd, "int", $GWL_STYLE, "int", $Style)
    DllCall("User32.dll", "int", "SetWindowLong", "hwnd", $hWnd, "int", $GWL_EXSTYLE, "int", $ExStyle)
    DllCall("User32.dll", "int", "SetWindowPos", "hwnd", $hWnd, "hwnd", 0, "int", 0, "int", 0, _
            "int", 0, "int", 0, "int", $iFlags)
EndFunc

I commented out a couple things so you wont have problems running this. Any ideas?

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...