|
-
Jan 31st, 2000, 08:48 AM
#1
Thread Starter
Frenzied Member
How can I stop screen refreshing and start it again? Anyone???
I wrote a chess prog, and to check for checkmate/stalemate, it makes every legal move for the opponent until they aren't in check (or it declares game over).
Problem is, the screen is flashy while pieces rapidly move around screen. I want to turn this off while checking the position (which should also speed up processing), then turn on again when done.
I am using images for the pieces. Any helpful ideas would be GREATLY appreciated.
~seaweed
-
Jan 31st, 2000, 12:02 PM
#2
Hyperactive Member
Could you maybe set the properties of the pieces to invisible?
-
Jan 31st, 2000, 12:05 PM
#3
Try the LockWindowUpdate() API, it prevents Drawing Operations in a Specified Window, ie.
Code:
Private Declare Function LockWindowUpdate Lib "user32" Alias "LockWindowUpdate" (ByVal hwndLock As Long) As Long
Private Sub Command1_Click()
'Stop Updating while performing the following operations
Call LockWindowUpdate(Hwnd)
'Put your Code here..
'ReEnable the Updating of this Window
Call LockWindowUpdate(0)
End Sub
------------------
Aaron Young
Analyst Programmer
[email protected]
[email protected]
-
Feb 1st, 2000, 01:20 AM
#4
Thread Starter
Frenzied Member
Thank you so much, Aaron!
You, too, Bob...except that if a piece is invisible, it is considered to be "off the board". In other words, if I make them invisible, I couldn't see if there was a checkmate or stalemate, because there would be no "valid" pieces to check.
Thanks again for your help, guys.
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
|