flat assembler
Message board for the users of flat assembler.

Index > Windows > how to activate ScreenSaver?

Author
Thread Post new topic Reply to topic
HarryTuttle



Joined: 26 Sep 2003
Posts: 211
Location: Poland
HarryTuttle
I do like this:

Code:
include '%fasminc%/win32ax.inc'
WM_SYSCOMMAND = 112h
SC_SCREENSAVE = 0f140h
.code
start:
invoke GetDesktopWindow
invoke PostMessage,eax,WM_SYSCOMMAND,SC_SCREENSAVE,0
invoke ExitProcess,0
.end start  
    


end it doesn't work...
What's wrong with my code?

_________________
Microsoft: brings power of yesterday to computers of today.
Post 04 Feb 2004, 09:59
View user's profile Send private message Reply with quote
Dryobates



Joined: 13 Jul 2003
Posts: 46
Location: Poland
Dryobates
Code:
format PE console

include '%include%\win32a.inc'

WM_SYSCOMMAND = 112h
SC_SCREENSAVE = 0f140h

section '.code' readable executable

  entry start

start:
        invoke GetDesktopWindow
        invoke PostMessage,eax,WM_SYSCOMMAND,SC_SCREENSAVE,0
        invoke ExitProcess,0

section '.idata' import data readable writeable

  library kernel, 'kernel32.dll', \
          user, 'user32.dll'
  import kernel, \
         ExitProcess, 'ExitProcess'
  import user,\
         PostMessage,'PostMessageA',\
         GetDesktopWindow, 'GetDesktopWindow'    


That's works Smile
Post 04 Feb 2004, 11:31
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger ICQ Number Reply with quote
HarryTuttle



Joined: 26 Sep 2003
Posts: 211
Location: Poland
HarryTuttle
I know ,what I'll say can be little strange but your code dryobates dosn't work a well as mine.

THX any way!
is it possible that windows or any programm lock the messages?

btw : let you upgrade your FASM version to latest 1.51

_________________
Microsoft: brings power of yesterday to computers of today.
Post 04 Feb 2004, 12:08
View user's profile Send private message Reply with quote
Dryobates



Joined: 13 Jul 2003
Posts: 46
Location: Poland
Dryobates
Quote:
I know ,what I'll say can be little strange but your code dryobates dosn't work a well as mine.

It is working on my comp. Maybe you haven't set screensaver?

Quote:
is it possible that windows or any programm lock the messages?

It is possible. E.g. some CD-burners do that.

Quote:
btw : let you upgrade your FASM version to latest 1.51

I use FASM 1.51 beta 4, WinXP and have set screensaver (but there's now information about it in system.ini)
Post 04 Feb 2004, 14:00
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger ICQ Number Reply with quote
HarryTuttle



Joined: 26 Sep 2003
Posts: 211
Location: Poland
HarryTuttle
so I think you changed %fasminc% to %include% to support older fasm's sources.(right?)

I have no Idea what happend but on another computer everything: as yours as my code works well, so maybe something blocked the screen saver.
I checked settings and screensaver was turn on but worked only when click preview.

How to block screensaver or how to check the screensaver is blocked?

very thank You Dryobates!

regards,

_________________
Microsoft: brings power of yesterday to computers of today.
Post 04 Feb 2004, 14:45
View user's profile Send private message Reply with quote
Dryobates



Joined: 13 Jul 2003
Posts: 46
Location: Poland
Dryobates
Quote:
so I think you changed %fasminc% to %include% to support older fasm's sources.(right?)

I've just add another alias Smile

How to block screensaver or how to check the screensaver is blocked?
[/quote]
In Plantform SDK you can read:
Quote:
Windows does not start the screen saver if any of the following conditions exist:

- The active application is not a Windows-based application.
- A computer-based training (CBT) window is present.
- The active application receives the WM_SYSCOMMAND message with the wParam parameter set to the SC_SCREENSAVE value, but it does not pass the message to the DefWindowProc function.


So check them.
Post 04 Feb 2004, 16:30
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger ICQ Number Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
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


Copyright © 1999-2020, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.

Website powered by rwasa.