-
May 2nd, 2000, 12:34 AM
#1
I'm working on a screensaver which minimizes all windows and then plays around with the desktop icons.
The problem is, that if I minimize a window which isn't minimizable, the window is resized to it's minimum size and positioned at the bottom of the desktop, and when I try to maximize or restore the window, it's size and position isn't restored. I need to activate it and press the enter button to restore the original size.
How can I find out if this window is not minimizable (or doesn't have a minimize button), so I can restore it to it's original size afterwards?
-
May 2nd, 2000, 01:09 AM
#2
Frenzied Member
GetWindowLong API for this one.
here's some constants
Code:
Private Const WS_MINIMIZEBOX = &H20000
Private Const WS_MAXIMIZEBOX = &H10000
Private Const GWL_STYLE = (-16)
if you need to know wheather a window can be minimized use
Code:
cBool(GetWindowLong(hWnd, GWL_STYLE) And WS_MINIMIZEBOX)
you could probably use setwindowlong to let it be minimized, I;m not sure but try
Code:
SetWindowLong hWnd, GWL_STYLE,GetWindowLong(hWnd, GWL_STYLE) Or WS_MINIMIZEBOX) ' Turns minimizebox on
SetWindowLong hWnd, GWL_STYLE,GetWindowLong(hWnd, GWL_STYLE) And (Not( WS_MINIMIZEBOX)) ' Turns minimizebox on
Hope this Helps
-
May 2nd, 2000, 02:25 AM
#3
Thanks,
The GetWindowLong works, but I can't get the SetWindowLong to work.
I think there are conflicting settings with the extended style bits. The windows I tested had a DS_MODALFRAME style bit set, and also a WS_EX_DLGMODALFRAME extended style. I can't change them, SetwindowLong always returns 0.
I think I let it this way, and try to restore the RECT.
-
May 2nd, 2000, 02:53 AM
#4
In case anyone is interested, restoring the size didn't work. I managed to get it back in original state by sending a WM_SYSCOMMAND message with SC_RESTORE as wParam.
-
May 2nd, 2000, 11:57 PM
#5
I am actually to embarrassed to admit this. But all was just a mistake in my code I overlooked.
I used ShowWindow to minimize the windows.
To restore the windows, I used ShowWindow again with for previously maximized windows SW_MAXIMIZE,
but for previously normal windows I made a copy and paste error.
Instead of using SW_NORMAL or SW_RESTORE I used SW_MINIMIZE again. Of course this didn't work, and for some reason I kept overlooking this mistake.
-
May 3rd, 2000, 12:35 AM
#6
Lively Member
Question...if you're trying to play around with the desktop icons, why don't you just *HIDE* all the windows (make sure you remember which ones, so you don't unhide a window you shouldn't)?
- Steve
Real programmers use COPY CON PROGRAM.EXE
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|