Advertisement
19leo82

Script

May 1st, 2022
2,171
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ;****************************************************************************************************************************************************************************
  2. #Include c:\pradeep\gdip.autohotkey ;<My Altered GDIP lib> ;<<<<<<<<<<<<<<<<<<---------------------------     gdip.ahk
  3. ;~ #Include <PopUpWindow_V2> ; At the bottom of the script
  4. ;****************************************************************************************************************************************************************************
  5. #SingleInstance, Force
  6. SetBatchLines, -1
  7. Gdip_Startup()
  8. return
  9.  
  10. *ESC::ExitApp
  11.  
  12. ;~ RALT::PopUpWindow.Helper()
  13.  
  14. ;*******************________________************************__________________*****************_______________*************
  15. ;                                                               Create a New InstaNote
  16. ~m & n::   
  17.     CoordMode, Mouse, Screen
  18.     MouseGetPos, x , y
  19.     obj := { X: x , Y: y , FontSize: 20 }
  20.     New InstaNote( obj )
  21.     return
  22. ;*******************________________************************__________________*****************_______________*************
  23. ;                                                       Create a New InstaNote from your Clipboard ( text )
  24. ;!c::
  25.     CoordMode, Mouse, Screen
  26.     MouseGetPos, x , y
  27.     obj := { X:                 x
  28.            , Y:                 y
  29.            , FontSize:         16
  30.            , Color:             "0xFFCDCDCD"
  31.            , BorderColor:       "0xFF000000"
  32.            , FontColor:         "0xFF000000"
  33.            , Font:              "Comic Sans MS" }
  34.     New InstaNote( obj , Option := 1 )
  35.     return
  36. ;*******************________________************************__________________*****************_______________*************
  37. ;                                                               Copy the InstaNote into your Clipboard ( text )
  38. ;!v::
  39.     InstaNote.SetClipboard()
  40.     return
  41.  
  42. ;*******************________________************************__________________*****************_______________*************
  43. ;                                                       Create a New Google Search InstaNote
  44. #s::
  45.     CoordMode, Mouse, Screen
  46.     MouseGetPos, x , y
  47.     obj :=  { Type:             "GoogleSearch"          ;<<<<-----------  run Google Search by closing the InstaNote or pressing enter while it is active
  48.             , X:                x
  49.             , Y:                y
  50.             , FontSize:         32
  51.             , Color:            "0xFFFF0000"
  52.             , BorderColor:     "0xFF99FF00"
  53.             , FontColor:       "0xFFFFFF00"
  54.             , Font:             "Comic Sans MS" }
  55.     New InstaNote( obj )
  56.     return 
  57.  
  58. ;*******************________________************************__________________*****************_______________*************
  59. ;                                                                   InstaNote Class
  60. ;####################################################################################################################################################################################
  61. ;####################################################################################################################################################################################
  62. ;####################################################################################################################################################################################
  63. ;####################################################################################################################################################################################
  64. class InstaNote {
  65.     ;Written By: Hellbent
  66.     ;Date Started: Mar 29th, 2022
  67.     ;Date of last edit: Mar 29th, 2022
  68.     ;Current Version: v1.1
  69.     ;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  70.     ;Prototype:
  71.     ;               obj := { X: x , Y: y , FontSize: 32 , Color: "0x01999900" , BorderColor: "0xFFFF0000" , FontColor: "0xFFFFff00" , Font: "Comic Sans MS" }
  72.     ;               New InstaNote( obj , Option := 0 ) ; 0 = default , 1 = create from clipboard ( text )
  73.     ;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  74.     static Index := 0 , Windows := [] , Handles := [] , Active := 1 , FontSize := 12 , Font := "Segoe UI"
  75.     __New( obj := "" , Option := 0 ){
  76.         if( !InstaNote.Index ){
  77.             InstaNote.Bind := ObjBindMethod( InstaNote , "_LButtonHK" )
  78.             OnMessage( 0x100 , InstaNote[ "_CaptureKeys" ].Bind( InstaNote ) )
  79.             OnMessage( 0x205 , InstaNote[ "_CloseWindow" ].Bind( InstaNote ) )
  80.             OnMessage( 0x201 , InstaNote[ "_MoveWindow" ].Bind( InstaNote ) )
  81.             OnMessage( 0x020A , InstaNote[ "_WheelChange" ].Bind( InstaNote ) )
  82.         }
  83.         if( InstaNote.Windows[ InstaNote.Index ].Output[ 1 ]  = "" ){
  84.             InstaNote.Handles[ InstaNote.Windows[ InstaNote.Index ].Gui1.Hwnd ] := ""
  85.             InstaNote.Windows[ InstaNote.Index ].Gui1.DeleteWindow()
  86.             InstaNote.Windows[ InstaNote.Index ] := ""
  87.         }
  88.         This._SetDefaults()
  89.         This._UpdateDefaults( obj , Option )
  90.         This._CreateWindow()
  91.         This._AddControls()
  92.         This._Draw()
  93.         This.Index := ++InstaNote.Index
  94.         InstaNote.Windows[ InstaNote.Index ] := This
  95.         InstaNote.Handles[ This.Gui1.Hwnd ] := This
  96.         InstaNote.Active := This.Gui1.Hwnd
  97.         return InstaNote.Handles[ This.Gui1.Hwnd ] , This := ""
  98.     }
  99.     _SetDefaults(){
  100.         This.X                  := 10                       , This.Y                    := 10
  101.         This.W                  := 30                       , This.H                    := 10
  102.         This.LastH              := 10                       , This.RoundNess            := 15
  103.         This.Color              := "0xFFFFFFFF"             , This.BorderColor          := "0xff000000"
  104.         This.Font               := InstaNote.Font           , This.FontSize             := InstaNote.FontSize
  105.         This.FontOptions        := " "                      , This.FontColor            := "0xFF000000"
  106.         This.FontColorBottom    := "0x00FFFFFF"             , This.MarginX              := 3
  107.         This.MarginY            := 3                        , This.PaddingX             := 15
  108.         This.PaddingY           := 5                        , This.Output               := []
  109.         This.String             := []                       , This.CurrentPosition      := 1
  110.         This.CurrentLine        := 1                        , This.LineCount            := 1
  111.         This.WindowOptions := " -DPIScale +AlwaysOnTop +ToolWindow "
  112.     }
  113.     _UpdateDefaults( obj := "" , option := 0 ){
  114.         local k , v , bd
  115.         if( IsObject( obj ) )
  116.             for k, v in obj
  117.                 This[ k ] := obj[ k ]
  118.         if( option = 1 )
  119.             This._GetClipboard()
  120.         This.TextLineHeight := This._GetTextSize( 2 )
  121.         This.TextLineHeight +=  2 * This.PaddingY
  122.         This._GetString()
  123.         bd := InstaNote.Bind
  124.         Hotkey, ~LButton , % bd , On
  125.         ;**********************
  126.         ;~ This.RoundNess := This.TextLineHeight / 9
  127.         This.RoundNess := This.TextLineHeight / 8
  128.         ;**********************
  129.         ;~ if( !obj.FontSize )
  130.             ;~ This.FontSize := InstaNote.FontSize
  131.             ;~ ToolTip, % obj.Type "`" This.Type
  132.     }
  133.     _CreateWindow(){
  134.         This.Gui1 := New PopUpWindow( { AutoShow: 1 , X: This.X - This.W / 2 , Y: This.Y - This.H / 2 , W: This.W , H: This.H , Options: This.WindowOptions } )
  135.         This.Active := This.Gui1.Hwnd
  136.         Gui, % This.Gui1.Hwnd ":Show"
  137.     }
  138.     SetClipboard(){
  139.         if( InstaNote.Handles[ win := InstaNote._GetWindow() ].Output  )
  140.             Clipboard := InstaNote.Handles[ win := InstaNote._GetWindow() ]._GetString()
  141.     }
  142.     _GetClipboard(){
  143.         This.Output := StrSplit( clipboard , "" )
  144.     }
  145.     _WheelChange( input ){
  146.         local ctrl , Dir , win
  147.         if( This.WheelActive )
  148.             return
  149.         if( This.ft := !This.ft )
  150.             return
  151.         This.WheelActive := 1
  152.         if( InstaNote.Handles[ win := InstaNote._GetWindow() ].FontSize  ){
  153.             Dir := ( ( input >> 16 ) > 0x7FFF ) || ( ( input < 0 ) ? ( 1 ) : ( 0 ) )
  154.             if( Dir )
  155.                 ( GetKeyState( "Shift" ) ) ? (  InstaNote.Handles[ win ].FontSize += 10  , change := 1 ) : ( ++InstaNote.Handles[ win ].FontSize , change := 1 )
  156.             else
  157.                 ( ( GetKeyState( "Shift" ) ? ( InstaNote.Handles[ win ].FontSize -= 10 ) : ( --InstaNote.Handles[ win ].FontSize ) ) < 1 ) ? ( InstaNote.Handles[ win ].FontSize := 1 , change := 0 ) : ( change := 1 )
  158.             if( change ){
  159.                 InstaNote.Handles[ win ]._UpdateDefaults()
  160.                 InstaNote.Handles[ win ]._GetString()
  161.                 InstaNote.Handles[ win ]._Draw()
  162.             }
  163.         }
  164.         This.WheelActive := 0
  165.     }
  166.     _LButtonHK(){
  167.         bd := InstaNote.Bind
  168.         if( ( win := InstaNote._GetWindow() ) != InstaNote.Active ){
  169.             Hotkey, ~LButton , % bd , Off
  170.             ;******************************************
  171.             ;~ InstaNote.Handles[ InstaNote.Active ].BorderColor := "0xFFFF0000"
  172.             ;******************************************
  173.             InstaNote.Handles[ InstaNote.Active ]._Draw()
  174.             InstaNote.Active := ""
  175.         }
  176.     }
  177.     _GetWindow(){
  178.         local win
  179.         MouseGetPos,,, win
  180.         return win
  181.     }
  182.     _Resize(){
  183.         This.Gui1.UpdateSettings( { W: This.W , H: This.H } , UpdateGraphics := 1 )
  184.     }
  185.     _MoveWindow(){
  186.         local win , x , y
  187.         PostMessage, 0xA1 , 2
  188.         While( GetKeyState( "LButton" ) )
  189.             Sleep, 30
  190.         WinGetPos, x , y ,,, % "ahk_Id " win := InstaNote._GetWindow()
  191.         InstaNote.Handles[ win ].Gui1.UpdateSettings( { X: x , Y: y } )
  192.     }
  193.     _CloseWindow(){
  194.         local out
  195.         if( !IsObject( InstaNote.Handles[ win := InstaNote._GetWindow() ] ) )
  196.             return 0
  197.         if( InstaNote.Active = win ){
  198.             InstaNote.Active := ""
  199.             bd := InstaNote.Bind
  200.             Hotkey, ~LButton , % bd , Off
  201.         }
  202.         if( InstaNote.Handles[ win ].Type = "Google Search" || InstaNote.Handles[ win ].Type = "GoogleSearch" ){
  203.             out := InstaNote.Handles[ win ]._GetString()
  204.             Try
  205.                 run, % "http://www.google.com/search?hl=en&q=" out
  206.             catch
  207.                 msgbox, unknown error
  208.         }else if( GetKeyState( "Shift" ) )
  209.             Clipboard := InstaNote.Handles[ win ]._GetString()
  210.         InstaNote.Windows[ InstaNote.Handles[ win ].Index ] := ""
  211.         InstaNote.Handles[ win ].Gui1.DeleteWindow()
  212.         InstaNote.Handles[ win ] := ""
  213.     }
  214.     _CaptureKeys( key ){
  215.         if( key = 16 )
  216.             return 1
  217.         else if( key = 17 )
  218.             return 1
  219.         else if( key = 32 )
  220.             InstaNote.Handles[ InstaNote.Active ].Output.Push( " " )
  221.         else if( key = 13 ){
  222.             if( InstaNote.Handles[ InstaNote.Active ].Type = "GoogleSearch" || InstaNote.Handles[ InstaNote.Active ].Type = "Google Search" )
  223.                 InstaNote.Handles[ InstaNote.Active ]._CloseWindow()
  224.             else
  225.                 InstaNote.Handles[ InstaNote.Active ].Output.Push( "`n" )
  226.         }
  227.         else if( key = 8 )
  228.             InstaNote.Handles[ InstaNote.Active ].Output.Pop()
  229.         else if( key = 189 )
  230.             InstaNote.Handles[ InstaNote.Active ].Output.Push( ( GetKeyState( "Shift" ) ) ?  ( "_" ) : ( "-" ) )
  231.         else if( key = 187 )
  232.             InstaNote.Handles[ InstaNote.Active ].Output.Push( ( GetKeyState( "Shift" ) ) ?  ( "+" ) : ( "=" ) )
  233.         else if( key = 50 )
  234.             InstaNote.Handles[ InstaNote.Active ].Output.Push( ( GetKeyState( "Shift" ) ) ?  ( "@" ) : ( "2" ) )
  235.         else if( key = 54 )
  236.             InstaNote.Handles[ InstaNote.Active ].Output.Push( ( GetKeyState( "Shift" ) ) ?  ( "^" ) : ( "6" ) )
  237.         else if( key = 55 )
  238.             InstaNote.Handles[ InstaNote.Active ].Output.Push( ( GetKeyState( "Shift" ) ) ?  ( "&" ) : ( "7" ) )
  239.         else if( key = 56 )
  240.             InstaNote.Handles[ InstaNote.Active ].Output.Push( ( GetKeyState( "Shift" ) ) ?  ( "*" ) : ( "8" ) )
  241.         else if( key = 57 )
  242.             InstaNote.Handles[ InstaNote.Active ].Output.Push( ( GetKeyState( "Shift" ) ) ?  ( "(" ) : ( "9" ) )
  243.         else if( key = 48 )
  244.             InstaNote.Handles[ InstaNote.Active ].Output.Push( ( GetKeyState( "Shift" ) ) ?  ( ")" ) : ( "0" ) )
  245.         else if( key = 222 )
  246.             InstaNote.Handles[ InstaNote.Active ].Output.Push( ( GetKeyState( "Shift" ) ) ?  ( """" ) : ( "'" ) )
  247.         else if( key = 191 )
  248.             InstaNote.Handles[ InstaNote.Active ].Output.Push( ( GetKeyState( "Shift" ) ) ?  ( "?" ) : ( "/" ) )
  249.         else if( key = 188 )
  250.             InstaNote.Handles[ InstaNote.Active ].Output.Push( ( GetKeyState( "Shift" ) ) ?  ( "<" ) : ( "," ) )
  251.         else if( key = 190 )
  252.             InstaNote.Handles[ InstaNote.Active ].Output.Push( ( GetKeyState( "Shift" ) ) ?  ( ">" ) : ( "." ) )
  253.         else if( key = 220 )
  254.             InstaNote.Handles[ InstaNote.Active ].Output.Push( ( GetKeyState( "Shift" ) ) ?  ( "|" ) : ( "\" ) )
  255.         else if( key = 192 )
  256.             InstaNote.Handles[ InstaNote.Active ].Output.Push( ( GetKeyState( "Shift" ) ) ?  ( "~" ) : ( "``" ) )
  257.         else if( key = 186 )
  258.             InstaNote.Handles[ InstaNote.Active ].Output.Push( ( GetKeyState( "Shift" ) ) ?  ( ":" ) : ( ";" ) )
  259.         else if( key = 219 )
  260.             InstaNote.Handles[ InstaNote.Active ].Output.Push( ( GetKeyState( "Shift" ) ) ?  ( "{" ) : ( "[" ) )
  261.         else if( key = 221 )
  262.             InstaNote.Handles[ InstaNote.Active ].Output.Push( ( GetKeyState( "Shift" ) ) ?  ( "}" ) : ( "]" ) )
  263.         else if( key >= 48 && key <= 53 ){
  264.             InstaNote.Handles[ InstaNote.Active ].Output.Push( ( !GetKeyState( "Shift" ) ) ? chr( key ) : chr( key - 16 ) )
  265.         }else{ 
  266.             InstaNote.Handles[ InstaNote.Active ].Output.Push( ( GetKeyState( "Shift" ) ) ? chr( key ) : chr( key + 32 )   )
  267.         }
  268.         InstaNote.Handles[ InstaNote.Active ]._Draw()
  269.         return 1
  270.     }
  271.     _DrawClipboard(){
  272.         ;&&&&%%%%%%%$$$$$$$$$$$
  273.     }
  274.     _Draw(){
  275.         local string := This._GetString()
  276.         This.Gui1.ClearWindow( AutoUpdate := 0 )
  277.         This.Gui1.PaintBackground( { Color: This.BorderColor , X: 2 , Y: 2 , W: This.Gui1.W - 4 , H: This.Gui1.H - 4 , Round: This.RoundNess } )
  278.         Brush := Gdip_BrushCreateSolid( This.Color ) , Gdip_FillRoundedRectangle( This.Gui1.G, Brush , This.Bubble.X - This.PaddingX , This.Bubble.Y - This.PaddingY, This.Bubble.W , This.Bubble.H , This.RoundNess  ) , Gdip_DeleteBrush( Brush )
  279.         Brush := Gdip_BrushCreateSolid( This.FontColor ) , Gdip_TextToGraphics( This.Gui1.G , string , " s" This.Fontsize " c" Brush " vCenter " This.FontOptions " x" This.Bubble.X " y" This.Bubble.Y - This.PaddingY + 1 , This.Font , This.Bubble.W, This.Bubble.H  )
  280.         This.Gui1.UpdateWindow()
  281.     }
  282.     _GetTextSize( outputType := 0 , String := "" ){ ; 0 = all , 1 = width , 2 = height
  283.         local pBitmap, G, Brush, temparr
  284.         pBitmap := Gdip_CreateBitmap( 10,10), G := Gdip_GraphicsFromImage( pBitmap ), Gdip_SetSmoothingMode( G , 2 )
  285.         Brush := Gdip_BrushCreateSolid( "0xFF000000")
  286.         temparr := StrSplit( Gdip_TextToGraphics( G , ( String != "" ) ? ( String ) : ( "T" ) , " s" This.Fontsize " c" Brush " " This.FontOptions " x" 0 " y" 0 , This.Font , 10000, 10000  ),"|","|"  )
  287.         Gdip_DeleteBrush( Brush ), Gdip_DeleteGraphics( G ), Gdip_DisposeImage( pBitmap )
  288.         if( outputType = 0 )
  289.             return temparr
  290.         else if( outputType = 1 )
  291.             return temparr[ 3 ]
  292.         else if( outputType = 2 )
  293.             return temparr[ 4 ]
  294.     }
  295.     _GetString(){
  296.         static lw := ""
  297.         local text := "" , cc := This.Output , h
  298.         This.LineCount := 1
  299.         Loop, % cc.Length() {
  300.             if( cc[ A_Index ] = "`n" )
  301.                 ++This.LineCount
  302.             text .= cc[ A_Index ]
  303.         }
  304.         h := This.TextLineHeight * This.LineCount
  305.         w := This._GetTextSize( 1 , text ) + 2 * This.PaddingX
  306.         This.Bubble := { X: This.MarginX + This.PaddingX ,Y: This.MarginY + This.PaddingY , W: w , H: h }
  307.         This.H := h + 2 * This.MarginY
  308.         This.W := w + 2 * This.MarginX
  309.         if( This.LastH != This.H && This.LastH := This.H )
  310.             This._Resize()
  311.         if( lw != This.W )
  312.             This._Resize()     
  313.         ;*****************************************
  314.         ;~ This.RoundNess := h / 9
  315.         ;*****************************************
  316.         return text
  317.     }
  318. }
  319. ;*******************________________************************__________________*****************_______________*************
  320. ;                                                           Layered Window Class
  321. ;####################################################################################################################################################################################
  322. ;####################################################################################################################################################################################
  323. ;####################################################################################################################################################################################
  324. ;####################################################################################################################################################################################
  325. class PopUpWindow   {
  326. ;PopUpWindow v2.2
  327. ;Date Written: Oct 28th, 2021
  328. ;Last Edit: Feb 7th, 2022 :Changed the trigger method.
  329. ;Written By: Hellbent aka CivReborn
  330. ;SpcThanks: teadrinker , malcev
  331.     static Index := 0 , Windows := [] , Handles := [] , EditHwnd , HelperHwnd
  332.     __New( obj := "" ){
  333.         This._SetDefaults()
  334.         This.UpdateSettings( obj )
  335.         This._CreateWindow()
  336.         This._CreateWindowGraphics()
  337.         if( This.AutoShow )
  338.             This.ShowWindow( This.Title )
  339.     }
  340.     _SetDefaults(){
  341.         This.X := 10
  342.         This.Y := 10
  343.         This.W := 10
  344.         This.H := 10
  345.         This.Smoothing := 2
  346.         This.Options := " -DPIScale +AlwaysOnTop "
  347.         This.AutoShow := 0
  348.         This.GdipStartUp := 0
  349.         This.Title := ""
  350.        
  351.         This.Controls := []
  352.         This.Handles := []
  353.         This.Index := 0
  354.     }
  355.     UpdateSettings( obj := "" , UpdateGraphics := 0 ){
  356.         local k , v
  357.         if( IsObject( obj ) )
  358.             for k, v in obj
  359.                 This[ k ] := obj[ k ]
  360.         ( This.X = "Center" ) ? ( This.X := ( A_ScreenWidth - This.W ) / 2 )    
  361.         ( This.Y = "Center" ) ? ( This.Y := ( A_ScreenHeight - This.H ) / 2 )  
  362.         if( UpdateGraphics ){
  363.             This._DestroyWindowsGraphics()
  364.             This._CreateWindowGraphics()
  365.         }
  366.     }
  367.     _CreateWindow(){
  368.         local hwnd
  369.         Gui , New, % " +LastFound +E0x80000 hwndhwnd -Caption  " This.Options
  370.         PopUpWindow.Index++
  371.         This.Index := PopUpWindow.Index
  372.         PopUpWindow.Windows[ PopUpWindow.Index ] := This
  373.         This.Hwnd := hwnd
  374.         PopUpWindow.Handles[ hwnd ] := PopUpWindow.Index
  375.         if( This.GdipStartUp && !PopUpWindow.pToken )
  376.             PopUpWindow.pToken := GDIP_STARTUP()
  377.     }
  378.     _DestroyWindowsGraphics(){
  379.         Gdip_DeleteGraphics( This.G )
  380.         SelectObject( This.hdc , This.obm )
  381.         DeleteObject( This.hbm )
  382.         DeleteDC( This.hdc )
  383.     }
  384.     _CreateWindowGraphics(){
  385.         This.hbm := CreateDIBSection( This.W , This.H )
  386.         This.hdc := CreateCompatibleDC()
  387.         This.obm := SelectObject( This.hdc , This.hbm )
  388.         This.G := Gdip_GraphicsFromHDC( This.hdc )
  389.         Gdip_SetSmoothingMode( This.G , This.Smoothing )
  390.     }
  391.     ShowWindow( Title := "" ){
  392.         Gui , % This.Hwnd ":Show", % "x" This.X " y" This.Y " w" This.W " h" This.H " NA", % Title
  393.     }
  394.     HideWindow(){
  395.         Gui , % This.Hwnd ":Hide",
  396.     }
  397.     UpdateWindow(){
  398.         UpdateLayeredWindow( This.hwnd , This.hdc , This.X , This.Y , This.W , This.H )
  399.     }
  400.     ClearWindow( AutoUpdate := 0 ){
  401.         Gdip_GraphicsClear( This.G )
  402.         if( Autoupdate )
  403.             This.UpdateWindow()
  404.     }
  405.     DrawBitmap( pBitmap , obj , dispose := 1 , AutoUpdate := 0 ){
  406.         Gdip_DrawImage( This.G , pBitmap , obj.X , obj.Y , obj.W , obj.H )
  407.         if( dispose )
  408.             Gdip_DisposeImage( pBitmap )
  409.         if( Autoupdate )
  410.             This.UpdateWindow()
  411.     }
  412.     PaintBackground( color := "0xFF000000" , AutoUpdate := 0 ){
  413.         if( isObject( color ) ){
  414.             Brush := Gdip_BrushCreateSolid( ( color.HasKey( "Color" ) ) ? ( color.Color ) : ( "0xFF000000" ) )
  415.             if( color.Haskey( "Round" ) )
  416.                 Gdip_FillRoundedRectangle( This.G , Brush , color.X , color.Y , color.W , color.H , color.Round )
  417.             else
  418.                 Gdip_FillRectangle( This.G , Brush , color.X , color.Y , color.W , color.H )
  419.         }else{
  420.             Brush := Gdip_BrushCreateSolid( color )
  421.             Gdip_FillRectangle( This.G , Brush , -1 , -1 , This.W + 2 , This.H + 2 )
  422.         }
  423.         Gdip_DeleteBrush( Brush )
  424.         if( AutoUpdate )
  425.             This.UpdateWindow()
  426.     }
  427.     DeleteWindow( GDIPShutdown := 0 ){
  428.         Gui, % This.Hwnd ":Destroy"
  429.         SelectObject( This.hdc , This.obm )
  430.         DeleteObject( This.hbm )
  431.         DeleteDC( This.hdc )
  432.         Gdip_DeleteGraphics( This.G )
  433.         hwnd := This.Hwnd
  434.         for k, v in PopUpWindow.Windows[ Hwnd ]
  435.             This[k] := ""
  436.         PopUpWindow.Windows[ Hwnd ] := ""
  437.         if( GDIPShutdown ){
  438.             Gdip_Shutdown( PopUpWindow.pToken )
  439.             PopUpWindow.pToken := ""
  440.         }
  441.     }
  442. }
  443.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement