Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

PostMessage fails - Administrator privileges


  • Please log in to reply
2 replies to this topic
John Hemming
  • New members
  • 1 posts
  • Last active: Jul 14 2015 09:52 AM
  • Joined: 09 Jul 2015

I had some really confusing problems trying to do post message.  I found, not surprisingly I suppose, that if AutoHotKey tries to post a message to a window which has administrator privileges then it will fail.  I trapped the error message, but that didn't tell me anything.

 

The solution, of course, is to run Autohotkey with administrator privileges. (as administrator either by right clicking when starting it or setting the .exe to have administrator privileges by defaut).

 

I thought I should post this here as I have taken about 2 days to find this out.

 

It is obvious when you think retrospectively about it, but many things are like that.



SnowFlake_FlowSnake
  • Members
  • 845 posts
  • Last active: Jan 24 2016 05:24 PM
  • Joined: 08 Oct 2012

"as administrator either by right clicking when starting it or setting the .exe to have administrator privileges by defaut"

you could also make the script it self run as admin b adding these lines at the top:

IF NOT A_IsAdmin
{
   Run *RunAs "%A_ScriptFullPath%"
   ExitApp
}
SendMessage, 0x112, 0xF170, 2,, Program Manager ; example

  • Download link of my scripts on Autohotkey.com 2/10/2015 [DOWNLAND]
  • Contact Info:  https://github.com/floowsnaake //  FloowSnaake(A)gmail.com
  • IF you need Help send me a PM,Email or Post on Github

  • Quote by tank  Posted 29 September 2015 - 06:14 PM

  • "Eventually i will find a way to convert the DB back to PHPBB3. but i dont have the bandwidth right now. No one that has tried has had success. It is the Only way i can keep this open is if i could successfully convert it."

Lexikos
  • Administrators
  • 9844 posts
  • AutoHotkey Foundation
  • Last active:
  • Joined: 17 Oct 2006

This is a security feature of Windows Vista and later called User Interface Privilege Isolation.