I think that M.S. needs someone to proofread stuff.
I have some code and wan't to know what this windows style does.
invoke CreateWindowEx,NULL,ADDR ClassName,ADDR AppName,WS_OVERLAPPEDWINDOW or WS_VISIBLE,
WS_VISIBLE
Creates a window that is initially visible.
O.k, the window can be seen for some amount of time and then what? :dazzled:
1. OEM license flashes
2. you fill in your own interpretations
3. You find an "Easter Egg"
:dazzled:
it's only visible if you ShowWindow after you create it, though
invoke CreateWindowEx.....
mov hWin,eax
invoke ShowWindow,eax,SW_NORMAL
invoke UpdateWindow,hWin
well - there is a trick you can use to avoid that :P
read carefully the MSDN documentation for CreateWindowEx - x position and y position
Quote from: dedndave on December 12, 2012, 01:23:06 PM
it's only visible if you ShowWindow after you create it, though
invoke CreateWindowEx.....
mov hWin,eax
invoke ShowWindow,eax,SW_NORMAL
invoke UpdateWindow,hWin
well - there is a trick you can use to avoid that :P
read carefully the MSDN documentation for CreateWindowEx - x position and y position
Nope... a window with WS_VISIBLE does not need ShowWindow() and it remains visible until destroyed.
That's why WS_VISIBLE is used in almost every Child window and control.
i guess i got that idea in my head from Iczelion's tutorials
Quote from: dedndave on December 12, 2012, 02:35:05 PM
i guess i got that idea in my head from Iczelion's tutorials
A common practice is to create the application's main window without WS_VISIBLE, load all the controls and even the data into the window, resize it and then pop it on the screen with ShowWindow ... If you use the WM_CREATE event for your top level (main) window you get the same effect with WS_VISIBLE since all the startup stuff is done in the WM_CREATE event before the window is made visible by the OS.
The main use for ShowWindow is for programs with system tray icons. There you can create your tray icon, which sits near the clock, and toggle the main window between SW_HIDE and SW_SHOW states when the tray icon is clicked.
For the CW_USEDEFAULT trick in CreateWindowEx... I suppose it has it's uses but given that my window coordinates are stored in the registry at shutdown and restored during startup, I've never had occasion to play with it. (I like getting my windows back, exactly where I left them.)
i don't think you have to mess with all that
it doesn't get drawn until WM_CREATE is complete - as well as a WM_SIZE
ShowWindow has 2 purposes, really
one is the show state - minimized, normal, maximized
the other is visible or hidden
these aren't the same thing - actually not all that related - lol
i have written code like you are talking about
where you store the window position and restore it
for most programs, i want to allow for multiple instances
if that's the case, restoring the position doesn't work so well (size is ok)
most of my main windows - i use CW_USEDEFAULT for the X and SW_SHOWNORMAL for Y
Quote from: dedndave on December 13, 2012, 12:10:37 AM
i have written code like you are talking about
where you store the window position and restore it
for most programs, i want to allow for multiple instances
if that's the case, restoring the position doesn't work so well (size is ok)
most of my main windows - i use CW_USEDEFAULT for the X and SW_SHOWNORMAL for Y
Perhaps it's the stuff we are writing... Rather than allow multiple instances, in most of my projects I use Mutex objects to detect the second instance and send WM_COPYDATA to the running copy so it can open new files into a single instance. Of course it doesn't always make sense to do this, but for some reason it usually does in the code I write 8)
i do have one project - my current "big" project
it accesses data from a special USB device
for that program, i use a mutex and single instance
i don't want more than one app accessing the device
it depends on the app, of course
As always , the answer is in the windows help files.
Quote
WS_OVERLAPPEDWINDOW
Creates an overlapped window with the WS_OVERLAPPED, WS_CAPTION, WS_SYSMENU, WS_THICKFRAME, WS_MINIMIZEBOX, and WS_MAXIMIZEBOX styles. Same as the WS_TILEDWINDOW style
WS_VISIBLE
Creates a window that is initially visible.
This style can be turned on and off by using ShowWindow or SetWindowPos
Well, 'initially visible' may be real clear to you but not to me.
See my first post.
Andy
Quote from: CommonTater on December 12, 2012, 11:50:01 PM(I like getting my windows back, exactly where I left them.)
Hey, Tater, we can agree on something :t
I'd go one step further: I like getting my editor window back, exactly where I left it, with the cursor in line 345 column 12 ;)
And that should work at home and in office - which is easier to achieve with ini files, since you cannot put the registry into the archive with your sources.
QuoteWS_VISIBLE
Creates a window that is initially visible.
O.k, the window can be seen for some amount of time and then what?
I fully agree with Andy that this is lousy English. What they mean is "visible from the beginning" or "visible without any extra steps".
Quote from: jj2007 on December 13, 2012, 03:53:02 AM
I fully agree with Andy that this is lousy English. What they mean is "visible from the beginning" or "visible without any extra steps".
The word they probably wanted was "immediately"....
Quote from: jj2007 on December 13, 2012, 03:53:02 AMQuoteWS_VISIBLE
Creates a window that is initially visible.
O.k, the window can be seen for some amount of time and then what?
I fully agree with Andy that this is lousy English. What they mean is "visible from the beginning" or "visible without any extra steps".
lousy? Becasue you don't know what "initially" means?
Sorry, but such statments are ridiculous.
Quote from: jj2007 on December 13, 2012, 03:53:02 AM
And that should work at home and in office - which is easier to achieve with ini files, since you cannot put the registry into the archive with your sources.
I take your point but I haven't played with .ini files in years ... don't plan to either :(
Quote from: Magnum on December 12, 2012, 10:11:25 AM
WS_VISIBLE
Creates a window that is initially visible.
The window
is initially visible, what happens after that point isn't specified - the point is that it
can change.
initially visible. This mean he can change later,and what follow say how
Quote
This style can be turned on and off by using ShowWindow or SetWindowPos
initially is here to say that other states exist.
Quote from: qWord on December 13, 2012, 04:15:32 AM
QuoteI fully agree with Andy that this is lousy English. What they mean is "visible from the beginning" or "visible without any extra steps".
lousy? Becasue you don't know what "initially" means?
Sorry, but such statments are ridiculous.
qWord,
I am just echoing the feelings of a native English speaker here. The English language is full of subtleties that the average German (me included) can't grasp so easily. One is that "initially visible" implies ", but then it disappears". Strangely enough, when you do a Google phrase search for "initially visible" (http://www.google.com/search?q=%22initially+visible%22), the first dozen entries refer to software (and I am sure much more romantic literature has been written about the initially visible moon etc) - proof that Microsoft's abuse of this great language has already had a detrimental impact :icon13:
Take it easy ;-)
JJ,
I would say it like this: Microsoft's documentation assumes that the reader is aware of the nomenclature used in the IT. If one is not aware of that it is his bad, but surely no indication for a bad documentation.
Quote from: jj2007 on December 13, 2012, 05:19:44 AM
Take it easy ;-)
I will follow that advice :icon_cool:
My post was just a pet peeve.
I try hard to not make assumptions.
My dad said that when you assume you make an "ass - out of U and me."
Andy
Gotta get back to my fixer program.