Rawox Posted April 7, 2011 Share Posted April 7, 2011 (edited) Hi there, Is it possible to change a Windows attribute, like notepad (not an AutoIt GUI). I tried this: #include <WinApi.au3> #include <WindowsConstants.au3> Run("notepad") WinWaitActive("[CLASS:Notepad]") $hWndNotepad = WinGetHandle("[CLASS:Notepad]") _WinAPI_SetWindowLong($hWndNotepad, $GWL_EXSTYLE, BitOR(_WinAPI_GetWindowLong($hWndNotepad, $GWL_EXSTYLE), $WS_EX_APPWINDOW )) I want to be able to add the $WS_EX_APPWINDOW to notepad so that the borders/titlebar etc. disappear... Is this even possible? Thanks in advance, Rawox Edited April 7, 2011 by Rawox Link to comment Share on other sites More sharing options...
KaFu Posted April 7, 2011 Share Posted April 7, 2011 Is it possible to change a Windows attribute, like notepad (not an AutoIt GUI). To properly change a window style you need to hide the window, apply the style and show it again. #include <Constants.au3> #include <WinApi.au3> #include <WindowsConstants.au3> Run("notepad") WinWaitActive("[CLASS:Notepad]") $hWndNotepad = WinGetHandle("[CLASS:Notepad]") _WinAPI_ShowWindow($hWndNotepad,@SW_HIDE) _WinAPI_SetWindowLong($hWndNotepad, $GWL_EXSTYLE, $WS_EX_TOOLWINDOW) _WinAPI_ShowWindow($hWndNotepad,@SW_SHOW) I want to be able to add the $WS_EX_APPWINDOW to notepad so that the borders/titlebar etc. disappear... You're sure that $WS_EX_APPWINDOW will do this? "Forces a top-level window onto the taskbar when the window is visible."... and imho nothing more or less. OS: Win10-22H2 - 64bit - German, AutoIt Version: 3.3.16.1, AutoIt Editor: SciTE, Website: https://funk.eu AMT - Auto-Movie-Thumbnailer (2022-Nov-26) BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Feb-16) HMW - Hide my Windows (2018-Sep-16) HRC - HotKey Resolution Changer (2012-May-16) ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2023-Jun-03) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16) Link to comment Share on other sites More sharing options...
Rawox Posted April 7, 2011 Author Share Posted April 7, 2011 (edited) Ah oké! I wasn't sure about the $WS_EX_APPwindow. I'll just play around with that Ok got it working now Is it possible to actually recieve if a window has $WS_POPUPWINDOW as a style. I tried _WinAPI_GetWindowLong ( $hWnd, $GWL_STYLE ) which obviously returns numbers (80674816). Can I check if a window has $WS_POPUPWINDOW? Edited April 7, 2011 by Rawox Link to comment Share on other sites More sharing options...
AutoBert Posted April 8, 2011 Share Posted April 8, 2011 Yes, try this example:#include <Constants.au3> #include <WinApi.au3> #include <WindowsConstants.au3> Run("notepad") WinWaitActive("[CLASS:Notepad]") $hWndNotepad = WinGetHandle("[CLASS:Notepad]") $nOldStyle = _WinAPI_GetWindowLong($hWndNotepad, $GWL_STYLE) _WinAPI_ShowWindow($hWndNotepad, @SW_HIDE) _WinAPI_SetWindowLong($hWndNotepad, $GWL_STYLE, $WS_POPUPWINDOW) _WinAPI_ShowWindow($hWndNotepad, @SW_SHOW) _CheckIsWindowPopUpWindow($hWndNotepad) _WinAPI_ShowWindow($hWndNotepad, @SW_HIDE) _WinAPI_SetWindowLong($hWndNotepad, $GWL_STYLE, $nOldStyle) _WinAPI_ShowWindow($hWndNotepad, @SW_SHOW) _CheckIsWindowPopUpWindow($hWndNotepad) Func _CheckIsWindowPopUpWindow($hwnd) If BitAND(_WinAPI_GetWindowLong($hWnd, $GWL_STYLE), $WS_POPUPWINDOW) = $WS_POPUPWINDOW Then MsgBox(0, "Window", "is a PopUpWindow") Else MsgBox(0, "Window", "is NOT a PopUpWindow") EndIf EndFunc mfg autoBert Link to comment Share on other sites More sharing options...
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