AutoHotkey Community

It is currently May 27th, 2012, 9:11 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 22 posts ]  Go to page Previous  1, 2
Author Message
 Post subject:
PostPosted: September 24th, 2011, 7:17 pm 
Drugwash wrote:
Could be. I actually created a GUI with a Picture instead of Splash.
Code:
Gui, -Caption +ToolWindow -Border +AlwaysOnTop
Gui, Margin, 0, 0
Gui, Add, Picture,, C:\button.gif
Gui, Show, x%bx% y%by% w%bw% h%bh%, ShowDesktop
WinGet, hSplash, ID, ShowDesktop

I don't quite get it: what are you actually calling with that Send command...? It's a Win+M command sent to what, exactly? Maybe that's the real problem, not the button display code. I didn't use that in my code.


When you press those two keys Win+M it will minimize all windows without affecting Rocketdock.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: September 24th, 2011, 7:46 pm 
Thank you,with the Gui works like a charm.I removed button.gif as I don't need it and it doesn't show up.
Code:
#NoTrayIcon
ControlGetPos, bx, by, bw, bh, TrayShowDesktopButtonWClass1, ahk_class Shell_TrayWnd
Gui, -Caption +ToolWindow -Border +AlwaysOnTop
Gui, Margin, 0, 0
Gui, Show, x%bx% y%by% w%bw% h%bh%, haha
WinGet, hSplash, ID, haha
WinSet, TransColor, White, haha
WinSet, AlwaysOnTop, On, haha
WinGet, hSplash, ID, haha
WinGet, hShell, ID, ahk_class Shell_TrayWnd
DllCall("SetParent", "UInt", hSplash, "UInt", hShell)
OnMessage(0x201, "WM_LBUTTONDOWN")

WinGet, L, List
Loop, % L
{
   WinGetTitle, T, % "ahk_id " L%A_Index%
   If(ProcessGet_PID("AutoHotkey.Exe") == WinGet_PID(L%A_Index%))
   WinSet, Style, -0x8000000, % "ahk_id " L%A_Index%
}
Return

WM_LBUTTONDOWN()
{
Send, {LWin down}{m}{LWin up}
}

ProcessGet_PID(P) {
   Process, Exist, % P
   Return ErrorLevel
}

WinGet_PID(W) {
   WinGet, I, PID, % "ahk_id " W
   Return I   
}

Return


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: September 24th, 2011, 8:13 pm 
Offline
User avatar

Joined: September 8th, 2008, 12:26 am
Posts: 1048
Location: Ploieşti, RO
The button picture needed additional code to resize according to GUI size. That was not important at the time. Anyway, since it works, let's keep it as is, until I figure out the rest.

_________________
AHK tools by Drugwash (AHK 1.0.48.05 and Win98SE)


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 12th, 2011, 7:10 pm 
Drugwash wrote:
The button picture needed additional code to resize according to GUI size. That was not important at the time. Anyway, since it works, let's keep it as is, until I figure out the rest.


Code:
#NoTrayIcon
ControlGetPos, bx, by, bw, bh, TrayShowDesktopButtonWClass1, ahk_class Shell_TrayWnd
Gui, -Caption +ToolWindow -Border +AlwaysOnTop
Gui, Margin, 0, 0
Gui, Show, x%bx% y%by% w%bw% h%bh%, showdesktop
WinGet, hSplash, ID, showdesktop
WinSet, TransColor, White, showdesktop
WinSet, AlwaysOnTop, On, showdesktop
WinGet, hSplash, ID, showdesktop
WinGet, hShell, ID, ahk_class Shell_TrayWnd
DllCall("SetParent", "UInt", hSplash, "UInt", hShell)
OnMessage(0x201, "WM_LBUTTONDOWN")

WinGet, L, List
Loop, % L
{
   WinGetTitle, T, % "ahk_id " L%A_Index%
   If(ProcessGet_PID("AutoHotkey.Exe") == WinGet_PID(L%A_Index%))
   WinSet, Style, -0x8000000, % "ahk_id " L%A_Index%
}
Return

WM_LBUTTONDOWN()
{
Send, {LWin down}{m}{LWin up}
}

ProcessGet_PID(P) {
   Process, Exist, % P
   Return ErrorLevel
}

WinGet_PID(W) {
   WinGet, I, PID, % "ahk_id " W
   Return I   
}

Return


Maybe some quick fix,to reload after 1 second if resolution is changed?


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: October 12th, 2011, 8:02 pm 
Offline
User avatar

Joined: September 8th, 2008, 12:26 am
Posts: 1048
Location: Ploieşti, RO
The right way would be to monitor system broadcast messages and react to the appropriate message. Unfortunately, I don't have time now to search for such message so you'll have to ask around or in MSDN.

_________________
AHK tools by Drugwash (AHK 1.0.48.05 and Win98SE)


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 17th, 2011, 3:04 pm 
Drugwash wrote:
The right way would be to monitor system broadcast messages and react to the appropriate message. Unfortunately, I don't have time now to search for such message so you'll have to ask around or in MSDN.


WM_DISPLAYCHANGE

http://msdn.microsoft.com/en-us/library ... 85%29.aspx
http://www.autohotkey.com/forum/topic40382.html


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: November 17th, 2011, 10:15 pm 
Offline
User avatar

Joined: September 8th, 2008, 12:26 am
Posts: 1048
Location: Ploieşti, RO
Well then, add an OnMessage(0x7E, "resizeit") call to the autoexec section, pointing to a simple function that retrieves button size and resizes your GUI accordingly. Hopefull yit'll work (haven't tested, being busy with other stuff).

Code:
resizeit()
{
Global
ControlGetPos, bx, by, bw, bh, TrayShowDesktopButtonWClass1, ahk_class Shell_TrayWnd
Gui, Show, x%bx% y%by% w%bw% h%bh%, showdesktop
}

_________________
AHK tools by Drugwash (AHK 1.0.48.05 and Win98SE)


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 22 posts ]  Go to page Previous  1, 2

All times are UTC [ DST ]


Who is online

Users browsing this forum: Bing [Bot], Google Feedfetcher and 71 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group