ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE.

DonationCoder.com Software > Post New Requests Here

Need ADH Advice

<< < (3/7) > >>

Target:
I'd like to understand how variables, such as tooltipflag work, such that it keeps its value over two AHK calls but not over two calls from PowerPro.-Kruskal (May 06, 2010, 11:27 PM)
--- End quote ---

the original AHK script is persistent, ie it runs and stays resident.  Triggering the hotkey fires the routine which assesses the value of the tooltipflag variable and processes accordingly

calling the recompiled script from powerpro destroys the previous instance, and the script starts again from scratch - in this case the 'default' action is to display the tooltip, so repeatedly running the script will have no discernable effect

What is the significance of your (true) assumption that I compiled the code?  Would it work as I wanted if I didn't compile it?
--- End quote ---

no particular significance, it was just my assumption of how you were doing things - ultimately it probably wouldn't make any difference (other than the fact that you need to have AHK installed in order to run an uncompiled script)

skwire:
I'm not at my main computer right now, but I'm pretty sure that you are wrong. The little window showing the window owning program stays displayed after the program exits (as I recall).-Kruskal (May 06, 2010, 11:43 PM)
--- End quote ---

It stayed showing because you had a second hotkey (#q::) defined in the script which made the script never exit/end.

I could live with the timeout, but I really don't prefer it. I frequently have to do a lot of stuff based on the information and I'd have to write it down.-Kruskal (May 06, 2010, 11:43 PM)
--- End quote ---

How about displaying it while simultaneous copying the data to your clipboard?

What happened to the INI solution? I was looking forward to details.-Kruskal (May 06, 2010, 11:43 PM)
--- End quote ---

The fact is, without some sort of delay, that type of script will start, run the code, and exit in the blink of an eye.  When it exits, it destroys any tooltip created.  

Target:
further to skwires explanation here's an example that writes to an ini file, but as he says, as soon as the exe...umm... exits, any windows or values are lost


--- ---;AutoHotkeys.ahk
;Vincent Kruskal's Hotkeys
;Skrommel @ 2007
;Kruskal  @ 2007

#SingleInstance,Force
#NoEnv

iniread, tooltipflag, VKh.ini, flag, status

If ToolTipFlag = 0
{
MouseGetPos,x,y,winid,ctrlid
WinGet,pid,Pid,ahk_id %winid%
path:=GetModuleFileNameEx(pid)
ToolTip,%path%
iniwrite, 1, VKH.ini, flag, status
}
Else
{
ToolTip,
iniwrite,0, VKH.ini, flag, status
}
sleep, 5000

exitapp
Return

#q::
  SoundPlay,C:\Documents and Settings\Administrator\My Documents\My Sound Effects\silence.wav
  Return

GetModuleFileNameEx(p_pid) ;by shimanov at www.autohotkey
{
   
   If A_OSVersion in WIN_95,WIN_98,WIN_ME,WIN_XP
   {
     WinGet,name,ProcessName,ahk_id %p_pid%
     Return,name
   }
   h_process:=DllCall("OpenProcess","uint",0x10|0x400,"int",false,"uint",p_pid) ;  PROCESS_VM_READ=0x0010  PROCESS_QUERY_INFORMATION=0x0400
   If (ErrorLevel or h_process=0)
      Return
   name_size=255
   VarSetCapacity(name,name_size)   
   result:=DllCall("psapi.dll\GetModuleFileNameExA","uint",h_process,"uint",0,"str",name,"uint",name_size)
   DllCall("CloseHandle",h_process)
   Return,name
}


and the only reason this one works is because there's a short delay at the end to display the tooltip...

seems like the original solution might still be the best one for your situation

just out of curiosity is there any reason why you couldn't translate the script into powerpro?  I suspect this may alleviate a lot of the issues you're experiencing (don't ask me, I don't know the language, but my feeling is that it shouldn't be that hard to do... hehe, famous last words...) 

Kruskal:
I'm not at my main computer right now, but I'm pretty sure that you are wrong. The little window showing the window owning program stays displayed after the program exits (as I recall).-Kruskal (May 06, 2010, 11:43 PM)
--- End quote ---

It stayed showing because you had a second hotkey (#q::) defined in the script which made the script never exit/end.-skwire (May 06, 2010, 11:59 PM)
--- End quote ---
I was wondering about that. I probably added that at some point. Any idea why I wanted to have a hotkey sound silence????

I could live with the timeout, but I really don't prefer it. I frequently have to do a lot of stuff based on the information and I'd have to write it down.-Kruskal (May 06, 2010, 11:43 PM)
--- End quote ---

How about displaying it while simultaneous copying the data to your clipboard?-skwire (May 06, 2010, 11:59 PM)
--- End quote ---
Cute idea (if I knew how to do it). But I really don't need a copy of the information -- I need to act on it.

What happened to the INI solution? I was looking forward to details.-Kruskal (May 06, 2010, 11:43 PM)
--- End quote ---

The fact is, without some sort of delay, that type of script will start, run the code, and exit in the blink of an eye.  When it exits, it destroys any tooltip created.  
-skwire (May 06, 2010, 11:59 PM)
--- End quote ---

That's a disappointment.  So there is no solution consistent with my preferences?

Thanks -- Vincent

skwire:
That's a disappointment.  So there is no solution consistent with my preferences?-Kruskal (May 07, 2010, 12:13 AM)
--- End quote ---

I could make it display a small GUI window instead of using a tooltip.  This way, you could move it out of the way, leave it open as long as necessary, and close it when you're done.  Your thoughts?

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version