Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
GetToolbarOwner, does this new dll function still work on xp
#1
Hi, I was wondering if the dll function (GetToolbarOwner) still works on xp as well as vista. Or is (GetToolbarOwner) only for vista?
#2
Works on all OS. If a function does not work on some OS, you can read about it in QM help or function's help.
#3
Gintaras Wrote:Works on all OS. If a function does not work on some OS, you can read about it in QM help or function's help.
Ok thanks.
#4
Ok this code stores the OWNER window handle of the window the Toolbar is attached to, into Global Variable ( w1 ) when the menu button is pressed. So in one of my functions that is on the menu ok so then when I run one of my functions off the menu on the toolbar say, "Function1" since I have int+ w1 in Function1 it will use that toolbars OwnerWindow handle to execute the code. But when I try to run the same function "Function1" off of another window, it will change the Global Variable ( w1 ) to the other toolbars owner window handle, makeing it stop on the first window, right when the menu button is pressed on another window. Then it will start on the other window. I don't understand why if the Global Variable is changed, it effects code that's already in a rep loop with the other toolbars owner window handle. Can you please help me think of an idea so that it will get Toolbars Owner Window , then store it into a Global Variable, but once the code is in a rep loop with the first toolbars owner window handle, it will not matter if that global variable ( w1 ) is changed to another toolbars owner window handle. and will continue on the other windows. Any ideas?
#5
In the function, copy the global variable to a local variable and use the local variable in the function.

int+ w1
int w2=w1
;example code
rep
,but 1000 w2
,0.1
#6
edit, o ok , ok I'll try that.
sorry at first didn't read the whole code you wrote, I do that often. So I shouldn't have to have activate owner on your way, thanks.
edit 2:

ok I tried int+ w1; int w2=w1 , but it didn't start the function on the toolbars owner window, because the way I test this, is activate the other window, then press the menu button on the non-activated window, then make sure the window I want the function to run on is still inactive when I run the function off the menu. & it started it on the active window, so should I maybe use something else? yes I know the toolbar should get the owner window of it's menu button, but it doesn't seem like it is when I'm , storeing the global variables owner window into a local variable.

The option doesn't seem to be on by default for me, each time I restart qm, & the toolbar goes on it's window, I have to click activate owner manually. But I can fix that... it's just that it would be a bit better if it could be inactive whilst I run a function off the window, & it start on that window, it should , maybe it's because I have vista...

--------------------------------------------------
#7
The option is on by default.
#8
Gintaras Wrote:The option is on by default.
Ok I think this is solved, I can just make a function to click activate Owner, because GetWindow isn't getting the right toolbars owner window handle, it's just grabbing the active windows handle. Most likely because vista, because GetToolbarOwner seemed to work fine, but I have qm 2.1.9

----------------------------------
Edit: Should I make a new topic, for another question I have that doesn't have much to do with this Topic? or should I post it here?
----------------------------------
#9
Ok it relates to this topic some what :? .

I'm trying to think of some way to tell if a function say "Function1" is already running on the
Handle window, Example:
-
could I insert some code in the rep loop or at the beginning of the function to see if the function is already running on a windows handle? & if it is then just ret. but if it's another windows handle that the function is not running on, then to allow it.
#10
You use SetProp. In next line insert atend SomeFunction w2, where SomeFunction is name of a function that sets the property to 0, or removes it.

Code:
Copy      Help
if(GetProp(w2 "running")) ret
SetProp w2 "running" 1
atend SomeFunction w2

Function SomeFunction:
Code:
Copy      Help
function w2
SetProp w2 "running" 0

(not tested)
#11
Ok well, I've figured out that the toolbar is getting the right handle, because if I put at the end of the toolbar code, ;act w1 it's activateing the right window. So I don't understand why if I use int+ w1; int w2=w1 then put w2 after each statement , it's starting the function on the wrong window, (only active window) it won't use the window handle stored in the local variable w2, not if I just had int+ w1 & put w1 after each statement, it still uses the handle of the active window, & if I put act w1 after the toolbar gets the handle ;act w1, that makes the menu go away so you have to click the menu again to bring it up. I don't like that. I know it's because vista now. I forgot, GetWindow doesn't work right on vista. I have the older version of QM, 2.1.9.1 & when i try to upgrade to 2.2.0.6 or later, my registration code does not work, Is there a reason for this? (therefore I canno't use dll function GetToolbarOwner) meaning I canno't get the toolbars Owner Window & use it in another function the right way Cry why can't I use 2.2.0.6 or later? if I can't use it, could you make a function similar to GetToolbarOwner so it works for vista, so I can import into my QM version so I can Get the Toolbars Owner & use it the correct way?
#12
int+ w1=GetWindow(TriggerWindow GW_OWNER)

gets incorrect window handle on Vista. Try this:

int+ w1=GetAncestor(GetWindow(TriggerWindow GW_OWNER) 2)

This code should work on all OS and all QM versions. Not tested.

---

Quote:I have the older version of QM, 2.1.9.1 & when i try to upgrade to 2.2.0.6 or later, my registration code does not work

PM or email me your registration code.
#13
wow great! it works. Thank You Very Much.
#14
it seems this will work, some how, maybe I'm just not putting it together right. do I have to put anything in the rep loop?
#15
Maybe "running" property previously was set to 1 but not set to 0 when Function1 ended. Try to restart these windows.

Check if STOP function is called. Place out "STOP called" in it.
#16
wow Gintras, Thank you very very much for takeing the time to assist me Smile . I've figured it out with a bit of expiermenting with it ! thanks a lot again.


Forum Jump:


Users browsing this thread: 1 Guest(s)