Jump to content



Photo

Pangaea_PostIt


  • Please log in to reply
10 replies to this topic

#1 rakudave

rakudave

    Polymath

  • Active Members
  • PipPipPipPip
  • 245 posts

Posted 18 June 2006 - 11:22 AM

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 ...





#2 XxXFaNtA

XxXFaNtA

    Adventurer

  • Active Members
  • PipPip
  • 128 posts

Posted 18 June 2006 - 12:08 PM

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

AutoIt         
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, 18 June 2006 - 12:08 PM.

/

Posted Image


#3 rakudave

rakudave

    Polymath

  • Active Members
  • PipPipPipPip
  • 245 posts

Posted 18 June 2006 - 08:27 PM

hmm, i get some errors (line 33), but it looks good...


anyone tryed mine yet?

#4 amdead

amdead

    Seeker

  • Active Members
  • 35 posts

Posted 18 June 2006 - 08:29 PM

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?

#5 rakudave

rakudave

    Polymath

  • Active Members
  • PipPipPipPip
  • 245 posts

Posted 19 June 2006 - 10:16 AM

ahm, its not supposed to run in 2 apps...
i created it as "one window"...

#6 taurus905

taurus905

    "Lead, follow, or get out of the way."

  • Active Members
  • PipPipPipPipPipPip
  • 440 posts

Posted 21 June 2006 - 10:55 PM

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

#7 leuce

leuce

    Universalist

  • Active Members
  • PipPipPipPipPip
  • 259 posts

Posted 04 July 2006 - 07:06 PM

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).

#8 Mat

Mat

    43 38 48 31 30 4E 34 4F 32

  • MVPs
  • 4,040 posts

Posted 01 March 2009 - 08:21 PM

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, 01 March 2009 - 08:32 PM.

I don't know where I'm going, but I'm on my way.


#9 James

James

    jbrooksuk

  • MVPs
  • 9,470 posts

Posted 01 March 2009 - 09:57 PM

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.

#10 Mat

Mat

    43 38 48 31 30 4E 34 4F 32

  • MVPs
  • 4,040 posts

Posted 02 March 2009 - 05:18 PM

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

I don't know where I'm going, but I'm on my way.


#11 James

James

    jbrooksuk

  • MVPs
  • 9,470 posts

Posted 02 March 2009 - 06:40 PM

No not even a noob should be forgiven for that :P
Plain Text         
#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, 02 March 2009 - 06:42 PM.





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users