Michel Claveau Posted June 14, 2009 Share Posted June 14, 2009 (edited) Hi! Only a little example, for display short text on desktop. expandcollapse popup#include <StaticConstants.au3> #include <GUIConstants.au3> #include <WindowsConstants.au3> #include <WINAPI.au3> ;when message is displayed, {Esc} or {Alt}{F4} exit (or wait for $dureemax ms) topmessage(2000,"Essai de texte - éèêë") topmessage(3000,"Try text","with TWO lines") topmessage(4000,"Première ligne","Second line","Tercera linea") Exit Func topmessage($dureemax=2000,$l1="",$l2="",$l3="") Local $gui $gui = GUICreate("trans", @DesktopWidth+20, @DesktopHeight+100, -1, -1, -1, $WS_EX_LAYERED) GUISetFont(48,600) lignes3($l1,$l2,$l3) GUISetBkColor(0xABCDEF) _WinAPI_SetLayeredWindowAttributes($gui, 0xABCDEF);rend fenêtre transparente GUICtrlSetState($gui, $GUI_DISABLE) GUISetStyle($WS_POPUP, -1, $gui) GUISetState() While 1 $msg = GUIGetMsg($gui) If $msg = $GUI_EVENT_CLOSE Then ExitLoop EndIf $dureemax-=21 If $dureemax<0 Then ExitLoop EndIf Sleep(20) WEnd GUIDelete($gui) EndFunc Exit Func lignes3($l1="",$l2="",$l3="") Local $pasv,$v $pasv=int((@DesktopHeight-100)/4) $v=$pasv*3 If $l3<>"" Then txt($l3,$v) EndIf $v-=$pasv If $l2<>"" Then txt($l2,$v) $v-=$pasv EndIf If $l1<>"" Then txt($l1,$v) $v-=$pasv EndIf EndFunc Func txt($txt,$v) Local $t1,$t1g,$t1n $t1g=GUICtrlCreateLabel($txt, 10-1, $v-1, @DesktopWidth-40, 100, $SS_CENTER) GUICtrlSetColor($t1g,0xFFFFFF) GUICtrlSetBkColor($t1g, $GUI_BKCOLOR_TRANSPARENT) $t1n=GUICtrlCreateLabel($txt, 10+3, $v+3, @DesktopWidth-40, 100, $SS_CENTER) GUICtrlSetColor($t1n,0x000000) GUICtrlSetBkColor($t1n, $GUI_BKCOLOR_TRANSPARENT) ;GUICtrlSetColor($t1n,0x000000) $t1=GUICtrlCreateLabel($txt, 10, $v, @DesktopWidth-40, 100, $SS_CENTER) GUICtrlSetColor($t1,0xFF0000) GUICtrlSetBkColor($t1, $GUI_BKCOLOR_TRANSPARENT) EndFunc Func _WinAPI_SetLayeredWindowAttributes($hwnd, $i_transcolor, $Transparency = 255, $dwFlages = 0x03, $isColorRef = False) If $dwFlages = Default Or $dwFlages = "" Or $dwFlages < 0 Then $dwFlages = 0x03 If Not $isColorRef Then $i_transcolor = Hex(String($i_transcolor), 6) $i_transcolor = Execute('0x00' & StringMid($i_transcolor, 5, 2) & StringMid($i_transcolor, 3, 2) & StringMid($i_transcolor, 1, 2)) EndIf Local $Ret = DllCall("user32.dll", "int", "SetLayeredWindowAttributes", "hwnd", $hwnd, "long", $i_transcolor, "byte", $Transparency, "long", $dwFlages) Select Case @error Return SetError(@error, 0, 0) Case $Ret[0] = 0 Return SetError(4, _WinAPI_GetLastError(), 0) Case Else Return 1 EndSelect EndFunc;==>_WinAPI_SetLayeredWindowAttributes Func _WinAPI_GetLayeredWindowAttributes($hwnd, ByRef $i_transcolor, ByRef $Transparency,$asColorRef = False) $i_transcolor = -1 $Transparency = -1 Local $Ret = DllCall("user32.dll", "int", "GetLayeredWindowAttributes", "hwnd", $hwnd, "long*", $i_transcolor, "byte*", $Transparency, "long*", 0) Select Case @error Return SetError(@error, 0, 0) Case $Ret[0] = 0 Return SetError(4, _WinAPI_GetLastError(), 0) Case Else If Not $asColorRef Then $Ret[2] = Hex(String($Ret[2]), 6) $Ret[2] = '0x' & StringMid($Ret[2], 5, 2) & StringMid($Ret[2], 3, 2) & StringMid($Ret[2], 1, 2) EndIf $i_transcolor = $Ret[2] $Transparency = $Ret[3] Return $Ret[4] EndSelect EndFunc;==>_WinAPI_GetLayeredWindowAttributes Edit: add a screenshoot (3st line of the example, reduce to 50%) Edited June 15, 2009 by Michel Claveau Link to comment Share on other sites More sharing options...
picea892 Posted June 14, 2009 Share Posted June 14, 2009 Wow, great work. A really nice effect. I'll have to look into this further. I appreciate you sharing Link to comment Share on other sites More sharing options...
Phodexis Posted June 14, 2009 Share Posted June 14, 2009 i like it, Thanks for Sharing bro. Link to comment Share on other sites More sharing options...
James Posted June 14, 2009 Share Posted June 14, 2009 Any chance of a screenshot? Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ Link to comment Share on other sites More sharing options...
storme Posted June 15, 2009 Share Posted June 15, 2009 G'day Michel Claveau Looks great and I have a use for it already. Well done! John Morrison Some of my small contributions to AutoIt Browse for Folder Dialog - Automation SysTreeView32 | FileHippo Download and/or retrieve program information | Get installedpath from uninstall key in registry | RoboCopy function John Morrison aka Storm-E Link to comment Share on other sites More sharing options...
Michel Claveau Posted June 15, 2009 Author Share Posted June 15, 2009 Hi! Thanks, all. I appreciate your congratulations. (but, I published, in past, more complete/complex examples, without reaction). I had a screenshoot in the first message. Good day! Link to comment Share on other sites More sharing options...
storme Posted June 15, 2009 Share Posted June 15, 2009 (but, I published, in past, more complete/complex examples, without reaction).Yeah I know how that feels.I think from observing the board for a while that the small examples get comments because members can quickly try it and comment without a lot of thought. Larger examples don't get comments because they won't take the time to look through the code or they just don't understand it. OR maybe because it takes a while to read anf understand and by the time they have they have moved on past the forum.Of course if it's a FULL running program it will get comments from people wanting you to ADD features. It doesn't matter if they understand how it works or not.My 2c worthJohn Morrison Some of my small contributions to AutoIt Browse for Folder Dialog - Automation SysTreeView32 | FileHippo Download and/or retrieve program information | Get installedpath from uninstall key in registry | RoboCopy function John Morrison aka Storm-E Link to comment Share on other sites More sharing options...
ynbIpb Posted June 15, 2009 Share Posted June 15, 2009 Very good it looks. But how to remove the strip on top? Link to comment Share on other sites More sharing options...
GEOSoft Posted June 15, 2009 Share Posted June 15, 2009 Yeah I know how that feels.I think from observing the board for a while that the small examples get comments because members can quickly try it and comment without a lot of thought. Larger examples don't get comments because they won't take the time to look through the code or they just don't understand it. OR maybe because it takes a while to read anf understand and by the time they have they have moved on past the forum.Of course if it's a FULL running program it will get comments from people wanting you to ADD features. It doesn't matter if they understand how it works or not.My 2c worthJohn MorrisonYou left out the obvious one. If it's posted in Example scripts and I have no use for it then I just ignore the thread totally. George Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.*** The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number. Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else. "Old age and treachery will always overcome youth and skill!" Link to comment Share on other sites More sharing options...
Michel Claveau Posted June 15, 2009 Author Share Posted June 15, 2009 Hi!But how to remove the strip on top?It is abnormal that you have this piece of title...I changed a little trick, for delete your problem. Take again the code of the 1rst message, and try it, please. Link to comment Share on other sites More sharing options...
Michel Claveau Posted June 15, 2009 Author Share Posted June 15, 2009 Hi! > Storm Certain persons look for the efficiency above all. They will have then the behavior which you describe. > Geosoft Your point of view (position?) is, also, on a way of efficience... ***Sorry for my approximative english*** Link to comment Share on other sites More sharing options...
ynbIpb Posted June 17, 2009 Share Posted June 17, 2009 and try it, please.Now all is OK. Thanks Link to comment Share on other sites More sharing options...
mesale0077 Posted June 20, 2009 Share Posted June 20, 2009 hi Line 80 Func _WinAPI_SetLayeredWindowAttributes($hwnd, $i_transcolor, $Transparency = 255, $dwFlages = 0x03, $isColorRef = False) Error:Duplicate function name why dont worked? Link to comment Share on other sites More sharing options...
Michel Claveau Posted June 21, 2009 Author Share Posted June 21, 2009 Hi!Line 80 Func _WinAPI_SetLayeredWindowAttributes($hwnd, $i_transcolor, $Transparency = 255, $dwFlages = 0x03, $isColorRef = False)Error:Duplicate function namewhy dont worked?Perhaps a problem with Copy & Paste? The code run OK for many people. I don't see another explanation. Link to comment Share on other sites More sharing options...
BrettF Posted June 21, 2009 Share Posted June 21, 2009 You must be using the BETA. Remove the functions from Michel's code. Cheers, Brett Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version! Link to comment Share on other sites More sharing options...
mesale0077 Posted June 21, 2009 Share Posted June 21, 2009 hi ı changed WinAPI.au3 in the Include,now no problem but ,"ş,ü,ğ,"İ,Ş,Ü,Ğ," letter is problem and ı changed in the code GUISetFont(48,600), changed but problem GUISetFont(48,600,"Microsoft Sans Serif"), why problem,it cant write ,"ş,ü,ğ,"İ,Ş,Ü,Ğ," not be Link to comment Share on other sites More sharing options...
Michel Claveau Posted June 21, 2009 Author Share Posted June 21, 2009 Hi! If you have Arial-Unicode-MS installed (come with MS-Office), try: GUISetFont(48,600,0,"Arial Unicode MS") @-salutations -- Michel Claveau Link to comment Share on other sites More sharing options...
mesale0077 Posted June 22, 2009 Share Posted June 22, 2009 thank you GUISetFont(48,600,0,"Microsoft Sans Serif") changed no problem,worked nice code Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now