Sign in to follow this  
Followers 0
manelesux

Windows Styles

6 posts in this topic

Hello everyone,

Just discovered this gem of a language and it's awesome SciTE environment so some of my questions might sound stupid but i always ask them after reading the Help and understanding nothing. And since im talking about the Help, there are a lot of portions of it written in the strangest English. My English is not great either but thats just another reason to be worried - the fact that i can spot bad english while not being an english speaker. Ill look for examples some other time.

1.Now my first issue is with Window Styles.... as im not at all experienced in Windows window-based programming im still trying to figure out terms such as window painting, children clipping etc.

However, seems that some of the Window Style (and Extended Style) constants just dont work as they should, according to the tables from Help. For example, i never see a Layered Window, or a WindowEdge, or a StaticEdge. Some Window Styles seem to be unapplicable to windows at all (WS_GROUP, WS_TABSTOP - then why are they window styles in the first place). The Child windows get me really confused and im not sure about childrenclipping and siblingclipping really works, or i just dont understand what it means.

Anyway, im asking for some hint to a more detailed description of window styles and how they should be combined (i mean more detailed than that Style Tables from Help)

And 2. I cant figure out how the HWnd function works: is it successful only if a window or a control with the returned handle already exists? If not, what would be a "nonconvertible to HWnd" value and why?

Thanks in advance and keep up the good work.

Share this post


Link to post
Share on other sites



Welcome to AutoIt.

Post a short demo script that creates a GUI and applies one of the styles you didn't get, and say what you expected but didn't see in that particular script. Focusing on actual code makes it much easier to get or provide help.

:P


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites

Welcome to AutoIt.

Post a short demo script that creates a GUI and applies one of the styles you didn't get, and say what you expected but didn't see in that particular script. Focusing on actual code makes it much easier to get or provide help.

:)

Well the problem is that in some cases in dont even know what to expect and maybe i dont even look where i should to get the effect.

So:

#include <GUIConstants.au3>

$gui=GUICreate("Background", 800, 300,default,default,default,$ws_ex_dlgmodalframe)

GUISetState(@SW_SHOW)

do

$msg = GUIGetMsg()

until $msg = $GUI_EVENT_CLOSE

Ok, so im supposed to see that WS_EX_DLGMODALFRAME somewhere. Either im half blind, or i use it in the wrong combination (with Default as a base style). However, i dont seem to find a combination that gives me a relevant effect of DLGMODALFRAME. I have this problem with edge styles in general, i cant find examples relevant enough, only WS_EX_CLIENTEDGE and WS_SIZEBOX seems visible enough for me.

2. (i dont copy the include, GUISetState and DO---UNTIL).

$gui=GUICreate("Background", 800, 300, 0, 0,$ds_modalframe+$ws_caption+$ws_sysmenu)

Help recommends to use this combination when explaining DS_MODALFRAME but i dont see how the window i get is any different than a caption+sysmenu window.

3.

$gui=GUICreate("Background", 800, 300, 0, 0,$ds_contexthelp)

This is supposed to create a dialog box with a Help buton on the title bar. I tried to combine it with sysmenu, caption and the default style but no result (on the other hand, i get the desired effect with WS_EX_CONTEXTHELP, but i wanna learn how to use the DS_ styles since i seem to have a problem with all of them).

4. WS_GROUP and WS_TABSTOP are only supposed to work with Controls? Is there a way to implement them on a window level (they are called "window styles" after all)?

thats it for now

Share this post


Link to post
Share on other sites

Might help to start testing your style choices side-by-side, like this:

#include <GUIConstants.au3>

$gui1 = GUICreate("Background", 400, 300, 50, 50, Default, $ws_ex_dlgmodalframe)
GUISetState(@SW_SHOW)

$gui2 = GUICreate("Background", 400, 300, 500, 500, $ds_modalframe + $ws_caption + $ws_sysmenu)
GUISetState(@SW_SHOW)

Do
    $msg = GUIGetMsg()
Until $msg = $GUI_EVENT_CLOSE
Exit

Notice the difference in available window control buttons at the upper right corners...

Do similar tests of your other styles.

:)


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

For such deep details look at MSDN

EDIT: AutoIt is the only high level "wrapper" above Windows API so answers to your questions are in Windows API documentation --> MSDN

Edited by Zedna

Share this post


Link to post
Share on other sites

I agree with Zedna. I've been at the same thing for about three weeks now. The real technical answers are buried in the "Win32 and COM Development" section of the MSDN2 site -- but the more you read, the worse it gets. Just when you think you have something figured out, you'll find a "remark" or a passage in one of the technical articles that resets your thinking on it. It's a very convoluted world inside Windows -- and very enlightening to view detail at that level, but also scary. You begin to wonder how anything ever works. Just read their technical article entitled "Dll Hell" (or something like that) for additional perspective.

Another approach I've found useful in my research is simply to Google a term like WS_EX_LAYERED and look at some of the hundreds of results, especially those in forums. Given that most examples and discussions are in the VB, Delphi, etc., you can still gain some valuable insight -- if only to determine that something is a common problem, or that a particular thing can't be done.

My own recent quest involved flashing of entry screens on a third party application. As it turns out, flashing is very common in a variety of window situations -- and double-buffering (via WS_EX_COMPOSITED) can't always be used. As Scotty on Star Trek said a few times: "But Captain, you're forgetting about the environmentals!"

So we continue to learn about the environmentals.

Good luck.

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  
Followers 0