AutoHotkey Community

It is currently May 27th, 2012, 10:16 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 66 posts ]  Go to page Previous  1, 2, 3, 4, 5
Author Message
 Post subject:
PostPosted: August 21st, 2009, 3:47 am 
Offline

Joined: February 12th, 2007, 7:54 am
Posts: 2462
1) 0xC3 -> 0x43
2) already here, WM_SETFONT, think not


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 21st, 2009, 10:22 am 
Sean wrote:
1) 0xC3 -> 0x43
2) already here, WM_SETFONT, think not


Hey Sean..
Can you give an example on my script? Specially how to delete the close button of the tooltip itself.. Im new :(
Thanks


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: August 21st, 2009, 4:16 pm 
Offline

Joined: June 18th, 2008, 8:36 am
Posts: 4923
Location: AHK Forum
Anonymous wrote:
Sean wrote:
1) 0xC3 -> 0x43
2) already here, WM_SETFONT, think not


Hey Sean..
Can you give an example on my script? Specially how to delete the close button of the tooltip itself.. Im new :(
Thanks


Have you tried ToolTip function?

_________________
AHK_H (2alpha) AHF TT _Struct WatchDir Yaml _Input ObjTree RapidHotkey DynaRun :wink:


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 21st, 2009, 11:19 pm 
HotKeyIt
Your always a savior, I have to study this one for few days, but it looks cool, thanks


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: March 14th, 2011, 12:22 pm 
Offline

Joined: September 23rd, 2008, 3:37 am
Posts: 49
I know ToolTip() by HotKeyIt http://www.autohotkey.com/forum/viewtopic.php?t=40165 and TT() by HotKeyIt http://www.autohotkey.com/forum/viewtopic.php?t=65294 but for anyone want to use this simple BallonTip (thanks Sean) in both AHK and AHK_L, i have made some modifications:

Tested in WinXP x32 and Win7 x32 with AHK 1.0.48.05 and 1.0.92.02 unicode x86
Code:
BalloonTip("This is a`t`tBalloonTip`tTest.`nThis is a BalloonTip Test.", "BalloonTip`t-`tAHK, AHK_L compatible", "I=1 Y=200")
BalloonTip("This is a`t`tBalloonTip`tTest.`nThis is a BalloonTip Test.", "BalloonTip`t-`tAHK, AHK_L compatible", "I=1 Y=400 Q=0 W=1")
ExitApp

;================================================================================
BalloonTip(sText, sTitle="BalloonTip", Options="") { ;      BalloonTip  -  AHK, AHK_L compatible
   ; *****************************************************************************************************************************
   ;   Options: Space separated string of options bellow like (X=10 Y=10 I=1 T=2000 C=FFFFFF). ( Default Options in [] ).
   ;   X= x position [mouse x]
   ;   Y= y position [mouse y]
   ;   T= Timeout in milliseconds [0: no timeout]
   ;   W= Waits until Closed, by user or by Timeout or by WinClose command [0: No Wait]
   ;   I= Icon 0:None, [1:Info], 2:Warning, 3:Error, >3:assumed to be an hIcon.
   ;   C= RGB color for background (like 0xFF00FF or FF00FF), text uses compliment color, [1: color at X/Y position]
   ;   Q= Theme [1: Enable], Use 0 to disable Theme for colors to work in Vista, Win7.
   ;   NOTE: To Close it before Timeout, use command (WinClose,  ahk_id %<Returned hWnd>%)
   ; ******************************************************************************************************************************
   STATIC hWnd, X, Y, T, W, I, C, Q   ; Options STATIC to force local variables
   X:=Y:="", T:=W:=0, I:=C:=Q:=1, Ptr:=(A_PtrSize ? "Ptr" : "UInt"), sTitle:=((StrLen(sTitle)<99) ? sTitle : (SubStr(sTitle,1,95) . " ..."))
   loop, Parse, Options, %A_Space%=, %A_Space%%A_Tab%`r`n
      A_Index & 1  ? (Var:=A_LoopField) : (%Var%:=A_LoopField)
   DllCall("GetCursorPos", "int64P", pt), X:=(!X ? pt << 32 >> 32 : X), Y:=(!Y ? pt >> 32 : Y)
   a:=((C=1) ? ((hDC:=DllCall("GetDC","Uint",0)) (C:=DllCall("GetPixel","Uint",hDC,"int",X,"int",Y)) (DllCall("ReleaseDC","Uint",0,"Uint",hDC))) : ((C:=(StrLen(C)<8 ? "0x" : "") . C) (C:=((C&255)<<16)+(((C>>8)&255)<<8)+(C>>16)))) ; rgb -> bgr
   VarSetCapacity(ti,(A_PtrSize ? 28+A_PtrSize*3 : 40),0), ti:=Chr((A_PtrSize ? 28+A_PtrSize*3 : 40)), NumPut(0x20,ti,4,"UInt"), NumPut(&sText,&ti,(A_PtrSize ? 24+A_PtrSize*3 : 36))
   hWnd:=DllCall("CreateWindowEx",Ptr,0x8,"str","tooltips_class32","str","",Ptr,0xC3,"int",0,"int",0,"int",0,"int",0,Ptr,0,Ptr,0,Ptr,0,Ptr,0,Ptr)
   a:=(Q ? DllCall("SendMessage","Uint",hWnd,Ptr,0x200b,Ptr,0,Ptr,"") : DllCall("uxtheme\SetWindowTheme","Uint",hWnd,Ptr,0,"UintP",0)) ; TTM_SETWINDOWTHEME
   DllCall("SendMessage", Ptr, hWnd, "Uint", 1028, Ptr, 0, Ptr, &ti, Ptr)            ; TTM_ADDTOOL
   DllCall("SendMessage", Ptr, hWnd, "Uint", 1041, Ptr, 1, Ptr, &ti, Ptr)            ; TTM_TRACKACTIVATE
   DllCall("SendMessage", Ptr, hWnd, "Uint", 1042, Ptr, 0, Ptr, (X & 0xFFFF)|(Y & 0xFFFF)<<16,Ptr)   ; TTM_TRACKPOSITION
   DllCall("SendMessage", Ptr, hWnd, "Uint", 1043, Ptr, C, Ptr,   0, Ptr)            ; TTM_SETTIPBKCOLOR
   DllCall("SendMessage", Ptr, hWnd, "Uint", 1044, Ptr, ~C & 0xFFFFFF,  Ptr, 0,Ptr)      ; TTM_SETTIPTEXTCOLOR
   DllCall("SendMessage", Ptr, hWnd, "Uint",(A_IsUnicode ? 1057 : 1056),Ptr, I,Ptr, &sTitle, Ptr)   ; TTM_SETTITLE 0:None, 1:Info, 2:Warning, 3:Error, >3:assumed to be an hIcon.
   DllCall("SendMessage", Ptr, hWnd, "Uint", 1048, Ptr, 0, Ptr, A_ScreenWidth)         ; TTM_SETMAXTIPWIDTH
   DllCall("SendMessage", Ptr, hWnd, "UInt",(A_IsUnicode ? 0x439 : 0x40c), Ptr, 0, Ptr, &ti, Ptr)   ; TTM_UPDATETIPTEXT (OLD_MSG=1036)
   IfGreater, I, 0, SoundPlay, % "*" . (I=2 ? 48 : I=3 ? 16 : 64)
   IfGreater, T, 0, SetTimer, BalloonTip_TimeOut, %T%
   IfGreater, W, 0, WinWaitClose, ahk_id %hWnd%
   SetTimer, cBalloonTip_TimeOut, Off
   Return hWnd            ; Close it before TimeOut.
   ;-----------------------
   BalloonTip_TimeOut:
   SetTimer, BalloonTip_TimeOut, Off
   WinClose, ahk_id %hWnd%
   Return
}



Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 30th, 2012, 1:12 am 
This is very nice. Is there a way to get the hwnd of SysShadow and the close button? I like the fading effect on Windows 7 so I'd like to simulate pressing the button rather than using WinClose with ControlClick or SendMessage.


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

All times are UTC [ DST ]


Who is online

Users browsing this forum: specter333, XX0 and 25 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