somdcomputerguy Posted October 7, 2009 Posted October 7, 2009 (edited) I use this clock, Yet another clock - AutoIt Forums, and I have modified it somewhat to fit my particulars. I have a question though.This code works:$hWnd = GUICreate("Clock", $width, $height, 1, 1, $WS_CAPTION, BitOR($WS_EX_LAYERED, $WS_EX_TOPMOST)) GUISetBkColor(0xc0c0c0) ;GUISetStyle($WS_CAPTION, BitOR($WS_EX_LAYERED, $WS_EX_TOPMOST), $hWnd)Yet this doesn't:$hWnd = GUICreate("Clock", $width, $height, 1, 1) GUISetBkColor(0xc0c0c0) GUISetStyle($WS_CAPTION, BitOR($WS_EX_LAYERED, $WS_EX_TOPMOST), $hWnd)By 'works', I mean the TOPMOST style affects the GUI correctly in the first code, and has no effect on the GUI in the second bit of code. Since I've gotten it to work eventually, I don't really care why it doesn't do as I expect in GUISetStyle, but.. So don't waste your time to figure it out, unless you need to for some reason. However, if one can answer this off the top of their head, great. Edited October 7, 2009 by snowmaker - Bruce /*somdcomputerguy */ If you change the way you look at things, the things you look at change.
AdmiralAlkex Posted October 7, 2009 Posted October 7, 2009 According to MSDN:WS_EX_TOPMOSTSpecifies that a window created with this style should be placed above all non-topmost windows and should stay above them, even when the window is deactivated. To add or remove this style, use the SetWindowPos function.So you should use WinSetOnTop() or _WinAPI_SetWindowPos() to change the TopMost-style after creation. .Some of my scripts: ShiftER, Codec-Control, Resolution switcher for HTC ShiftSome of my UDFs: SDL UDF, SetDefaultDllDirectories, Converting GDI+ Bitmap/Image to SDL Surface
somdcomputerguy Posted October 7, 2009 Author Posted October 7, 2009 (edited) I feel foolish for not seeing that part of the manual. Thanks.<br><br>Edit: Oops, I didn't read the previous post clear enough. No wonder I didn't see that in the Help file. But good to know, if I or anyone else reading this thread needs it..<br> Edited October 7, 2009 by snowmaker - Bruce /*somdcomputerguy */ If you change the way you look at things, the things you look at change.
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