Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


[C++]Refresh monitor

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
Heartless
I post too much
Reputation: 0

Joined: 03 Dec 2006
Posts: 2436

PostPosted: Sun Mar 02, 2008 2:17 pm    Post subject: [C++]Refresh monitor Reply with quote

Is there a way to refresh your monitor in C++ and how?
_________________
What dosen't kill you, usually does the second time.
Back to top
View user's profile Send private message
atom0s
Moderator
Reputation: 205

Joined: 25 Jan 2006
Posts: 8587
Location: 127.0.0.1

PostPosted: Sun Mar 02, 2008 2:28 pm    Post subject: Reply with quote

What do you mean? Care to explain it a little better?
_________________
- Retired.
Back to top
View user's profile Send private message Visit poster's website
Heartless
I post too much
Reputation: 0

Joined: 03 Dec 2006
Posts: 2436

PostPosted: Sun Mar 02, 2008 2:34 pm    Post subject: Reply with quote

Right Click Screen -> Refresh

Can you do that in C++?

_________________
What dosen't kill you, usually does the second time.
Back to top
View user's profile Send private message
lurc
Grandmaster Cheater Supreme
Reputation: 2

Joined: 13 Nov 2006
Posts: 1900

PostPosted: Sun Mar 02, 2008 2:39 pm    Post subject: Reply with quote

UpdateWindow( GetDesktopWindow() ); or UpdateWindow( HWND_DESKTOP );

??

_________________
Back to top
View user's profile Send private message
atom0s
Moderator
Reputation: 205

Joined: 25 Jan 2006
Posts: 8587
Location: 127.0.0.1

PostPosted: Sun Mar 02, 2008 2:42 pm    Post subject: Reply with quote

HornyAZNBoy wrote:
Right Click Screen -> Refresh

Can you do that in C++?


That would be refreshing a folder, desktop, etc. Not your monitor.

This should do the trick:

Code:
#include <windows.h>

int main()
{
   //
   // Get Desktop Handle
   //
   HWND hWndDesktop = FindWindow( "Shell_traywnd", NULL );
   if( hWndDesktop != INVALID_HANDLE_VALUE || hWndDesktop != 0 )
   {
      //
      // Redraw By Sending Icon Update Message
      //
      SendMessage( hWndDesktop, WM_SETREDRAW, (WPARAM)FALSE, (LPARAM)NULL );
      SendMessageTimeout( HWND_BROADCAST, WM_SETTINGCHANGE, SPI_SETNONCLIENTMETRICS, NULL, SMTO_ABORTIFHUNG, 100000, NULL );
      SendMessage( hWndDesktop, WM_SETREDRAW, (WPARAM)TRUE, (LPARAM)NULL );
   }

   return 0;
}

_________________
- Retired.
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites