AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

[Tips N Tricks] How to set a 'Tiled background' for GUI ?
Goto page Previous  1, 2, 3 ... 5, 6, 7 ... 31, 32, 33  Next
 
Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions
View previous topic :: View next topic  
Author Message
SKAN



Joined: 26 Dec 2005
Posts: 8688

PostPosted: Fri Jun 16, 2006 5:29 am    Post subject: Reply with quote

Dear Titan, Smile

You wrote:
This version seems to work:
Code:
MsgBox % Connected()

Connected(fl = 0x40) {
   Return, DllCall("Wininet.dll\InternetGetConnectedState", "UInt *", fl, "UInt", 0)
}

However the flags seem to be ignored which is quite strange.


Rolling Eyes Yes! This version works for me.. I am too confused! Rolling Eyes

Regards, Smile


Last edited by SKAN on Mon Jun 16, 2008 6:34 am; edited 1 time in total
Back to top
View user's profile Send private message Send e-mail
Terrapin



Joined: 15 Aug 2005
Posts: 107
Location: North Carolina

PostPosted: Sat Jun 17, 2006 5:31 am    Post subject: Reply with quote

WOW Goyyah! I'm one of the ones guilty Embarassed of not often visiting the other forum so I am just now seeing these, or have missed them somehow anyway, until now. I have noted many excellent and useful posts from you here already though.

I can be very slow Embarassed but I am looking forward a great deal to trying some of these and hope to make use of them. Thank You for your generous contributions!

Bob
Back to top
View user's profile Send private message
corrupt



Joined: 29 Dec 2004
Posts: 2485

PostPosted: Sat Jun 17, 2006 7:16 pm    Post subject: Reply with quote

Terrapin wrote:
WOW Goyyah! I'm one of the ones guilty Embarassed of not often visiting the other forum so I am just now seeing these, or have missed them somehow anyway, until now.
You've probably missed them and only seen the last page since the topic name keeps changing...

@Goyyah: I guess you decided against cleaning up this mess? Sad
Back to top
View user's profile Send private message Visit poster's website
Veovis



Joined: 13 Feb 2006
Posts: 389
Location: Utah

PostPosted: Sun Jun 18, 2006 1:52 am    Post subject: Reply with quote

Absolutely Amazing Goyyah!
You continue to amaze me with your Tips and Tricks. I like how in your little snippet editor you used at least 3 of your tricks. Really shows how powerful and useful they can be. Keep up the good work! I am eagerly waiting for the next installment!
_________________

"Power can be given overnight, but responsibility must be taught. Long years go into its making."
Back to top
View user's profile Send private message Send e-mail Visit poster's website
SKAN



Joined: 26 Dec 2005
Posts: 8688

PostPosted: Wed Jun 21, 2006 12:45 pm    Post subject: Reply with quote

Dear Bob, Smile

You wrote:
WOW Goyyah! I'm one of the ones guilty Embarassed of not often visiting the other forum so I am just now seeing these, or have missed them somehow anyway, until now. I have noted many excellent and useful posts from you here already though.


I understand.. For some time this topic was under forum section: Utilities & Resources and Mr.Chris decided to move it here so that this topic will receive due attention.

Quote:
I can be very slow Embarassed but I am looking forward a great deal to trying some of these and hope to make use of them. Thank you for your generous contributions!


Thanks for the kind words! I was feeling low for sometime. Very Happy

Regards, Smile
_________________
URLGet - Internet Explorer based Downloader
Back to top
View user's profile Send private message Send e-mail
SKAN



Joined: 26 Dec 2005
Posts: 8688

PostPosted: Wed Jun 21, 2006 12:57 pm    Post subject: Reply with quote

corrupt wrote:
Goyyah: I guess you decided against cleaning up this mess? Sad


Dear corrupt, Smile

I am myself a mess - I guess Sad !. The nick Goyyah will die soon. Just a two or three more posts before that. Please bear with me till then.

Veovis wrote:
Absolutely Amazing Goyyah!
You continue to amaze me with your Tips and Tricks. I like how in your little snippet editor you used at least 3 of your tricks. Really shows how powerful and useful they can be. Keep up the good work! I am eagerly waiting for the next installment!


Smile

Dear Veovis, Smile

Thanks for this ... and many thanks for consistently encouraging me. Smile

Smile
_________________
URLGet - Internet Explorer based Downloader
Back to top
View user's profile Send private message Send e-mail
Veovis



Joined: 13 Feb 2006
Posts: 389
Location: Utah

PostPosted: Wed Jun 21, 2006 4:49 pm    Post subject: Reply with quote

Well, im pretty lazy on some abspects of coding. And one of those would be the kind of thing like figuring out how to dynamically write a BMP. No way i would even try. But you did. And its so useful! See my SysInfo 3.0 script.

Also i would never be able to find some of those post message or things you've found, for refreshing things or making a GUI drag itself. So you help me be lazy! Thanks Goyyah! Very Happy

(I also like how you have you tricks and tips as your signature! Its pretty useful as some times i will be reading a different topic and then see your sig)
_________________

"Power can be given overnight, but responsibility must be taught. Long years go into its making."
Back to top
View user's profile Send private message Send e-mail Visit poster's website
corrupt



Joined: 29 Dec 2004
Posts: 2485

PostPosted: Thu Jun 22, 2006 12:36 am    Post subject: Reply with quote

Goyyah wrote:
corrupt wrote:
Goyyah: I guess you decided against cleaning up this mess? Sad


Dear corrupt, Smile

I am myself a mess - I guess Sad !. The nick Goyyah will die soon. Just a two or three more posts before that. Please bear with me till then.

@Goyyah: Please don't misunderstand. I don't want to see you go. I appreciate the useful tips and tricks that you post. The only reason I asked is because I am interested in contributing to the discussions...
Back to top
View user's profile Send private message Visit poster's website
SKAN



Joined: 26 Dec 2005
Posts: 8688

PostPosted: Fri Jun 23, 2006 5:33 pm    Post subject: Reply with quote

Dear corrupt, Smile

You wrote:
@Goyyah: Please don't misunderstand. I don't want to see you go. I appreciate the useful tips and tricks that you post. The only reason I asked is because I am interested in contributing to the discussions...


No! Not at all.. Very Happy

Very Happy You are a nice Friend Very Happy

I do not remember why I posted that way! Maybe I was feeling dejected that day.
It is just that I want to slow down, and be very selective.
I have already opened an another nick.

Regards, Smile
_________________
URLGet - Internet Explorer based Downloader
Back to top
View user's profile Send private message Send e-mail
SKAN



Joined: 26 Dec 2005
Posts: 8688

PostPosted: Fri Jun 23, 2006 5:35 pm    Post subject: Reply with quote

Quote:
How to Animate a GUI Window ?
http://www.autohotkey.com/forum/viewtopic.php?p=65596#65596

Quote:
Foreword: The post is all about DllCall to AnimateWindow function in User32.dll.

MSDN Reference: AnimateWindow Function
Additional Reference: Animate a Window - Real's PB How-to


    AnimateWindow() : The Wrapper for User32.dll\AnimateWindow function.

    Code:
    AnimateWindow(hWnd,Duration,Flag) {
    Return DllCall("AnimateWindow","UInt",hWnd,"Int",Duration,"UInt",Flag)
    }


    AnimateWindow() requires three parameters :

    • Handle to the GUI Window
    • Duration of the Animation (in milliseconds)
    • Animation flag which may be any (or proper combination) of the following :

      Code:
      /*

      Note: Following integers have to be converted to Hex
            before passing as a parameter to AnimateWindow

      1       = Left to Right
      2       = Right to Left
      4       = Top to Bottom
      8       = Bottom to Top
      16      = Center           
      65536   = Hide
      131072  = Show
      262144  = Slide
      524288  = Fade

      */




How to Fade-In / Fade-Out a GUI ? How To Fade In Fade Out a GUI ?

    Copy / Paste / Try example:
Code:
FADE       := 524288
SHOW       := 131072
HIDE       := 65536

FADE_SHOW  := FADE+SHOW
FADE_HIDE  := FADE+HIDE

;Converting the above to Hexdecimal value

SetFormat, Integer, Hex
FADE_SHOW+=0 ; Converts to 0xa0000
FADE_HIDE+=0 ; Converts to 0x90000
SetFormat, Integer, d

Duration = 500 ; Duration of Animation in milliseconds

Gui, Margin, 0,0
Gui +LastFound
GUI_ID:=WinExist() ; Handle to the GUI
Gui,Show,w400 h300 Hide, Animated Window ( Fade-In / Fade-Out )
AnimateWindow(GUI_ID, Duration, FADE_SHOW)
Return

GuiEscape:
GuiClose:
  AnimateWindow(GUI_ID, Duration, FADE_HIDE)
  ExitApp
Return

AnimateWindow(hWnd,Duration,Flag) {
Return DllCall("AnimateWindow","UInt",hWnd,"Int",Duration,"UInt",Flag)
}
    Optimised version of above code:
Code:
Gui, Margin, 0,0
Gui +LastFound
GUI_ID:=WinExist()
Gui,Show,w400 h300 Hide, Animated Window ( Fade-In / Fade-Out )
DllCall("AnimateWindow","UInt",GUI_ID,"Int",500,"UInt","0xa0000")
Return

GuiEscape:
GuiClose:
  DllCall("AnimateWindow","UInt",GUI_ID,"Int",500,"UInt","0x90000")
  ExitApp
Return


We can modify the wrapper's DllCall to be:
DllCall("AnimateWindow", "UInt", hWnd, "Int", Duration, "Int", Flag)
so that we do not have to convert integers into hexdecimal values.

BUT!.. For reasons unknown to me, many transitions are not smooth (or noticeably jittery!) for me.
Please try both and use what suits you.

In case you need one, here is a simple Integer to Hexadecimal convertor
I made for myself to understand this stuff! I calculated the following effects:

Code:
ROLL_LEFT_TO_RIGHT = 0x20001
ROLL_RIGHT_TO_LEFT = 0x20002
ROLL_TOP_TO_BOTTOM = 0x20004
ROLL_BOTTOM_TO_TOP = 0x20008
ROLL_DIAG_TL_TO_BR = 0x20005
ROLL_DIAG_TR_TO_BL = 0x20006
ROLL_DIAG_BL_TO_TR = 0x20009
ROLL_DIAG_BR_TO_TL = 0x2000a
SLIDE_LEFT_TO_RIGHT= 0x40001
SLIDE_RIGHT_TO_LEFT= 0x40002
SLIDE_TOP_TO_BOTTOM= 0x40004
SLIDE_BOTTOM_TO_TOP= 0x40008
SLIDE_DIAG_TL_TO_BR= 0x40005
SLIDE_DIAG_TR_TO_BL= 0x40006
SLIDE_DIAG_BL_TO_TR= 0x40009
SLIDE_DIAG_BR_TO_TL= 0x40010
ZOOM_IN            = 0x16
ZOOM_OUT           = 0x10010
FADE_IN            = 0xa0000
FADE_OUT           = 0x90000


Visit the following post to download & try SlideShow.exe which extensively and effectively
uses the AnimateWindow function:






Edit:

Quote:
Animated SplashImage !

Copy / Paste / Try example: Fade-In / Fade-Out

Code:
IfNotExist, asplash1.gif
 URLDownloadToFile
 , http://autohotkey.net/goyyah/CrazyScripts/SlideShow/asplash1.gif
 , asplash1.gif

Gui, Margin, 0,0
Gui +LastFound
GUI_ID:=WinExist()
Gui, -Caption +AlwaysOnTop +Border
Gui, Add, Picture, , asplash1.gif
Gui,Show, AutoSize Hide, Animated Splash Window - Demo
DllCall("AnimateWindow","UInt",GUI_ID,"Int",500,"UInt","0xa0000")
Sleep 3000
DllCall("AnimateWindow","UInt",GUI_ID,"Int",500,"UInt","0x90000")
ExitApp


Copy / Paste / Try example: Slide-In from left / Slide-Out to right

Code:
IfNotExist, asplash1.gif
 URLDownloadToFile
 , http://autohotkey.net/goyyah/CrazyScripts/SlideShow/asplash1.gif
 , asplash1.gif

Gui, Margin, 0,0
Gui +LastFound
GUI_ID:=WinExist()
Gui, -Caption +AlwaysOnTop +Border
Gui, Add, Picture, , asplash1.gif
Gui,Show, AutoSize Hide, Animated Splash Window - Demo
DllCall("AnimateWindow","UInt",GUI_ID,"Int",1000,"UInt","0x40001")
Sleep 3000
DllCall("AnimateWindow","UInt",GUI_ID,"Int",1000,"UInt","0x50001")
ExitApp




Edit:

Quote:
Animated SplashText!

Copy / Paste / Try example: Slow Scrolling Text

Code:
ScrollText =
(


AutoHotkey is a free, open-source utility for Windows.

With it, you can:

Automate almost anything by sending keystrokes and mouse
clicks. You can write macros by hand or use the macro recorder.

Create hotkeys for keyboard, joystick, and mouse. Virtually any
key, button, or combination can become a hotkey.

Expand abbreviations as you type them. For example, typing "btw"
can automatically produce "by the way".

Create custom data entry forms, user interfaces, and menu bars.

Remap keys and buttons on your keyboard, joystick, and mouse.

Respond to signals from hand-held remote controls via the WinLIRC
client script.

Run existing AutoIt v2 scripts and enhance them with new capabilities.

Convert any script into an EXE file that can be run on computers
that don't have AutoHotkey installed.



)

Gui, Margin, 0,0
Gui +LastFound
GUI_ID:=WinExist()
Gui, -Caption +AlwaysOnTop +Border
Gui, Color, FFFFFF
Gui, Margin, 40, 40
Gui, Font, s12 Bold, Verdana

Gui, Add, Text, x41 y41 c808080 BackGroundTrans, % ScrollText
Gui, Add, Text, x40 y40 c000000 BackGroundTrans, % ScrollText

Gui,Show, AutoSize Hide, Animated Splash Window - Demo

DllCall("AnimateWindow","UInt",GUI_ID,"Int",20000,"UInt","0x40008")
DllCall("AnimateWindow","UInt",GUI_ID,"Int",20000,"UInt","0x50008")
ExitApp


Last edited by SKAN on Mon Jun 16, 2008 6:35 am; edited 3 times in total
Back to top
View user's profile Send private message Send e-mail
wOxxOm



Joined: 09 Feb 2006
Posts: 326

PostPosted: Sat Jun 24, 2006 1:31 pm    Post subject: Reply with quote

As to jerky transition in AnimateWindow, MSDN says that it is possible when "Shadows under menus" are enabled in Display effects options. Also "Drag full windows" may interfere I think
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Laszlo



Joined: 14 Feb 2005
Posts: 4710
Location: Boulder, CO

PostPosted: Sat Jun 24, 2006 2:34 pm    Post subject: Reply with quote

Very nice effects! Thanks!
Goyyah wrote:
we do not have to convert integers into hexadecimal values.
BUT!.. For reasons unknown to me, many transitions are not smooth (or noticeably jittery!) for me.
Since at dll calls AHK passes on integers in binary form, there should be no difference. In my laptop I have not seen any, as expected. Are you sure, there was no other change? You don't need many of your quotation marks, either.
Code:
Gui +LastFound
WinGet GUI_ID, ID
Gui Show, w400 h300 Hide, Animated Window
DllCall("AnimateWindow",UInt,GUI_ID,UInt,750,UInt,0xa0000)
Return

GuiEscape:
GuiClose:
  DllCall("AnimateWindow",UInt,GUI_ID,UInt,750,UInt,0x90000)
ExitApp
Back to top
View user's profile Send private message
SKAN



Joined: 26 Dec 2005
Posts: 8688

PostPosted: Sun Jun 25, 2006 6:51 am    Post subject: Reply with quote

Dear Laszlo, Smile

You wrote:
Since at dll calls AHK passes on integers in binary form, there should be no difference. In my laptop I have not seen any, as expected. Are you sure, there was no other change?


You are right! The jiterring was due to processor load by other running programs. Thank you.

Quote:
You don't need many of your quotation marks, either.


It has become a habit Sad ... I will change it Smile.

Thanks again for posting. Smile

Regards, Smile


Last edited by SKAN on Mon Jun 16, 2008 6:36 am; edited 1 time in total
Back to top
View user's profile Send private message Send e-mail
SKAN



Joined: 26 Dec 2005
Posts: 8688

PostPosted: Sun Jun 25, 2006 9:29 am    Post subject: Reply with quote

Post Updated: Added an example for Slow Scrolling SplashText.

Regards, Smile
_________________
URLGet - Internet Explorer based Downloader
Back to top
View user's profile Send private message Send e-mail
SKAN



Joined: 26 Dec 2005
Posts: 8688

PostPosted: Fri Jun 30, 2006 10:42 am    Post subject: Reply with quote

The following post has been updated:
Regards, Smile
_________________
URLGet - Internet Explorer based Downloader
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions All times are GMT
Goto page Previous  1, 2, 3 ... 5, 6, 7 ... 31, 32, 33  Next
Page 6 of 33

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group