Jump to content

Popup maker


zeroZshadow
 Share

Recommended Posts

well have fun then he :)

i think i'm gonna leave it this way for now.

because i'm totaly focused on the Auto-OS now.

*If u thought life couldn't get worse, u meet me *<guy> What would you give my little sister to unzip ?<friend> 10 bucks<guy> No, i mean like Winzip...
Link to comment
Share on other sites

  • Replies 41
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

well have fun then he :)

i think i'm gonna leave it this way for now.

because i'm totaly focused on the Auto-OS now.

<{POST_SNAPBACK}>

Made it, so if yo want it or can use it (the popup always shows on the tray)

#notrayicon
#include <GUICONSTANTS.au3>
_Popup("hallo daar",2000)

Func _Popup($text,$sleep)
    $winHeigt = 100
    $winWidth = 100
;get the workable area
    $pos = ControlGetPos("Program Manager", "", "SysListView321")
    $x = $pos[0]
    $y = $pos[1]
    $w = $pos[2]
    $h = $pos[3]
    if $x > 0 And $w < @DesktopWidth then 
        $move = "Left"
        $Xpos = 0 - $winWidth
        $Ypos = $h - $winHeigt - 10
        $limit = $winWidth + $x - 5
    ElseIf $y > 0 then
        $move = "Top"
        $Xpos = $w - $winWidth - 10
        $Ypos = 0 - $winHeigt
        $limit = $winHeigt + (@DesktopHeight - $h)
    ElseIf $x = 0 and $y = 0 and $w = @DesktopWidth Then
        $move = "Bottom"
        $Xpos = $w - $winWidth - 10
        $Ypos = $h + (@DesktopHeight - $h)
        $limit = $winHeigt + (@DesktopHeight - $h)
    Else
        $move = "Right"
        $Xpos = $w + $winWidth
        $Ypos = $h - $winHeigt - 10
        $limit = $winWidth + $x + (@DesktopWidth - $w)
    EndIf
    
    $handle = GUICreate("Popup",$winWidth,$winHeigt,$Xpos,$Ypos,0x80040000,0x00000088)
    $label1 = GUICtrlCreateLabel($text,5,10,95,90)
    GUISetState()
    for $i = 1 to $limit step 10
        if $move = "Bottom" Then
            WinMove ( "Popup","",$Xpos,$Ypos - $i)
            sleep(50)
        ElseIf $move = "Left" Then
            WinMove ( "Popup","",$Xpos + $i,$Ypos)
            sleep(50)
        ElseIf $move = "Top" Then
            WinMove ( "Popup","",$Xpos,$Ypos + $i)
            sleep(50)
        ElseIf $move = "Right" Then
            WinMove ( "Popup","",$Xpos - $i,$Ypos)
            sleep(50)
        EndIf
    Next
    sleep($sleep)
    for $i = $limit to 1 step -10
        if $move = "Bottom" Then
            WinMove ( "Popup","",$Xpos,$Ypos - $i)
            sleep(50)
        ElseIf $move = "Left" Then
            WinMove ( "Popup","",$Xpos + $i,$Ypos)
            sleep(50)
        ElseIf $move = "Top" Then
            WinMove ( "Popup","",$Xpos,$Ypos + $i)
            sleep(50)
        ElseIf $move = "Right" Then
            WinMove ( "Popup","",$Xpos - $i,$Ypos)
            sleep(50)
        EndIf
    Next
EndFunc
Link to comment
Share on other sites

Cool, that looks better.

[font="Times"] If anyone remembers me, I am back. Maybe to stay, maybe not.----------------------------------------------------------------------------------------------------------[/font][font="Times"]Things I am proud of: Pong! in AutoIt | SearchbarMy website: F.R.I.E.S.A little website that is trying to get started: http://thepiratelounge.net/ (not mine)[/font][font="Times"] ----------------------------------------------------------------------------------------------------------[/font][font="Arial"]The newbies need to stop stealing avatars!!! It is confusing!![/font]

Link to comment
Share on other sites

for $i = 1 to $limit
        if $move = "Bottom" Then
            WinMove ( $caption,"",$Xpos,$Ypos - $i)
        ElseIf $move = "Left" Then
            WinMove ( $caption,"",$Xpos + $i,$Ypos)
        ElseIf $move = "Top" Then
            WinMove ( $caption,"",$Xpos,$Ypos + $i)
        ElseIf $move = "Right" Then
            WinMove ( $caption,"",$Xpos - $i,$Ypos)
        EndIf
                Sleep(10)
    Next
    sleep($sleep)
    for $i = $limit to 1 Step -1
        if $move = "Bottom" Then
            WinMove ( $caption,"",$Xpos,$Ypos - $i)
        ElseIf $move = "Left" Then
            WinMove ( $caption,"",$Xpos + $i,$Ypos)
        ElseIf $move = "Top" Then
            WinMove ( $caption,"",$Xpos,$Ypos + $i)
        ElseIf $move = "Right" Then
            WinMove ( $caption,"",$Xpos - $i,$Ypos)
        EndIf
        Sleep(10)
    Next

I would change the For...Next loops to the above, this way its alot smoother and more tidy.

Edit: Small 'bug; when you have a word bigger then the popup it goes outside the window, would it be possible if the length is long than the window to split it in half and put a "-" in front of the second half of the word then put that word on the next line?

Posted Image

Edited by Burrup

qq

Link to comment
Share on other sites

Dont worry I done it for you :). Its set to 30 characters, so if a word goes over that it will split it and add the "-", or you could just add a space so it goes to the next line but I thought if it had a "-" people would know that its one word.

#notrayicon
#include <GUICONSTANTS.au3>

_Popup("testing", "Hello, I have just added this string spliter so now it doesnt go off the window =), 123456789012345678901234567890", 3000)

Func _Popup($Caption, $Text, $sleep)
   $winHeigt = 116
   $winWidth = 181
;get the workable area
   $pos = ControlGetPos("Program Manager", "", "SysListView321")
   $x = $pos[0]
   $y = $pos[1]
   $w = $pos[2]
   $h = $pos[3]
   If $x > 0 And $w < @DesktopWidth Then
      $Move = "Left"
      $Xpos = (@DesktopWidth - $w) - $winWidth
      $Ypos = $h - $winHeigt - 10
      $limit = $winWidth
   ElseIf $y > 0 Then
      $Move = "Top"
      $Xpos = $w - $winWidth - 10
      $Ypos = (@DesktopHeight + 5 - $h) - $winHeigt
      $limit = $winHeigt; + (@DesktopHeight - $h) + 5
   ElseIf $x = 0 And $y = 0 And $w = @DesktopWidth Then
      $Move = "Bottom"
      $Xpos = $w - $winWidth - 10
      $Ypos = $h + (@DesktopHeight - $h)
      $limit = $winHeigt + (@DesktopHeight - $h)
   Else
      $Move = "Right"
      $Xpos = $w
      $Ypos = $h - $winHeigt - 10
      $limit = $winWidth + $x
   EndIf
   ConsoleWrite("Barwidth = " & (@DesktopWidth - $w) & @LF)
   ConsoleWrite("limit = " & $limit & @LF)
   
   $handle = GUICreate($Caption, $winWidth, $winHeigt, $Xpos, $Ypos, $WS_POPUP, $WS_EX_TOOLWINDOW);,0x80040000,0x00000088)
   GUICtrlCreatePic("popup.jpg", 0, 0, 181, 116, 0x0100)
   $label0 = GUICtrlCreateLabel($Caption, 15, 4, $winWidth, $winHeigt)
   GUICtrlSetFont($label0, 9, 800, 1)
   $label1 = GUICtrlCreateLabel($Text, 0, 35, $winWidth, $winHeigt, $SS_CENTER)
   GUICtrlSetFont($label1, 9, 800, 2)
;-------------New String Spliter----------
   $Split = StringSplit($Text, " ")
   For $I = 1 To $Split[0]
      $test = $Split[$I]
      $Len = StringLen($test) / 2
      If StringLen($test) >= 30 Then
         $Left = StringLeft($test, $Len)
         $Right = StringRight($test, StringLen($test) - $Len)
         $Word = $Left & "- " & $Right
         $Text = StringReplace($Text, $Split[$I], $Word)
         GUICtrlSetData($label1, $Text)
      EndIf
   Next
;-------------New String Spliter----------
   GUISetState()
   For $I = 1 To $limit
      If $Move = "Bottom" Then
         WinMove($Caption, "", $Xpos, $Ypos - $I)
      ElseIf $Move = "Left" Then
         WinMove($Caption, "", $Xpos + $I, $Ypos)
      ElseIf $Move = "Top" Then
         WinMove($Caption, "", $Xpos, $Ypos + $I)
      ElseIf $Move = "Right" Then
         WinMove($Caption, "", $Xpos - $I, $Ypos)
      EndIf
      Sleep(10)
   Next
   Sleep($sleep)
   For $I = $limit To 1 Step - 1
      If $Move = "Bottom" Then
         WinMove($Caption, "", $Xpos, $Ypos - $I)
      ElseIf $Move = "Left" Then
         WinMove($Caption, "", $Xpos + $I, $Ypos)
      ElseIf $Move = "Top" Then
         WinMove($Caption, "", $Xpos, $Ypos + $I)
      ElseIf $Move = "Right" Then
         WinMove($Caption, "", $Xpos - $I, $Ypos)
      EndIf
      Sleep(10)
   Next
EndFunc
Edited by Burrup

qq

Link to comment
Share on other sites

this is gettin neat guys, but i have some tips for ya.

1) make a invissible button, or a button with the X thingy on the place where the cross is on the popop and put and close func on it.

2) maby an icon in the topleft?? autoit icon would fit perfect there.

3) make an optional parameter to put in a picture as background in the white part, instead of a text. (just leave text empty)

*If u thought life couldn't get worse, u meet me *<guy> What would you give my little sister to unzip ?<friend> 10 bucks<guy> No, i mean like Winzip...
Link to comment
Share on other sites

this is gettin neat guys, but i have some tips for ya.

1) make a invissible button, or a button with the X thingy on the place where the cross is on the popop and put and close func on it.

2) maby an icon in the topleft?? autoit icon would fit perfect there.

3) make an optional parameter to put in a picture as background in the white part, instead of a text. (just leave text empty)

<{POST_SNAPBACK}>

1)By this post, its done: the exit only deletes the gui=> if you want to use this in an app and would use the exit command your app gets closed and we dont want that :)

Will see if i have some time for the other 2 :D

TrayPopUp.zip

Edited by TuMbLeWeEd
Link to comment
Share on other sites

Dont worry I done it for you :). Its set to 30 characters, so if a word goes over that it will split it and add the "-", or you could just add a space so it goes to the next line but I thought if it had a "-" people would know that its one word.

#notrayicon
#include <GUICONSTANTS.au3>

_Popup("testing", "Hello, I have just added this string spliter so now it doesnt go off the window =), 123456789012345678901234567890", 3000)

Func _Popup($Caption, $Text, $sleep)
   $winHeigt = 116
   $winWidth = 181
;get the workable area
   $pos = ControlGetPos("Program Manager", "", "SysListView321")
   $x = $pos[0]
   $y = $pos[1]
   $w = $pos[2]
   $h = $pos[3]
   If $x > 0 And $w < @DesktopWidth Then
      $Move = "Left"
      $Xpos = (@DesktopWidth - $w) - $winWidth
      $Ypos = $h - $winHeigt - 10
      $limit = $winWidth
   ElseIf $y > 0 Then
      $Move = "Top"
      $Xpos = $w - $winWidth - 10
      $Ypos = (@DesktopHeight + 5 - $h) - $winHeigt
      $limit = $winHeigt; + (@DesktopHeight - $h) + 5
   ElseIf $x = 0 And $y = 0 And $w = @DesktopWidth Then
      $Move = "Bottom"
      $Xpos = $w - $winWidth - 10
      $Ypos = $h + (@DesktopHeight - $h)
      $limit = $winHeigt + (@DesktopHeight - $h)
   Else
      $Move = "Right"
      $Xpos = $w
      $Ypos = $h - $winHeigt - 10
      $limit = $winWidth + $x
   EndIf
   ConsoleWrite("Barwidth = " & (@DesktopWidth - $w) & @LF)
   ConsoleWrite("limit = " & $limit & @LF)
   
   $handle = GUICreate($Caption, $winWidth, $winHeigt, $Xpos, $Ypos, $WS_POPUP, $WS_EX_TOOLWINDOW);,0x80040000,0x00000088)
   GUICtrlCreatePic("popup.jpg", 0, 0, 181, 116, 0x0100)
   $label0 = GUICtrlCreateLabel($Caption, 15, 4, $winWidth, $winHeigt)
   GUICtrlSetFont($label0, 9, 800, 1)
   $label1 = GUICtrlCreateLabel($Text, 0, 35, $winWidth, $winHeigt, $SS_CENTER)
   GUICtrlSetFont($label1, 9, 800, 2)
;-------------New String Spliter----------
   $Split = StringSplit($Text, " ")
   For $I = 1 To $Split[0]
      $test = $Split[$I]
      $Len = StringLen($test) / 2
      If StringLen($test) >= 30 Then
         $Left = StringLeft($test, $Len)
         $Right = StringRight($test, StringLen($test) - $Len)
         $Word = $Left & "- " & $Right
         $Text = StringReplace($Text, $Split[$I], $Word)
         GUICtrlSetData($label1, $Text)
      EndIf
   Next
;-------------New String Spliter----------
   GUISetState()
   For $I = 1 To $limit
      If $Move = "Bottom" Then
         WinMove($Caption, "", $Xpos, $Ypos - $I)
      ElseIf $Move = "Left" Then
         WinMove($Caption, "", $Xpos + $I, $Ypos)
      ElseIf $Move = "Top" Then
         WinMove($Caption, "", $Xpos, $Ypos + $I)
      ElseIf $Move = "Right" Then
         WinMove($Caption, "", $Xpos - $I, $Ypos)
      EndIf
      Sleep(10)
   Next
   Sleep($sleep)
   For $I = $limit To 1 Step - 1
      If $Move = "Bottom" Then
         WinMove($Caption, "", $Xpos, $Ypos - $I)
      ElseIf $Move = "Left" Then
         WinMove($Caption, "", $Xpos + $I, $Ypos)
      ElseIf $Move = "Top" Then
         WinMove($Caption, "", $Xpos, $Ypos + $I)
      ElseIf $Move = "Right" Then
         WinMove($Caption, "", $Xpos - $I, $Ypos)
      EndIf
      Sleep(10)
   Next
EndFunc

<{POST_SNAPBACK}>

nice....my sytem has dual monitors and the popup window slides in from bottom right corner of monitor 2(not monitor 1 where the tray is)
[u]Do more with pre-existing apps![/u]ANYGUIv2.8
Link to comment
Share on other sites

nice....my sytem has dual monitors and the popup window slides in from bottom right corner of monitor 2(not monitor 1 where the tray is)

<{POST_SNAPBACK}>

Now i dont have a dual monitor setup

Made a possible fix, try it

Edit: gives other problems. Have to find a way to get te resolution of the first monitor instead of using the @DesktopWidth. Now its gettng the total width of your 2 monitors i asume!

Dous anybody know how to get that?

Found somthing, is this at the same location with your dual monitor setup?

[HKEY_CURRENT_CONFIG\System\CurrentControlSet\Control\VIDEO\{F2DF7180-ACA1-456F-819F-90A241685CCF}\0000\Mon00000110]

"Attach.ToDesktop"=dword:00000001

"DefaultSettings.BitsPerPel"=dword:00000020

"DefaultSettings.XResolution"=dword:00000578 ;=1400

"DefaultSettings.YResolution"=dword:0000041a ;=1050

"DefaultSettings.VRefresh"=dword:0000003c

"DefaultSettings.Flags"=dword:00000000

"DefaultSettings.XPanning"=dword:00000000

"DefaultSettings.YPanning"=dword:00000000

"DefaultSettings.Orientation"=dword:00000000

"DefaultSettings.FixedOutput"=dword:00000000

"Attach.RelativeX"=dword:00000000

"Attach.RelativeY"=dword:00000000

TrayPopUp.zip

Edited by TuMbLeWeEd
Link to comment
Share on other sites

I have dual monitors but it doesn't show on my second its on my first. Strange... maybe it's because i have a laptop? But why would that matter?

[font="Times"] If anyone remembers me, I am back. Maybe to stay, maybe not.----------------------------------------------------------------------------------------------------------[/font][font="Times"]Things I am proud of: Pong! in AutoIt | SearchbarMy website: F.R.I.E.S.A little website that is trying to get started: http://thepiratelounge.net/ (not mine)[/font][font="Times"] ----------------------------------------------------------------------------------------------------------[/font][font="Arial"]The newbies need to stop stealing avatars!!! It is confusing!![/font]

Link to comment
Share on other sites

When i'm at home i plug in another.

[font="Times"] If anyone remembers me, I am back. Maybe to stay, maybe not.----------------------------------------------------------------------------------------------------------[/font][font="Times"]Things I am proud of: Pong! in AutoIt | SearchbarMy website: F.R.I.E.S.A little website that is trying to get started: http://thepiratelounge.net/ (not mine)[/font][font="Times"] ----------------------------------------------------------------------------------------------------------[/font][font="Arial"]The newbies need to stop stealing avatars!!! It is confusing!![/font]

Link to comment
Share on other sites

i made the background support for ya :)

#notrayicon
Opt("GuiOnEventMode",1)
#include <GUICONSTANTS.au3>
_Popup("Custom Title","This is looking neet",3000,"logo.jpg")

Func _Popup($caption,$text,$sleep,$background)
    $winHeigt = 116
    $winWidth = 181
;get the workable area
    $pos = ControlGetPos("Program Manager", "", "SysListView321")
    $x = $pos[0]
    $y = $pos[1]
    $w = $pos[2]
    $h = $pos[3]
    if $x > 0 And $w < @DesktopWidth then 
        $move = "Left"
        $Xpos = (@DesktopWidth - $w) - $winWidth
        $Ypos = $h - $winHeigt - 10
        $limit = $winWidth
    ElseIf $y > 0 then
        $move = "Top"
        $Xpos = $w - $winWidth - 10
        $Ypos = (@DesktopHeight + 5 - $h) - $winHeigt
        $limit = $winHeigt; + (@DesktopHeight - $h) + 5
    ElseIf $x = 0 and $y = 0 and $w = @DesktopWidth Then
        $move = "Bottom"
        $Xpos = $w - $winWidth - 10
        $Ypos = $h + (@DesktopHeight - $h)
        $limit = $winHeigt + (@DesktopHeight - $h)
    Else
        $move = "Right"
        $Xpos = $w
        $Ypos = $h - $winHeigt - 10
        $limit = $winWidth + $x
    EndIf
    ConsoleWrite("Barwidth = " & (@DesktopWidth - $w) &@LF)
    ConsoleWrite("limit = " & $limit & @lf  )
    
    Global $handle = GUICreate($caption,$winWidth,$winHeigt,$Xpos,$Ypos,$WS_POPUP,$WS_EX_TOOLWINDOW);,0x80040000,0x00000088)
    $back = GUICtrlCreatePic ("popup.jpg",0,0,181,116,0x0100)
    $Xtra = GUICtrlCreatePic ($background,3,25,175,88,0x0100)
    GUICtrlSetState($back,$GUI_DISABLE )
    $EXIT = GUICtrlCreatePic ("exit.jpg",160,4,15,15,0x0100 )
    GuiCtrlSetOnEvent($Exit,"_Exit")
    $label0 = GUICtrlCreateLabel($caption,15,4,$winWidth,$winHeigt)
    GUICtrlSetFont ($label0, 9,800, 1 )
    $label1 = GUICtrlCreateLabel($text,0,35,$winWidth,$winHeigt,$SS_CENTER)
    GUICtrlSetFont ($label1, 9,800, 2 )
;-------------New String Spliter----------
   $Split = StringSplit($Text, " ")
   For $I = 1 To $Split[0]
      $test = $Split[$I]
      $Len = StringLen($test) / 2
      If StringLen($test) >= 30 Then
         $Left = StringLeft($test, $Len)
         $Right = StringRight($test, StringLen($test) - $Len)
         $Word = $Left & "- " & $Right
         $Text = StringReplace($Text, $Split[$I], $Word)
         GUICtrlSetData($label1, $Text)
      EndIf
   Next
;-------------New String Spliter----------
    GUISetState()
    for $i = 1 to $limit step 10
        if $move = "Bottom" Then
            WinMove ( $caption,"",$Xpos,$Ypos - $i)
        ElseIf $move = "Left" Then
            WinMove ( $caption,"",$Xpos + $i,$Ypos)
        ElseIf $move = "Top" Then
            WinMove ( $caption,"",$Xpos,$Ypos + $i)
        ElseIf $move = "Right" Then
            WinMove ( $caption,"",$Xpos - $i,$Ypos)
        EndIf
        sleep(50)
    Next
    sleep($sleep)
    for $i = $limit to 1 step -10
        if $move = "Bottom" Then
            WinMove ( $caption,"",$Xpos,$Ypos - $i)
        ElseIf $move = "Left" Then
            WinMove ( $caption,"",$Xpos + $i,$Ypos)
        ElseIf $move = "Top" Then
            WinMove ( $caption,"",$Xpos,$Ypos + $i)
        ElseIf $move = "Right" Then
            WinMove ( $caption,"",$Xpos - $i,$Ypos)
        EndIf
        sleep(50)
    Next
EndFunc

Func _Exit()
    GUIDelete($handle)
EndFunc

see the $background

btw for the dual monitors, maby u can use the ENV command??

*If u thought life couldn't get worse, u meet me *<guy> What would you give my little sister to unzip ?<friend> 10 bucks<guy> No, i mean like Winzip...
Link to comment
Share on other sites

Think i found a dirty solution, i now the resolution is found at the keynames:

DefaultSettings.XResolution and DefaultSettings.YResolution

Now the keys are located on different locations on other pc's

Now thats the case with my WinXP and WIn2000 pc

Made a very crappy reg searcher for that, but it works on my 2 pc's

#notrayicon
Opt("GuiOnEventMode",1)
Opt("WinTitleMatchMode", 4) 
#include <GUICONSTANTS.au3>
_Popup("Custom Title","This is looking neet",3000,"logo.jpg")

Func _Popup($caption,$text,$sleep,$background)
    $ScreenWidth = _RegFinder("DefaultSettings.XResolution","HKEY_CURRENT_CONFIG\System\CurrentControlSet\")
    $screenHeigth = _RegFinder("DefaultSettings.YResolution","HKEY_CURRENT_CONFIG\System\CurrentControlSet\")
    $winHeigt = 116
    $winWidth = 181
;get the workable area
    $posTray = ControlGetPos("classname=Shell_TrayWnd", "", "TrayNotifyWnd1")
    $pos = ControlGetPos("Program Manager", "", "SysListView321")
    $x = $pos[0]
    $y = $pos[1]
    $w = $posTray[0] + $posTray[2];$pos[2]
    $h = $pos[3]
    if $x > 0 And $w < $ScreenWidth then 
        $move = "Left"
        $Xpos = ($ScreenWidth - $w) - $winWidth
        $Ypos = $h - $winHeigt - 10
        $limit = $winWidth
    ElseIf $y > 0 then
        $move = "Top"
        $Xpos = $w - $winWidth - 10
        $Ypos = ($screenHeigth + 5 - $h) - $winHeigt
        $limit = $winHeigt; + (@DesktopHeight - $h) + 5
    ElseIf $x = 0 and $y = 0 and $w = $ScreenWidth Then
        $move = "Bottom"
        $Xpos = $w - $winWidth - 10
        $Ypos = $h + ($screenHeigth - $h)
        $limit = $winHeigt + ($screenHeigth - $h)
    Else
        $move = "Right"
        $Xpos = $w
        $Ypos = $h - $winHeigt - 10
        $limit = $winWidth + $x
    EndIf
    ConsoleWrite("Barwidth = " & ($ScreenWidth - $w) &@LF)
    ConsoleWrite("limit = " & $limit & @lf  )
    
    Global $handle = GUICreate($caption,$winWidth,$winHeigt,$Xpos,$Ypos,$WS_POPUP,$WS_EX_TOOLWINDOW);,0x80040000,0x00000088)
    $back = GUICtrlCreatePic ("popup.jpg",0,0,181,116,0x0100)
    $Xtra = GUICtrlCreatePic ($background,3,25,175,88,0x0100)
    GUICtrlSetState($back,$GUI_DISABLE )
    $EXIT = GUICtrlCreatePic ("exit.jpg",160,4,15,15,0x0100 )
    GuiCtrlSetOnEvent($Exit,"_Exit")
    $label0 = GUICtrlCreateLabel($caption,15,4,$winWidth,$winHeigt)
    GUICtrlSetFont ($label0, 9,800, 1 )
    $label1 = GUICtrlCreateLabel($text,0,35,$winWidth,$winHeigt,$SS_CENTER)
    GUICtrlSetFont ($label1, 9,800, 2 )
;-------------New String Spliter----------
   $Split = StringSplit($Text, " ")
   For $I = 1 To $Split[0]
      $test = $Split[$I]
      $Len = StringLen($test) / 2
      If StringLen($test) >= 30 Then
         $Left = StringLeft($test, $Len)
         $Right = StringRight($test, StringLen($test) - $Len)
         $Word = $Left & "- " & $Right
         $Text = StringReplace($Text, $Split[$I], $Word)
         GUICtrlSetData($label1, $Text)
      EndIf
   Next
;-------------New String Spliter----------
    GUISetState()
    for $i = 1 to $limit step 10
        if $move = "Bottom" Then
            WinMove ( $caption,"",$Xpos,$Ypos - $i)
        ElseIf $move = "Left" Then
            WinMove ( $caption,"",$Xpos + $i,$Ypos)
        ElseIf $move = "Top" Then
            WinMove ( $caption,"",$Xpos,$Ypos + $i)
        ElseIf $move = "Right" Then
            WinMove ( $caption,"",$Xpos - $i,$Ypos)
        EndIf
        sleep(50)
    Next
    sleep($sleep)
    for $i = $limit to 1 step -10
        if $move = "Bottom" Then
            WinMove ( $caption,"",$Xpos,$Ypos - $i)
        ElseIf $move = "Left" Then
            WinMove ( $caption,"",$Xpos + $i,$Ypos)
        ElseIf $move = "Top" Then
            WinMove ( $caption,"",$Xpos,$Ypos + $i)
        ElseIf $move = "Right" Then
            WinMove ( $caption,"",$Xpos - $i,$Ypos)
        EndIf
        sleep(50)
    Next
EndFunc

Func _RegFinder($keyToFind,$StartIn)
    consolewrite($keyToFind & @lf)
    $var = _get_keys($StartIn,$keyToFind)
    $var = regread($testkey ,$keyToFind)
    Return $var 
EndFunc

Func _get_keys($key,$keyToFind)
    Global $testkey
    Dim $varArray[1]
    $i = 1
    Do
        $var = RegEnumKey($key, $i)
        If $var <> "" Then
            $x = 1
            Do
                $test = RegEnumVal($key, $x)
                $x = $x + 1
            Until $test = "" or $test = $keyToFind
            If $test = $keyToFind Then
                $testkey = $key
                return $test
                ExitLoop 2
            EndIf
            $varArray[$i - 1] = $key  & $var & "\"
            $var = _get_keys($varArray[$i - 1],$keyToFind)
            If $var = $keyToFind Then
                return $var
                ExitLoop 2
            EndIf
            $i = $i + 1
            Redim $varArray[$i]
        EndIf
    Until $var = ""
    Return $varArray
EndFunc

Func _Exit()
    GUIDelete($handle)
EndFunc

Hope it works for yours :)

Edited by TuMbLeWeEd
Link to comment
Share on other sites

u made some mistakes, because now the popup comes from the sides here.

i have 1 monitor, and the traybar is below.

Edit: when i put my bar in the left, the pop is comming from the right XD

i think you made some errors here man

p.s. does the $background works good??

Edited by zeroZshadow
*If u thought life couldn't get worse, u meet me *<guy> What would you give my little sister to unzip ?<friend> 10 bucks<guy> No, i mean like Winzip...
Link to comment
Share on other sites

u made some mistakes, because now the popup comes from the sides here.

i have 1 monitor, and the traybar is below.

Edit: when i put my bar in the left, the pop is comming from the right XD

i think you made some errors here man

p.s. does the $background works good??

<{POST_SNAPBACK}>

Damn :D:D

Maybe my crappy regread dous not work ok, put some consolewrites to chek for the values returned by:

$ScreenWidth = _RegFinder("DefaultSettings.XResolution","HKEY_CURRENT_CONFIG\System\CurrentControlSet\")

$screenHeigth = _RegFinder("DefaultSettings.YResolution","HKEY_CURRENT_CONFIG\System\CurrentControlSet\")

and check those with your Resolution

I think the problem is located there

EDIT: fixed it, i looked over somthing

the $w = $posTray[0] + $posTray[2] returns on some pc's a value of +- 4 pix smaler then the sreenwidth

BTW: the background works like a charm :huh:

EDIT: fucked up again, left and richt do strange stuff (looking in to that, so dont use the code)

LAST EDIT: fixed again (all "SHOULD :) " work now)

NOW REAL LAST EDIT:assumed problem dualmonitor obove each other possebly fixed

#notrayicon
Opt("GuiOnEventMode",1)
Opt("WinTitleMatchMode", 4) 
#include <GUICONSTANTS.au3>
_Popup("Custom Title","This is looking neet",3000,"logo.jpg")

Func _Popup($caption,$text,$sleep,$background)
    $ScreenWidth = _RegFinder("DefaultSettings.XResolution","HKEY_CURRENT_CONFIG\System\CurrentControlSet\")
    $screenHeigth = _RegFinder("DefaultSettings.YResolution","HKEY_CURRENT_CONFIG\System\CurrentControlSet\")
    ConsoleWrite("Width = " & $ScreenWidth & @LF)
    ConsoleWrite("Heigth = " & $screenHeigth & @LF)
    $winHeigt = 116
    $winWidth = 181
;get the workable area
    $posTray = ControlGetPos("classname=Shell_TrayWnd", "", "TrayNotifyWnd1")
    $pos = ControlGetPos("Program Manager", "", "SysListView321")
    $x = $pos[0]
    $y = $pos[1]
    $w = $pos[2]
    $h = $pos[3]
    ConsoleWrite("$x = " & $x & @LF)
    ConsoleWrite("$y = " & $y & @LF)
    ConsoleWrite("$w = " & $w & @LF)
    ConsoleWrite("$h = " & $h & @LF)
    if $x > 0 And $w < $ScreenWidth then 
        $move = "Left"
        $Xpos = ($ScreenWidth - $w) - $winWidth
        $Ypos = $h - $winHeigt - 10
        $limit = $winWidth
    ElseIf $x = 0 And $w < $ScreenWidth then
        $move = "Right"
        $Xpos = $w
        $Ypos = $h - $winHeigt - 10
        $limit = $winWidth + $x
    ElseIf $x = 0 and $y = 0 and $w > $ScreenWidth -10 Then
        $move = "Bottom"
        $w = $posTray[0] + $posTray[2]
        $Xpos = $w - $winWidth - 10
        $Ypos = $h + ($screenHeigth - $h)
        $limit = $winHeigt + ($screenHeigth - $h)
    Else
        $move = "Top"
        $w = $posTray[0] + $posTray[2]
        $Xpos = $w - $winWidth - 10
        $Ypos = ($screenHeigth + 5 - $h) - $winHeigt
        $limit = $winHeigt
    EndIf
    ConsoleWrite("Location:" & $move &@LF)
    ConsoleWrite("Barwidth = " & ($ScreenWidth - $w) &@LF)
    ConsoleWrite("limit = " & $limit & @lf  )
    
    Global $handle = GUICreate($caption,$winWidth,$winHeigt,$Xpos,$Ypos,$WS_POPUP,$WS_EX_TOOLWINDOW);,0x80040000,0x00000088)
    $back = GUICtrlCreatePic ("popup.jpg",0,0,181,116,0x0100)
    $Xtra = GUICtrlCreatePic ($background,3,25,175,88,0x0100)
    GUICtrlSetState($back,$GUI_DISABLE )
    $EXIT = GUICtrlCreatePic ("exit.jpg",160,4,15,15,0x0100 )
    GuiCtrlSetOnEvent($Exit,"_Exit")
    $label0 = GUICtrlCreateLabel($caption,15,4,$winWidth,$winHeigt)
    GUICtrlSetFont ($label0, 9,800, 1 )
    $label1 = GUICtrlCreateLabel($text,0,35,$winWidth,$winHeigt,$SS_CENTER)
    GUICtrlSetFont ($label1, 9,800, 2 )
;-------------New String Spliter----------
   $Split = StringSplit($Text, " ")
   For $I = 1 To $Split[0]
      $test = $Split[$I]
      $Len = StringLen($test) / 2
      If StringLen($test) >= 30 Then
         $Left = StringLeft($test, $Len)
         $Right = StringRight($test, StringLen($test) - $Len)
         $Word = $Left & "- " & $Right
         $Text = StringReplace($Text, $Split[$I], $Word)
         GUICtrlSetData($label1, $Text)
      EndIf
   Next
;-------------New String Spliter----------
    GUISetState()
    for $i = 1 to $limit step 10
        if $move = "Bottom" Then
            WinMove ( $caption,"",$Xpos,$Ypos - $i)
        ElseIf $move = "Left" Then
            WinMove ( $caption,"",$Xpos + $i,$Ypos)
        ElseIf $move = "Top" Then
            WinMove ( $caption,"",$Xpos,$Ypos + $i)
        ElseIf $move = "Right" Then
            WinMove ( $caption,"",$Xpos - $i,$Ypos)
        EndIf
        sleep(50)
    Next
    sleep($sleep)
    for $i = $limit to 1 step -10
        if $move = "Bottom" Then
            WinMove ( $caption,"",$Xpos,$Ypos - $i)
        ElseIf $move = "Left" Then
            WinMove ( $caption,"",$Xpos + $i,$Ypos)
        ElseIf $move = "Top" Then
            WinMove ( $caption,"",$Xpos,$Ypos + $i)
        ElseIf $move = "Right" Then
            WinMove ( $caption,"",$Xpos - $i,$Ypos)
        EndIf
        sleep(50)
    Next
EndFunc

Func _RegFinder($keyToFind,$StartIn)
    consolewrite($keyToFind & @lf)
    $var = _get_keys($StartIn,$keyToFind)
    $var = regread($testkey ,$keyToFind)
    Return $var 
EndFunc

Func _get_keys($key,$keyToFind)
    Global $testkey
    Dim $varArray[1]
    $i = 1
    Do
        $var = RegEnumKey($key, $i)
        If $var <> "" Then
            $x = 1
            Do
                $test = RegEnumVal($key, $x)
                $x = $x + 1
            Until $test = "" or $test = $keyToFind
            If $test = $keyToFind Then
                $testkey = $key
                return $test
                ExitLoop 2
            EndIf
            $varArray[$i - 1] = $key  & $var & "\"
            $var = _get_keys($varArray[$i - 1],$keyToFind)
            If $var = $keyToFind Then
                return $var
                ExitLoop 2
            EndIf
            $i = $i + 1
            Redim $varArray[$i]
        EndIf
    Until $var = ""
    Return $varArray
EndFunc

Func _Exit()
    GUIDelete($handle)
EndFunc
Edited by TuMbLeWeEd
Link to comment
Share on other sites

Added about 3 lines for a colour parametre. Now you can have the text any colour you want :).

#notrayicon
Opt("GuiOnEventMode",1)
Opt("WinTitleMatchMode", 4)
#include <GUICONSTANTS.au3>
_Popup("Custom Title","This is looking neet",3000,"close.bmp", 0xFF0000)

Func _Popup($caption,$text,$sleep,$background,$colour)
    $ScreenWidth = _RegFinder("DefaultSettings.XResolution","HKEY_CURRENT_CONFIG\System\CurrentControlSet\")
    $screenHeigth = _RegFinder("DefaultSettings.YResolution","HKEY_CURRENT_CONFIG\System\CurrentControlSet\")
    ConsoleWrite("Width = " & $ScreenWidth & @LF)
    ConsoleWrite("Heigth = " & $screenHeigth & @LF)
    $winHeigt = 116
    $winWidth = 181
;get the workable area
    $posTray = ControlGetPos("classname=Shell_TrayWnd", "", "TrayNotifyWnd1")
    $pos = ControlGetPos("Program Manager", "", "SysListView321")
    $x = $pos[0]
    $y = $pos[1]
    $w = $pos[2]
    $h = $pos[3]
    ConsoleWrite("$x = " & $x & @LF)
    ConsoleWrite("$y = " & $y & @LF)
    ConsoleWrite("$w = " & $w & @LF)
    ConsoleWrite("$h = " & $h & @LF)
    if $x > 0 And $w < $ScreenWidth then
        $move = "Left"
        $Xpos = ($ScreenWidth - $w) - $winWidth
        $Ypos = $h - $winHeigt - 10
        $limit = $winWidth
    ElseIf $x = 0 And $w < $ScreenWidth then
        $move = "Right"
        $Xpos = $w
        $Ypos = $h - $winHeigt - 10
        $limit = $winWidth + $x
    ElseIf $x = 0 and $y = 0 and $w > $ScreenWidth -10 Then
        $move = "Bottom"
        $w = $posTray[0] + $posTray[2]
        $Xpos = $w - $winWidth - 10
        $Ypos = $h + ($screenHeigth - $h)
        $limit = $winHeigt + ($screenHeigth - $h)
    Else
        $move = "Top"
        $w = $posTray[0] + $posTray[2]
        $Xpos = $w - $winWidth - 10
        $Ypos = ($screenHeigth + 5 - $h) - $winHeigt
        $limit = $winHeigt
    EndIf
    ConsoleWrite("Location:" & $move &@LF)
    ConsoleWrite("Barwidth = " & ($ScreenWidth - $w) &@LF)
    ConsoleWrite("limit = " & $limit & @lf  )
    
    Global $handle = GUICreate($caption,$winWidth,$winHeigt,$Xpos,$Ypos,$WS_POPUP,$WS_EX_TOOLWINDOW);,0x80040000,0x00000088)
    $back = GUICtrlCreatePic ("popup.jpg",0,0,181,116,0x0100)
    $Xtra = GUICtrlCreatePic ($background,3,25,175,88,0x0100)
    GUICtrlSetState($back,$GUI_DISABLE )
    $EXIT = GUICtrlCreatePic ("exit.jpg",160,4,15,15,0x0100 )
    GuiCtrlSetOnEvent($Exit,"_Exit")
    $label0 = GUICtrlCreateLabel($caption,15,4,$winWidth,$winHeigt)
    GUICtrlSetFont ($label0, 9,800, 1 )
    GUICtrlSetColor ($label0, $colour)
    $label1 = GUICtrlCreateLabel($text,0,35,$winWidth,$winHeigt,$SS_CENTER)
    GUICtrlSetFont ($label1, 9,800, 2 )
    GUICtrlSetColor ($label1, $colour)
;-------------New String Spliter----------
   $Split = StringSplit($Text, " ")
   For $I = 1 To $Split[0]
      $test = $Split[$I]
      $Len = StringLen($test) / 2
      If StringLen($test) >= 30 Then
         $Left = StringLeft($test, $Len)
         $Right = StringRight($test, StringLen($test) - $Len)
         $Word = $Left & "- " & $Right
         $Text = StringReplace($Text, $Split[$I], $Word)
         GUICtrlSetData($label1, $Text)
      EndIf
   Next
;-------------New String Spliter----------
    GUISetState()
    for $i = 1 to $limit step 10
        if $move = "Bottom" Then
            WinMove ( $caption,"",$Xpos,$Ypos - $i)
        ElseIf $move = "Left" Then
            WinMove ( $caption,"",$Xpos + $i,$Ypos)
        ElseIf $move = "Top" Then
            WinMove ( $caption,"",$Xpos,$Ypos + $i)
        ElseIf $move = "Right" Then
            WinMove ( $caption,"",$Xpos - $i,$Ypos)
        EndIf
        sleep(50)
    Next
    sleep($sleep)
    for $i = $limit to 1 step -10
        if $move = "Bottom" Then
            WinMove ( $caption,"",$Xpos,$Ypos - $i)
        ElseIf $move = "Left" Then
            WinMove ( $caption,"",$Xpos + $i,$Ypos)
        ElseIf $move = "Top" Then
            WinMove ( $caption,"",$Xpos,$Ypos + $i)
        ElseIf $move = "Right" Then
            WinMove ( $caption,"",$Xpos - $i,$Ypos)
        EndIf
        sleep(50)
    Next
EndFunc

Func _RegFinder($keyToFind,$StartIn)
    consolewrite($keyToFind & @lf)
    $var = _get_keys($StartIn,$keyToFind)
    $var = regread($testkey ,$keyToFind)
    Return $var 
EndFunc

Func _get_keys($key,$keyToFind)
    Global $testkey
    Dim $varArray[1]
    $i = 1
    Do
        $var = RegEnumKey($key, $i)
        If $var <> "" Then
            $x = 1
            Do
                $test = RegEnumVal($key, $x)
                $x = $x + 1
            Until $test = "" or $test = $keyToFind
            If $test = $keyToFind Then
                $testkey = $key
                return $test
                ExitLoop 2
            EndIf
            $varArray[$i - 1] = $key  & $var & "\"
            $var = _get_keys($varArray[$i - 1],$keyToFind)
            If $var = $keyToFind Then
                return $var
                ExitLoop 2
            EndIf
            $i = $i + 1
            Redim $varArray[$i]
        EndIf
    Until $var = ""
    Return $varArray
EndFunc

Func _Exit()
    GUIDelete($handle)
EndFunc
Edited by Burrup

qq

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...