forum.vdsworld.com Forum Index forum.vdsworld.com
Visit VDSWORLD.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


WM_SYSCOMMAND message

 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> Visual DialogScript 3 Source Code
View previous topic :: View next topic  
Author Message
Tommy
Admin Team


Joined: 16 Nov 2002
Posts: 746
Location: The Netherlands

PostPosted: Fri Jan 03, 2003 5:15 am    Post subject: WM_SYSCOMMAND message Reply with quote

This script illustrates the use of some of the WM_SYSCOMMAND messages, mainly
related to monitor standby:

Code:

  DIALOG CREATE,WM_SYSCOMMAND Demonstration,-1,0,375,246,CLASS WM_SYSCOMMAND
  DIALOG ADD,BUTTON,SC_TASKLIST,8,8,200,24,SC_TASKLIST
  DIALOG ADD,BUTTON,SC_MONITORPOWER_ON,40,8,200,24,SC_MONITORPOWER_ON
  DIALOG ADD,BUTTON,SC_MONITORPOWER_LOWPOWER,72,8,200,24,SC_MONITORPOWER_LOWPOWER
  DIALOG ADD,BUTTON,SC_MONITORPOWER_OFF,104,8,200,24,SC_MONITORPOWER_OFF
  DIALOG SHOW
  %%window = #WM_SYSCOMMAND
  gosub wm_syscommand
:evloop
  wait event
  goto @event()
:sc_tasklistbutton
  gosub sc_tasklist
  goto evloop
:sc_monitorpower_onbutton
  %%param = %%sc_monitorpower_on
  gosub sc_monitorpower
  goto evloop
:sc_monitorpower_lowpowerbutton
  %%param = %%sc_monitorpower_lowpower
  gosub sc_monitorpower
  goto evloop
:sc_monitorpower_offbutton
  %%param = %%sc_monitorpower_off
  gosub sc_monitorpower
  goto evloop

:wm_syscommand
  rem initialize constants
  %%wm_syscommand            = $0112
  %%sc_tasklist              = 61744
  %%sc_monitorpower          = 61808
  %%sc_monitorpower_on       = -1
  %%sc_monitorpower_lowpower = 1
  %%sc_monitorpower_off      = 2
  exit
:sc_tasklist
  %x = @sendmsg(%%window,%%wm_syscommand,%%sc_tasklist,0)
  exit
:sc_monitorpower
  %x = @sendmsg(%%window,%%wm_syscommand,%%sc_monitorpower,%%param)
  exit

:close



BTW: I removed the SC_NEXTWINDOW code which didn't work and was accidentally
left in.


Last edited by Tommy on Sat Jan 04, 2003 5:11 am; edited 1 time in total
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Skit3000
Admin Team


Joined: 11 May 2002
Posts: 2166
Location: The Netherlands

PostPosted: Fri Jan 03, 2003 12:53 pm    Post subject: Reply with quote

That's a nice code Tommy! And a good idea to set the sendmessage codes into variables. That way you can use it much more easier!
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> Visual DialogScript 3 Source Code All times are GMT
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 can attach files in this forum
You can download files in this forum

Twitter@vdsworld       RSS

Powered by phpBB © 2001, 2005 phpBB Group