Sign in to follow this  
Followers 0
rakudave

Pangaea_PostIt

11 posts in this topic

when you have to store multiple informations in the clipboard (like colors, when desingning a webpage)

you can store the info with Pangaea_PostIt and recall it anytime you like. Even rebooting doesn't erase it... ^^

the gui will slide in from the right side, providing a notepad. you can fix the gui (like a postit) or close it with {ESC} or the [x]-button, and it'll slide-out. moving your mouse to the rightmost position will make it reappear.

you can also export the text into a .txt-file

CODE
#include <GUIConstants.au3>

Global $fixed

$main = GUICreate("Pangaea_PostIt",200,400,@desktopwidth - 200,-1,-1,BitOr($WS_EX_TOOLWINDOW,$WS_EX_TOPMOST))

$note = GUICtrlCreateEdit("",0,0,200,376,$ES_WANTRETURN)

$fix = GUICtrlCreateButton("fixed: off",5,378,60,20)

$exp = GUICtrlCreateButton("export",70,378,60,20)

$quit = GUICtrlCreateButton("exit",135,378,60,20)

_read()

DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $main, "int", 250, "long", 0x00040002)

$fixed = 0

GUISetState()

While 1

$msg = GUIGetMsg()

$cur = MouseGetPos()

select

case $msg = $GUI_EVENT_CLOSE

_winout()

case $msg = $fix

_fix()

case $msg = $exp

_exp()

case $msg = $quit

_quit()

EndSelect

If $cur[0] > @desktopwidth -2 then _winin()

Wend

Func _winout()

If $fixed = 1 then return

DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $main, "int", 250, "long", 0x00050001)

_save()

EndFunc

Func _winin()

If WinGetPos("Pangaea Notepad") = @desktopwidth - 200 then return

DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $main, "int", 250, "long", 0x00040002)

EndFunc

Func _fix()

select

case $fixed = 0

GUICtrlSetData($fix,"fixed: on")

$fixed = 1

case $fixed = 1

GUICtrlSetData($fix,"fixed: off")

$fixed = 0

endselect

EndFunc

Func _exp()

_save()

$saveto = FileSaveDialog ("Export to Textfile","","Textfile (*.txt)",24,"my_notes.txt")

If StringRight($saveto,4) <> ".txt" then $saveto = $saveto & ".txt"

$file = FileOpen($saveto, 1)

FileWrite($file, GUICtrlRead($note))

FileClose($file)

EndFunc

Func _save()

FileDelete("C:\test.txt")

$file = FileOpen("C:\test.txt", 1)

FileWrite($file, GUICtrlRead($note))

FileClose($file)

FileSetAttrib("C:\test.txt","H")

EndFunc

Func _read()

$file = FileOpen("C:\test.txt", 0)

$content = ""

While 1

$content = $content & FileRead($file, 1)

If @error = -1 Then ExitLoop

Wend

FileClose($file)

GUICtrlSetData($note,$content)

EndFunc

Func _quit()

_save()

DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $main, "int", 500, "long", 0x00090000)

exit

EndFunc

... let me know what you think ...

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Hey...i made also something to store my ClipBoard entries

HotKeySet("^c","copy")
HotKeySet("{ESC}","escape")
HotKeySet("{PGUP}","up")
HotKeySet("{PGDN}","down")

MsgBox(0,"ClipBoarder 1.0","ESC          - Exit" & @LF & "Page Up     - Forward" & @LF & "Page Down - Backword")

$i = 0
$max = 0
$file = FileOpen(@ScriptDir & "\clipboard.txt", 10)
$ini = FileOpen(@ScriptDir & "\clipboard_pref.ini", 9)
FileClose($file)

If IniRead(@ScriptDir & "\clipboard_pref.ini","settings","Autostart",-1) = -1 Then
    IniWrite(@ScriptDir & "\clipboard_pref.ini","settings","Autostart",0)   
ElseIf IniRead(@ScriptDir & "\clipboard_pref.ini","settings","Autostart",-1) = 0 Then
    RegDelete("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run","ClipBoarder")
ElseIf IniRead(@ScriptDir & "\clipboard_pref.ini","settings","Autostart",-1) = 1 Then
    $reg = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run","ClipBoarder")
        If @error = -1 Then
            RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run","ClipBoarder","REG_SZ",@ScriptFullPath)
        EndIf
EndIf
    
While 1
WEnd

Func copy()
    $file = FileOpen(@ScriptDir & "\clipboard.txt", 9)
    HotKeySet("^c")
    Send("^c")
    $clip = ClipGet()
    FileWrite($file,$clip  & @CRLF)
    $i += 1
    $max += 1
    ToolTip("Clipboard: " & $clip & @LF & "Current Clip: " & $max & @LF &"Max Clips: "& $max,0,0)
    HotKeySet("^c","copy")
    FileClose($file)
EndFunc

Func up()
If $i < $max Then
    $file = FileOpen(@ScriptDir & "\clipboard.txt", 0)
    $i += 1
    $text = FileReadLine($file,$i)
    ClipPut($text)
    $clip = $text
    ToolTip("Clipboard: " & $clip & @LF & "Current Clip: " & $i & @LF &"Max Clips: "& $max,0,0)
    FileClose($file)
EndIf
EndFunc

Func down()
If $i > 1 Then
    $file = FileOpen(@ScriptDir & "\clipboard.txt", 0)
    $i -= 1
    $text = FileReadLine($file,$i)
    ClipPut($text)
    $clip = $text
    ToolTip("Clipboard: " & $clip & @LF & "Current Clip: " & $i & @LF &"Max Clips: "& $max,0,0)
    FileClose($file)
EndIf
EndFunc

Func escape()
    FileClose($file)
    Exit
EndFunc
Edited by XxXFaNtA

Share this post


Link to post
Share on other sites

grr, when i try to copy and past the script in 2 note pad it messes up, only does it with the scroll window ones. anyone no why it happens?

Share this post


Link to post
Share on other sites

when you have to store multiple informations in the clipboard (like colors, when desingning a webpage)

you can store the info with Pangaea_PostIt and recall it anytime you like. Even rebooting doesn't erase it... ^^

the gui will slide in from the right side, providing a notepad. you can fix the gui (like a postit) or close it with {ESC} or the [x]-button, and it'll slide-out. moving your mouse to the rightmost position will make it reappear.

you can also export the text into a .txt-file

CODE
#include <GUIConstants.au3>

Global $fixed

$main = GUICreate("Pangaea_PostIt",200,400,@desktopwidth - 200,-1,-1,BitOr($WS_EX_TOOLWINDOW,$WS_EX_TOPMOST))

$note = GUICtrlCreateEdit("",0,0,200,376,$ES_WANTRETURN)

$fix = GUICtrlCreateButton("fixed: off",5,378,60,20)

$exp = GUICtrlCreateButton("export",70,378,60,20)

$quit = GUICtrlCreateButton("exit",135,378,60,20)

_read()

DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $main, "int", 250, "long", 0x00040002)

$fixed = 0

GUISetState()

While 1

$msg = GUIGetMsg()

$cur = MouseGetPos()

select

case $msg = $GUI_EVENT_CLOSE

_winout()

case $msg = $fix

_fix()

case $msg = $exp

_exp()

case $msg = $quit

_quit()

EndSelect

If $cur[0] > @desktopwidth -2 then _winin()

Wend

Func _winout()

If $fixed = 1 then return

DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $main, "int", 250, "long", 0x00050001)

_save()

EndFunc

Func _winin()

If WinGetPos("Pangaea Notepad") = @desktopwidth - 200 then return

DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $main, "int", 250, "long", 0x00040002)

EndFunc

Func _fix()

select

case $fixed = 0

GUICtrlSetData($fix,"fixed: on")

$fixed = 1

case $fixed = 1

GUICtrlSetData($fix,"fixed: off")

$fixed = 0

endselect

EndFunc

Func _exp()

_save()

$saveto = FileSaveDialog ("Export to Textfile","","Textfile (*.txt)",24,"my_notes.txt")

If StringRight($saveto,4) <> ".txt" then $saveto = $saveto & ".txt"

$file = FileOpen($saveto, 1)

FileWrite($file, GUICtrlRead($note))

FileClose($file)

EndFunc

Func _save()

FileDelete("C:\test.txt")

$file = FileOpen("C:\test.txt", 1)

FileWrite($file, GUICtrlRead($note))

FileClose($file)

FileSetAttrib("C:\test.txt","H")

EndFunc

Func _read()

$file = FileOpen("C:\test.txt", 0)

$content = ""

While 1

$content = $content & FileRead($file, 1)

If @error = -1 Then ExitLoop

Wend

FileClose($file)

GUICtrlSetData($note,$content)

EndFunc

Func _quit()

_save()

DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $main, "int", 500, "long", 0x00090000)

exit

EndFunc

... let me know what you think ...
I was just curious if anyone got this postit script to work. I couldn't and I noticed that there are not very many posts about it.

taurus905


"Never mistake kindness for weakness."-- Author Unknown --"The highest point to which a weak but experienced mind can rise is detecting the weakness of better men."-- Georg Lichtenberg --Simple Obfuscator (Beta not needed.), Random names for Vars and Funcs

Share this post


Link to post
Share on other sites

I was just curious if anyone got this postit script to work. I couldn't and I noticed that there are not very many posts about it.

Same here... couldn't get it to work (it runs without errors, though).

Share this post


Link to post
Share on other sites

#8 ·  Posted (edited)

I get an error: variable not been declared - I've checked - and I've got the full script and tried running it in 3.1 + Beta.

It doesn't seem to like the $ws_ex_toolwindow or $ws_ex_topmost.

I presume I'm doing something wrong....

Mdiesel

p.s. XxXFaNtA's one works fine and is a looks great after a using it for a bit!! Is there a way i can stick it to the bottom right - it changes size so i can't set it by pixels...

Edited by mdiesel

Share this post


Link to post
Share on other sites

I get an error: variable not been declared - I've checked - and I've got the full script and tried running it in 3.1 + Beta.

It doesn't seem to like the $ws_ex_toolwindow or $ws_ex_topmost.

I presume I'm doing something wrong....

Mdiesel

p.s. XxXFaNtA's one works fine and is a looks great after a using it for a bit!! Is there a way i can stick it to the bottom right - it changes size so i can't set it by pixels...

Nice way to bring a close to 3 year old topic there.

#include <WindowsConstants.au3>

Perhaps.

Share this post


Link to post
Share on other sites

I'm a noob - I'm allowed to miss obvious things like dates...

well..that works - but theres still more errors for me...

I think i'll give it a miss

Mdiesel

Share this post


Link to post
Share on other sites

#11 ·  Posted (edited)

No not even a noob should be forgiven for that :P

#include <GUIConstants.au3>
#include <WindowsConstants.au3>
#include <GUIEdit.au3>

Global $fixed

If Not FileExists("C:\test.txt") Then
    $f = FileOpen("C:\test.txt", 1)
    FileWrite($f, "")
EndIf

$main = GUICreate("Pangaea_PostIt", 200, 400, @DesktopWidth - 200, -1, -1, BitOR($WS_EX_TOOLWINDOW, $WS_EX_TOPMOST))
$note = GUICtrlCreateEdit("", 0, 0, 200, 376, $ES_WANTRETURN)
$fix = GUICtrlCreateButton("fixed: off", 5, 378, 60, 20)
$exp = GUICtrlCreateButton("export", 70, 378, 60, 20)
$quit = GUICtrlCreateButton("exit", 135, 378, 60, 20)
_read()
DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $main, "int", 250, "long", 0x00040002)
$fixed = 0
GUISetState(@SW_SHOW)

While 1
    $msg = GUIGetMsg()
    $cur = MouseGetPos()
    Select
        Case $msg = $GUI_EVENT_CLOSE
            _winout()
        Case $msg = $fix
            _fix()
        Case $msg = $exp
            _exp()
        Case $msg = $quit
            _quit()
    EndSelect
    If $cur[0] > @DesktopWidth - 2 Then _winin()
WEnd

Func _winout()
    If $fixed = 1 Then Return
    DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $main, "int", 250, "long", 0x00050001)
    _save()
EndFunc  ;==>_winout

Func _winin()
    If WinGetPos("Pangaea Notepad") = @DesktopWidth - 200 Then Return
    DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $main, "int", 250, "long", 0x00040002)
EndFunc  ;==>_winin

Func _fix()
    Select
        Case $fixed = 0
            GUICtrlSetData($fix, "fixed: on")
            $fixed = 1
        Case $fixed = 1
            GUICtrlSetData($fix, "fixed: off")
            $fixed = 0
    EndSelect
EndFunc  ;==>_fix

Func _exp()
    _save()
    $saveto = FileSaveDialog("Export to Textfile", "", "Textfile (*.txt)", 24, "my_notes.txt")
    If StringRight($saveto, 4) <> ".txt" Then $saveto = $saveto & ".txt"
    $file = FileOpen($saveto, 1)
    FileWrite($file, GUICtrlRead($note))
    FileClose($file)
EndFunc  ;==>_exp

Func _save()
    FileDelete("C:\test.txt")
    $file = FileOpen("C:\test.txt", 1)
    FileWrite($file, GUICtrlRead($note))
    FileClose($file)
    FileSetAttrib("C:\test.txt", "H")
EndFunc  ;==>_save

Func _read()
    $file = FileOpen("C:\test.txt", 0)
    $content = ""
    While 1
        $content = $content & FileRead($file, 1)
        If @error = -1 Then ExitLoop
    WEnd
    FileClose($file)
    GUICtrlSetData($note, $content)
EndFunc  ;==>_read

Func _quit()
    _save()
    DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $main, "int", 500, "long", 0x00090000)
    Exit
EndFunc  ;==>_quit

Should work but nothing happens. Try work on it. - It needed the file to be made already. I have done that.

Edited by JamesBrooks

Share this post


Link to post
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
Sign in to follow this  
Followers 0