lawonama Posted July 3, 2017 Share Posted July 3, 2017 (edited) Hello, I've tried to make a notepad application to writing notes slightly easier. What I want to do is when I hover my mouse on the top left of the screen a function will be done. It doesn't seem to work. And is it possible to know if the user tries to close the notepad? Like : If X button is pressed: Do this ? #include <Constants.au3> $s = "(1, 1)" if $s = Mousegetpos() then Example() Func Example() $PASSWORD = InputBox("PASSWORD","TYPE HERE PASSWORD","AutoIt","*") Run("notepad.exe") EndFunc while 1 sleep(1000) wend Edited July 3, 2017 by lawonama Link to comment Share on other sites More sharing options...
Danyfirex Posted July 3, 2017 Share Posted July 3, 2017 You could do something like this: #include <Constants.au3> Local $aPos = 0 While Sleep(500) $aPos = MouseGetPos() If IsArray($aPos) Then If $aPos[0] = 0 And $aPos[1] = 0 Then Example() EndIf WEnd Func Example() $PASSWORD = InputBox("PASSWORD", "TYPE HERE PASSWORD", "AutoIt", "*") Run("notepad.exe") EndFunc ;==>Example Saludos Danysys.com AutoIt... UDFs: VirusTotal API 2.0 UDF - libZPlay UDF - Apps: Guitar Tab Tester - VirusTotal Hash Checker Examples: Text-to-Speech ISpVoice Interface - Get installed applications - Enable/Disable Network connection PrintHookProc - WINTRUST - Mute Microphone Level - Get Connected NetWorks - Create NetWork Connection ShortCut Link to comment Share on other sites More sharing options...
ViciousXUSMC Posted July 3, 2017 Share Posted July 3, 2017 (edited) Here is what I came up with. expandcollapse popupAdlibRegister("_CheckMouse") Local $iMouseDelay = 1 ;Seconds to Hold Mouse Local $iNotepadClose = 1 ;1 - Closed 0 - Open If ProcessExists("Notepad.exe") Then $iNotepadClose = 0 While 1 Sleep(10) If $iNotepadClose = 1 Then If ProcessExists("Notepad.exe") Then $iNotepadClose = 0 EndIf If $iNotepadClose = 0 Then If Not ProcessExists("Notepad.exe") Then $iNotepadClose = 1 _DetectedClose() EndIf EndIf WEnd Func _CheckMouse() $aPOS = MouseGetPos() If IsArray($aPOS) Then If $aPos[0]+$aPos[1] = 0 Then Sleep($iMouseDelay*1000) $aPOS = MouseGetPos() If $aPos[0]+$aPos[1] = 0 Then _Example() EndIf EndIf EndFunc Func _Example() $sOpenPrompt = InputBox("", "Enter Password", "", "*") If $sOpenPrompt = "password" Then Run("notepad.exe") EndFunc Func _DetectedClose() MsgBox(0, "", "Notepad was just closed") EndFunc Edited July 3, 2017 by ViciousXUSMC Link to comment Share on other sites More sharing options...
lawonama Posted July 3, 2017 Author Share Posted July 3, 2017 Amazing! Thanks to both of you guys. This is amazing! Is it also possible to use the inserted password as the title of the notepad when you close it, and save it to My Documents > Create map called $sOpenPrompt and save it as "Todays Date + $sOpenPrompt" Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now