|
-
Aug 13th, 2000, 06:04 PM
#1
Thread Starter
Addicted Member
I was messing wit the GetActiveWindow api...and it is prtty cool what it does..but i was curios as to know if it is possible to actually make the whole window shake??
Cause i know code that can make the form in visual basic shake...
I am thinking it is possible....anyone have a say on this?
Thanks.
-
Aug 13th, 2000, 06:08 PM
#2
Do you mean shake like move it a bit every time?
Well, you can use the GetActiveWindow API in order to get the hWnd, and then use the MoveWindow API to move it a bit.
Code:
Public Declare Function MoveWindow Lib "user32" Alias "MoveWindow" (ByVal hwnd As Long, ByVal x As Long, ByVal y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal bRepaint As Long) As Long
Hope this helps.
-
Aug 13th, 2000, 06:10 PM
#3
Or you can use the SetWindowPos function.
-
Aug 13th, 2000, 06:13 PM
#4
Monday Morning Lunatic
If anyone has used the Acorn RISC OS machines, then they'll know about the !Madness program, which bounced all the windows around the screen. It would be good if we could write a replacement for Windows.
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
-
Aug 13th, 2000, 06:18 PM
#5
Actually you CAN write one for windows.
You can enumerate the windows using EnumWindows and then looping through the hWnds
in order to move them.
But in VB it's gonna be extremely slow.
Maybe you can do it in C++ or ASM.
-
Aug 13th, 2000, 06:21 PM
#6
Monday Morning Lunatic
You kidding??? BASIC on a 60MHz computer with 10 windows open went in real-time...at least mine does (I started it up again this morning for the first time in a few years).
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
-
Aug 14th, 2000, 03:08 AM
#7
New Member
Yo Sophy!
Why don't you just grab the person's head and start to shake it vigorously then the window will look shaken. Or you can just shake the monitor and you will get the same thing too.
-
Aug 14th, 2000, 03:33 AM
#8
Actually, that MoveWindow function works great. Here's a little of what you can do with another window. This is an example using the calculator.
Code:
Public Declare Function MoveWindow Lib "user32" _
(ByVal hwnd As Long, ByVal x As Long, ByVal y As _
Long, ByVal nWidth As Long, ByVal nHeight As Long, _
ByVal bRepaint As Long) As Long
Private Declare Function FindWindow Lib "user32.dll" Alias "FindWindowA" _
(ByVal lpClassName As Any, ByVal lpWindowName As Any) As Long
Private Sub Command1_Click()
Shell "Calc", vbNormalFocus
DoEvents
Dim h
h = FindWindow(vbNullString, "Calculator")
If h = 0 Then
MsgBox "Window was not found!", 16
Else
MoveWindow h, 50, 200, 350, 250, hwnd
Exit Sub
End If
End Sub
That's just a bit of what can be done, but you can randomize the coordinates and the window will shake anywhere.
-
Aug 14th, 2000, 01:41 PM
#9
Monday Morning Lunatic
I think the !Madness program just bounced the windows around the screen rather than moving them randomly.
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
-
Aug 14th, 2000, 02:05 PM
#10
Fanatic Member
Note: GetActiveWindow only works with windows withing your thread. GetForegroundWindow is for all Windows. My Favorite is changing the text of the current window to a little joke and then changing back after several seconds. If you use GetDesktopWindow and GetDC you can invert the colors of the desktop, flip it upside down, etc. I love these api's
Just my $0.02
GWDASH
[b]VB6, Perl, ASP, HTML, JavaScript, VBScript, SQL, C, C++, Linux , Java, PHP, MySQL, XML[b]
-
Aug 14th, 2000, 02:35 PM
#11
Monday Morning Lunatic
I think there was a Bill Plympton program (with the two guys off the old Nik Naks ad), which had an animated desktop image. I think they must have used that.
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
-
Aug 14th, 2000, 02:47 PM
#12
Originally posted by gwdash
Note: GetActiveWindow only works with windows withing your thread. GetForegroundWindow is for all Windows. My Favorite is changing the text of the current window to a little joke and then changing back after several seconds. If you use GetDesktopWindow and GetDC you can invert the colors of the desktop, flip it upside down, etc. I love these api's
how do you do this?
-
Aug 14th, 2000, 02:53 PM
#13
Monday Morning Lunatic
Use GetDesktopWindow to get the desktop's hWnd, then use GetDC to obtain the DC for the desktop. Then BitBlt away!
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
-
Aug 14th, 2000, 02:58 PM
#14
Thread Starter
Addicted Member
haha good one joker..
Or i could just drink beer till i get near passing out and it will spin that way..
but i dont think the people that use my program will want to do it that way!!! hahaha
This is cool..you can actually turn the desktop upside down?
haha awesome!
-
Aug 14th, 2000, 03:25 PM
#15
New Member
I like a person who can take a joke, hahahaha, because I am the JE-ZOKER!!!!
-
Aug 14th, 2000, 03:38 PM
#16
Hyperactive Member
You could use the windows API call shake windows vigourously:
Private Shakewindows "kernel 35.3" (shakefactor as shakability)
-
Aug 14th, 2000, 03:41 PM
#17
Monday Morning Lunatic
Hmm
Interesting addition...what else do people think that M$ should add to the API?
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
-
Aug 14th, 2000, 03:49 PM
#18
after you use BitBlt on the desktop
how do you get it back to normal?
-
Aug 14th, 2000, 03:53 PM
#19
Monday Morning Lunatic
What about InvalidateRect?
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
-
Aug 14th, 2000, 03:56 PM
#20
Check this one
Look what I just dug up:
Code:
Public Declare Function FixAllWindowsBugs Lib "imagination.dll" Alias "MSAsIf" (SuccessFactor As Zero) As Long
I tried it.
Unfortunately (but not surprisingly) it didn't work. 
Hehe...
Any other APIs?
-
Aug 14th, 2000, 03:59 PM
#21
Monday Morning Lunatic
Code:
Private Declare Function DojCompliance "ms_guff.dll" Alias "WhenHellFreezesOver" (RemoveIE As Boolean) As False
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
-
Aug 14th, 2000, 04:07 PM
#22
Fanatic Member
You hoodlums should really request the feautures at microsoft!
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
|