topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Friday April 19, 2024, 4:12 pm
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - SvenBent [ switch to compact view ]

Pages: [1]
1
Skrommel's Software / Re: OnMessage(0x218,"FunctionName") question
« on: March 18, 2016, 02:21 PM »
Adding in more and more stuff Igot it to work then i started to removde stuff and got it al lthe way down to this



#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.
SetBatchLines 1


Gui +LastFound
OnMessage(0x218, "WM_POWERBROADCAST")

return



WM_POWERBROADCAST(wparam, lparam)
{
msgbox %wparam% %lparam%
}


which works.  so just the Gui +Lastfound made it all work perfectly

I also tried your new script and i got message registration succeed



WOOOT time to put it in aaction and eliminate some looping check on A_timeIdle



Thank you for getting me on the right track

2
Skrommel's Software / Re: OnMessage(0x218,"FunctionName") question
« on: March 18, 2016, 01:16 PM »
Thank you for your feedback. any advise are gratly welcome as im desperate lol

I tried AHK forum "Ask for help" but nothing i spend a few days on the IRC channels to no prevail. I've been googling around for at least a week now, and still anything I try, of other peoples script just fails on both my computers ( work win7 64  & home Win10)  i did however get 0x11  to work so it would react on logoff but that si at east i know something is working right.

i tried you script
#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn  ; Enable warnings to assist with detecting common errors.
SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.
SetBatchLines -1


Name := OnMessage(MsgNumber, "FunctionName")
If (! Name)
{
  MsgBox Message Registration Failed
  ExitApp
}
response: Message Registration Failed

i added "DllCall("RegisterSuspendResumeNotification", "ptr", A_ScriptHwnd, "uint", 0)" in front of the on message
response: Message Registration Failed

I added a small gui in fron of the above
response: Message Registration Failed

Then i added detecthidden windows
response: Message Registration Failed

Final code was this
#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn  ; Enable warnings to assist with detecting common errors.
SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.
SetBatchLines -1


DetectHiddenWindows, on

Gui, New
Gui, Add, Text,, This is text:
Gui, Show

DllCall("RegisterSuspendResumeNotification", "ptr", A_ScriptHwnd, "uint", 0)
Name := OnMessage(MsgNumber, "FunctionName")
If (! Name)
{
  MsgBox Message Registration Failed
  ExitApp
}


3
Skrommel's Software / OnMessage(0x218,"FunctionName") question
« on: March 16, 2016, 11:23 AM »
Sorry if I'm posting in the wrong place. but I have a question with AHK and Skrommels seems to be fond of that.

I'm trying to get the "going to standby" message from windows in my AHK scripts by using the OnMessage() command.
but it seems like my function ever gets called

Code: Autohotkey [Select]
  1. #NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
  2. SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
  3. SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.
  4.  
  5.  
  6. OnMessage(0x218, "WM_POWERBROADCAST")
  7. Return
  8.  
  9. WM_POWERBROADCAST(wParam, lParam)
  10.         {
  11.         msgbox test
  12.         }

Is there some preparations I need to do to be able to get that message ?

Pages: [1]